[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen stable-4.6] x86/vMSI-X: also snoop qword writes
commit 12b48cf1d37a26e9d411d500a20c616eeec757d0 Author: Jan Beulich <jbeulich@xxxxxxxx> AuthorDate: Mon May 9 12:58:00 2016 +0200 Commit: Jan Beulich <jbeulich@xxxxxxxx> CommitDate: Mon May 9 12:58:00 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> master commit: d5016eaee6d668cadd93a3600203466e099e5b3f master date: 2016-04-28 15:10:45 +0200 --- 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 fd4f3a2..503ae6b 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#stable-4.6 _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |