From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37832) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aULgN-00082a-RS for qemu-devel@nongnu.org; Fri, 12 Feb 2016 16:55:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aULgK-0006jO-58 for qemu-devel@nongnu.org; Fri, 12 Feb 2016 16:55:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38542) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aULgJ-0006j7-UR for qemu-devel@nongnu.org; Fri, 12 Feb 2016 16:55:16 -0500 Date: Fri, 12 Feb 2016 21:55:11 +0000 From: "Daniel P. Berrange" Message-ID: <20160212215511.GB17543@redhat.com> References: <1454784308-21177-1-git-send-email-mst@redhat.com> <1454784308-21177-45-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1454784308-21177-45-git-send-email-mst@redhat.com> Subject: Re: [Qemu-devel] [PULL v2 44/45] fix MSI injection on Xen Reply-To: "Daniel P. Berrange" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: Peter Maydell , xen-devel@lists.xensource.com, qemu-devel@nongnu.org, Stefano Stabellini , Eduardo Habkost On Sat, Feb 06, 2016 at 09:15:13PM +0200, Michael S. Tsirkin wrote: > From: Stefano Stabellini > > On Xen MSIs can be remapped into pirqs, which are a type of event > channels. It's mostly for the benefit of PCI passthrough devices, to > avoid the overhead of interacting with the emulated lapic. > > However remapping interrupts and MSIs is also supported for emulated > devices, such as the e1000 and virtio-net. > > When an interrupt or an MSI is remapped into a pirq, masking and > unmasking is done by masking and unmasking the event channel. The > masking bit on the PCI config space or MSI-X table should be ignored, > but it isn't at the moment. > > As a consequence emulated devices which use MSI or MSI-X, such as > virtio-net, don't work properly (the guest doesn't receive any > notifications). The mechanism was working properly when xen_apic was > introduced, but I haven't narrowed down which commit in particular is > causing the regression. > > Fix the issue by ignoring the masking bit for MSI and MSI-X which have > been remapped into pirqs. > > Signed-off-by: Stefano Stabellini > Reviewed-by: Michael S. Tsirkin > Signed-off-by: Michael S. Tsirkin > --- > include/hw/xen/xen.h | 1 + > hw/pci/msi.c | 9 ++++++++- > hw/pci/msix.c | 12 ++++++++++-- > hw/xen/xen_pt_msi.c | 4 +--- > xen-hvm-stub.c | 5 +++++ > xen-hvm.c | 9 +++++++++ > 6 files changed, 34 insertions(+), 6 deletions(-) According to my git bisect, this change appears to have broken the ivshmem test suite: $ QTEST_QEMU_BINARY='x86_64-softmmu/qemu-system-x86_64' QTEST_QEMU_IMG=qemu-img MALLOC_PERTURB_=${MALLOC_PERTURB_:-$((RANDOM % 255 + 1))} gtester -k --verbose -m slow tests/ivshmem-test TEST: tests/ivshmem-test... (pid=17294) /x86_64/ivshmem/single: OK /x86_64/ivshmem/hotplug: OK /x86_64/ivshmem/memdev: OK /x86_64/ivshmem/pair: OK /x86_64/ivshmem/server-msi: ** ERROR:tests/ivshmem-test.c:358:test_ivshmem_server: assertion failed (ret != 0): (0 != 0) FAIL GTester: last random seed: R02S00888b8a4102476be4f9fec733a717ac (pid=17328) /x86_64/ivshmem/server-irq: OK FAIL: tests/ivshmem-test Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|