aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/xen/pci.h
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2009-02-17 11:06:16 +0000
committerKeir Fraser <keir.fraser@citrix.com>2009-02-17 11:06:16 +0000
commite37e2388799a90538f5a57e847a2bb31740d7ffa (patch)
tree2da9c85e1e9e0873dd6182ee06ba9bde9b2b16b7 /xen/include/xen/pci.h
parentf3c727b3249c89478ee0b3ad727207efd4dd8141 (diff)
downloadxen-e37e2388799a90538f5a57e847a2bb31740d7ffa.tar.gz
xen-e37e2388799a90538f5a57e847a2bb31740d7ffa.tar.bz2
xen-e37e2388799a90538f5a57e847a2bb31740d7ffa.zip
passthrough: fix MSI-X table fixmap allocation
Currently, msix table pages are allocated a fixmap page per vector, the available fixmap pages will be depleted when assigning devices with large number of vectors. This patch fixes it, and a bug that prevents cross-page MSI-X table from working properly It now allocates msix table fixmap pages per device, if the table entries of two msix vectors share the same page, it will only be mapped to fixmap once. A ref count is maintained so that it can be unmapped when all the vectors are freed. Also changes the meaning of msi_desc->mask_base from the va of msix table start to the va of the target entry. The former one is currently buggy (it always maps the first page but msix can support up to 2048 entries) and can't handle separately allocated pages. Signed-off-by: Qing He <qing.he@intel.com>
Diffstat (limited to 'xen/include/xen/pci.h')
-rw-r--r--xen/include/xen/pci.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/xen/include/xen/pci.h b/xen/include/xen/pci.h
index 8ca77b3165..8ed5058e99 100644
--- a/xen/include/xen/pci.h
+++ b/xen/include/xen/pci.h
@@ -29,10 +29,16 @@
#define PCI_BDF(b,d,f) ((((b) & 0xff) << 8) | PCI_DEVFN(d,f))
#define PCI_BDF2(b,df) ((((b) & 0xff) << 8) | ((df) & 0xff))
+#define MAX_MSIX_TABLE_PAGES 8 /* 2048 entries */
struct pci_dev {
struct list_head alldevs_list;
struct list_head domain_list;
+
struct list_head msi_list;
+ int msix_table_refcnt[MAX_MSIX_TABLE_PAGES];
+ int msix_table_idx[MAX_MSIX_TABLE_PAGES];
+ spinlock_t msix_table_lock;
+
struct domain *domain;
const u8 bus;
const u8 devfn;