aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/asm-x86/msi.h
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2012-01-23 09:35:17 +0000
committerJan Beulich <jbeulich@suse.com>2012-01-23 09:35:17 +0000
commit74c213c506afcd74a8556dd092995fd4dc38b225 (patch)
tree2d0e2eb788d9d710f0ac438a2ad63739bebf0565 /xen/include/asm-x86/msi.h
parent9346f6cfbfb992b4fb38b802b794f194f1209dbf (diff)
downloadxen-74c213c506afcd74a8556dd092995fd4dc38b225.tar.gz
xen-74c213c506afcd74a8556dd092995fd4dc38b225.tar.bz2
xen-74c213c506afcd74a8556dd092995fd4dc38b225.zip
x86/vMSI: miscellaneous fixes
This addresses a number of problems in msixtbl_{read,write}(): - address alignment was not checked, allowing for memory corruption in the hypervisor (write case) or returning of hypervisor private data to the guest (read case) - the interrupt mask bit was permitted to be written by the guest (while Xen's interrupt flow control routines need to control it) - MAX_MSIX_TABLE_{ENTRIES,PAGES} were pointlessly defined to plain numbers (making it unobvious why they have these values, and making the latter non-portable) - MAX_MSIX_TABLE_PAGES was also off by one (failing to account for a non-zero table offset); this was also affecting host MSI-X code - struct msixtbl_entry's table_flags[] was one element larger than necessary due to improper open-coding of BITS_TO_LONGS() - msixtbl_read() unconditionally accessed the physical table, even though the data was only needed in a quarter of all cases - various calculations were done unnecessarily for both of the rather distinct code paths in msixtbl_read() Additionally it is unclear on what basis MAX_MSIX_ACC_ENTRIES was chosen to be 3. Signed-off-by: Jan Beulich <jbeulich@suse.com> Committed-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/include/asm-x86/msi.h')
-rw-r--r--xen/include/asm-x86/msi.h6
1 files changed, 0 insertions, 6 deletions
diff --git a/xen/include/asm-x86/msi.h b/xen/include/asm-x86/msi.h
index 09d4231ece..9715ac8522 100644
--- a/xen/include/asm-x86/msi.h
+++ b/xen/include/asm-x86/msi.h
@@ -122,12 +122,6 @@ int msi_free_irq(struct msi_desc *entry);
*/
#define NR_HP_RESERVED_VECTORS 20
-#define PCI_MSIX_ENTRY_SIZE 16
-#define PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET 0
-#define PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET 4
-#define PCI_MSIX_ENTRY_DATA_OFFSET 8
-#define PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET 12
-
#define msi_control_reg(base) (base + PCI_MSI_FLAGS)
#define msi_lower_address_reg(base) (base + PCI_MSI_ADDRESS_LO)
#define msi_upper_address_reg(base) (base + PCI_MSI_ADDRESS_HI)