aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2013-08-23 09:22:08 +0200
committerJan Beulich <jbeulich@suse.com>2013-08-23 09:22:08 +0200
commit1035bb64fd7fd9f05c510466d98566fd82e37ad9 (patch)
tree633b821d1480107aaa767fa1382d7510421380d6 /xen/include
parentb5692f2ef9b6fd67c3e7b4d4f2a4bdb1d58100e5 (diff)
downloadxen-1035bb64fd7fd9f05c510466d98566fd82e37ad9.tar.gz
xen-1035bb64fd7fd9f05c510466d98566fd82e37ad9.tar.bz2
xen-1035bb64fd7fd9f05c510466d98566fd82e37ad9.zip
PCI: break MSI-X data out of struct pci_dev_info
Considering that a significant share of PCI devices out there (not the least the myriad of CPU-exposed ones) don't support MSI-X at all, and that the amount of data is well beyond a handful of bytes, break this out of the common structure, at once allowing the actual data to be tracked to become architecture specific. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/include')
-rw-r--r--xen/include/asm-x86/msi.h16
-rw-r--r--xen/include/xen/pci.h14
2 files changed, 18 insertions, 12 deletions
diff --git a/xen/include/asm-x86/msi.h b/xen/include/asm-x86/msi.h
index 06e68533d3..9eeef63935 100644
--- a/xen/include/asm-x86/msi.h
+++ b/xen/include/asm-x86/msi.h
@@ -214,6 +214,22 @@ struct msg_address {
__u32 hi_address;
} __attribute__ ((packed));
+#define MAX_MSIX_TABLE_ENTRIES (PCI_MSIX_FLAGS_QSIZE + 1)
+#define MAX_MSIX_TABLE_PAGES PFN_UP(MAX_MSIX_TABLE_ENTRIES * \
+ PCI_MSIX_ENTRY_SIZE + \
+ (~PCI_MSIX_BIRMASK & (PAGE_SIZE - 1)))
+
+struct arch_msix {
+ unsigned int nr_entries, used_entries;
+ struct {
+ unsigned long first, last;
+ } table, pba;
+ int table_refcnt[MAX_MSIX_TABLE_PAGES];
+ int table_idx[MAX_MSIX_TABLE_PAGES];
+ spinlock_t table_lock;
+ domid_t warned;
+};
+
void early_msi_init(void);
void msi_compose_msg(struct irq_desc *, struct msi_msg *);
void __msi_set_enable(u16 seg, u8 bus, u8 slot, u8 func, int pos, int enable);
diff --git a/xen/include/xen/pci.h b/xen/include/xen/pci.h
index ca72a99434..c367736b21 100644
--- a/xen/include/xen/pci.h
+++ b/xen/include/xen/pci.h
@@ -32,10 +32,6 @@
#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_ENTRIES (PCI_MSIX_FLAGS_QSIZE + 1)
-#define MAX_MSIX_TABLE_PAGES PFN_UP(MAX_MSIX_TABLE_ENTRIES * \
- PCI_MSIX_ENTRY_SIZE + \
- (~PCI_MSIX_BIRMASK & (PAGE_SIZE - 1)))
struct pci_dev_info {
bool_t is_extfn;
bool_t is_virtfn;
@@ -50,14 +46,8 @@ struct pci_dev {
struct list_head domain_list;
struct list_head msi_list;
- unsigned int msix_nr_entries, msix_used_entries;
- struct {
- unsigned long first, last;
- } msix_table, msix_pba;
- int msix_table_refcnt[MAX_MSIX_TABLE_PAGES];
- int msix_table_idx[MAX_MSIX_TABLE_PAGES];
- spinlock_t msix_table_lock;
- domid_t msix_warned;
+
+ struct arch_msix *msix;
struct domain *domain;
const u16 seg;