[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] x86/MSI-X: use qword MMIO access for address writes



commit 73cb5d43a8f48930e4594ef7b15b974487651ffe
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Thu Jun 11 11:53:20 2015 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Thu Jun 11 11:53:20 2015 +0200

    x86/MSI-X: use qword MMIO access for address writes
    
    Now that we support it for our guests, let's do so ourselves too.
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 xen/arch/x86/msi.c         |    8 ++------
 xen/include/asm-x86/msi.h  |    9 +++++++--
 xen/include/xen/pci_regs.h |    1 +
 3 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index e89f326..3527518 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -198,8 +198,7 @@ static void read_msi_msg(struct msi_desc *entry, struct 
msi_msg *msg)
         void __iomem *base;
         base = entry->mask_base;
 
-        msg->address_lo = readl(base + PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET);
-        msg->address_hi = readl(base + PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET);
+        msg->address = readq(base + PCI_MSIX_ENTRY_ADDRESS_OFFSET);
         msg->data = readl(base + PCI_MSIX_ENTRY_DATA_OFFSET);
         break;
     }
@@ -260,10 +259,7 @@ static int write_msi_msg(struct msi_desc *entry, struct 
msi_msg *msg)
         void __iomem *base;
         base = entry->mask_base;
 
-        writel(msg->address_lo,
-               base + PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET);
-        writel(msg->address_hi,
-               base + PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET);
+        writeq(msg->address, base + PCI_MSIX_ENTRY_ADDRESS_OFFSET);
         writel(msg->data, base + PCI_MSIX_ENTRY_DATA_OFFSET);
         break;
     }
diff --git a/xen/include/asm-x86/msi.h b/xen/include/asm-x86/msi.h
index 4c62a3a..abbecf8 100644
--- a/xen/include/asm-x86/msi.h
+++ b/xen/include/asm-x86/msi.h
@@ -65,8 +65,13 @@ struct msi_info {
 };
 
 struct msi_msg {
-       u32     address_lo;     /* low 32 bits of msi message address */
-       u32     address_hi;     /* high 32 bits of msi message address */
+       union {
+               u64     address; /* message address */
+               struct {
+                       u32     address_lo; /* message address low 32 bits */
+                       u32     address_hi; /* message address high 32 bits */
+               };
+       };
        u32     data;           /* 16 bits of msi message data */
        u32     dest32;         /* used when Interrupt Remapping with EIM is 
enabled */
 };
diff --git a/xen/include/xen/pci_regs.h b/xen/include/xen/pci_regs.h
index ecd6124..2de7847 100644
--- a/xen/include/xen/pci_regs.h
+++ b/xen/include/xen/pci_regs.h
@@ -307,6 +307,7 @@
 #define  PCI_MSIX_BIRMASK      (7 << 0)
 
 #define PCI_MSIX_ENTRY_SIZE                    16
+#define  PCI_MSIX_ENTRY_ADDRESS_OFFSET         0
 #define  PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET      0
 #define  PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET      4
 #define  PCI_MSIX_ENTRY_DATA_OFFSET            8
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.