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

[Xen-changelog] [xen master] x86/vMSI-X: also snoop qword writes



commit d5016eaee6d668cadd93a3600203466e099e5b3f
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Thu Apr 28 15:10:45 2016 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Thu Apr 28 15:10:45 2016 +0200

    x86/vMSI-X: also snoop qword writes
    
    ... the high half of which may be a write to the Vector Control field.
    This gets things in sync again with msixtbl_write().
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Reviewed-by: Paul Durrant <paul.durrant@xxxxxxxxxx>
    Release-acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 xen/arch/x86/hvm/vmsi.c | 33 +++++++++++++++++++++++----------
 1 file changed, 23 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/hvm/vmsi.c b/xen/arch/x86/hvm/vmsi.c
index d07f0c4..d72c568 100644
--- a/xen/arch/x86/hvm/vmsi.c
+++ b/xen/arch/x86/hvm/vmsi.c
@@ -336,6 +336,7 @@ out:
 static int msixtbl_range(struct vcpu *v, unsigned long addr)
 {
     const struct msi_desc *desc;
+    const ioreq_t *r;
 
     rcu_read_lock(&msixtbl_rcu_lock);
     desc = msixtbl_addr_to_desc(msixtbl_find_entry(v, addr), addr);
@@ -344,17 +345,29 @@ static int msixtbl_range(struct vcpu *v, unsigned long 
addr)
     if ( desc )
         return 1;
 
-    if ( (addr & (PCI_MSIX_ENTRY_SIZE - 1)) ==
-         PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET )
+    r = &v->arch.hvm_vcpu.hvm_io.io_req;
+    if ( r->state != STATE_IOREQ_READY || r->addr != addr )
+        return 0;
+    ASSERT(r->type == IOREQ_TYPE_COPY);
+    if ( r->dir == IOREQ_WRITE )
     {
-        const ioreq_t *r = &v->arch.hvm_vcpu.hvm_io.io_req;
-
-        if ( r->state != STATE_IOREQ_READY || r->addr != addr )
-            return 0;
-        ASSERT(r->type == IOREQ_TYPE_COPY);
-        if ( r->dir == IOREQ_WRITE && r->size == 4 && !r->data_is_ptr
-             && !(r->data & PCI_MSIX_VECTOR_BITMASK) )
-            v->arch.hvm_vcpu.hvm_io.msix_snoop_address = addr;
+        if ( !r->data_is_ptr )
+        {
+            unsigned int size = r->size;
+            uint64_t data = r->data;
+
+            if ( size == 8 )
+            {
+                BUILD_BUG_ON(!(PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET & 4));
+                data >>= 32;
+                addr += size = 4;
+            }
+            if ( size == 4 &&
+                 ((addr & (PCI_MSIX_ENTRY_SIZE - 1)) ==
+                  PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET) &&
+                 !(data & PCI_MSIX_VECTOR_BITMASK) )
+                v->arch.hvm_vcpu.hvm_io.msix_snoop_address = addr;
+        }
     }
 
     return 0;
--
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®.