Skip to contentSkip to conversation

x86/vMSI-X: write snoops should ignore hvm_mmio_internal() requests

PATCH In review Jan Beulich 3 participants 3 messages Apr 26, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/vMSI-X: write snoops should ignore hvm_mmio_internal() requests

Those aren't actual I/O requests (and hence are of no interest here anyway). Since they don't get copied into struct vcpu, looking at that copy reads whatever was left there. Use the state of the request to determine its validity.

xen/arch/x86/hvm/vmsi.c +2 -0
@@ -349,6 +349,8 @@ static int msixtbl_range(struct vcpu *v,
     {
         const ioreq_t *r = &v->arch.hvm_vcpu.hvm_io.io_req;
 
+        if ( r->state != STATE_IOREQ_READY )
+            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) )

x86/vMSI-X: write snoops should ignore hvm_mmio_internal() requests

Those aren't actual I/O requests (and hence are of no interest here anyway). Since they don't get copied into struct vcpu, looking at that copy reads whatever was left there. Use the state of the request to determine its validity.

xen/arch/x86/hvm/vmsi.c +2 -0
@@ -349,6 +349,8 @@ static int msixtbl_range(struct vcpu *v,
     {
         const ioreq_t *r = &v->arch.hvm_vcpu.hvm_io.io_req;
 
+        if ( r->state != STATE_IOREQ_READY )
+            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) )

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines

-----Original Message-----
From: Jan Beulich [mailto:[email protected]]
Sent: 26 April 2016 15:39
To: xen-devel
Cc: Andrew Cooper; Paul Durrant; Wei Liu
Subject: [PATCH] x86/vMSI-X: write snoops should ignore hvm_mmio_internal() requests

Quoted 6 lines

Those aren't actual I/O requests (and hence are of no interest here anyway). Since they don't get copied into struct vcpu, looking at that copy reads whatever was left there. Use the state of the request to determine its validity.

Quoted 6 lines

xen/arch/x86/hvm/vmsi.c static int msixtbl_range(struct vcpu *v, · line 356

Quoted 8 lines
xen/arch/x86/hvm/vmsi.c +2 -0
@@ -349,6 +349,8 @@ static int msixtbl_range(struct vcpu *v,
     {
         const ioreq_t *r = &v->arch.hvm_vcpu.hvm_io.io_req;
 
+        if ( r->state != STATE_IOREQ_READY )
+            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) )

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#2 lore raw
Quoted 8 lines · Paul Durrant
Quoted 8 lines

-----Original Message-----
From: Jan Beulich [mailto:[email protected]]
Sent: 26 April 2016 15:39
To: xen-devel
Cc: Andrew Cooper; Paul Durrant; Wei Liu
Subject: [PATCH] x86/vMSI-X: write snoops should ignore hvm_mmio_internal() requests

Quoted 9 lines
Quoted 6 lines

Those aren't actual I/O requests (and hence are of no interest here anyway). Since they don't get copied into struct vcpu, looking at that copy reads whatever was left there. Use the state of the request to determine its validity.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel