xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
	xen-devel@lists.xensource.com, qemu-devel@nongnu.org,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	Eduardo Habkost <ehabkost@redhat.com>
Subject: Re: [PULL v2 44/45] fix MSI injection on Xen
Date: Fri, 12 Feb 2016 21:55:11 +0000	[thread overview]
Message-ID: <20160212215511.GB17543@redhat.com> (raw)
In-Reply-To: <1454784308-21177-45-git-send-email-mst@redhat.com>

On Sat, Feb 06, 2016 at 09:15:13PM +0200, Michael S. Tsirkin wrote:
> From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> 
> 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 <stefano.stabellini@eu.citrix.com>
> Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
>  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 :|

      reply	other threads:[~2016-02-12 21:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1454784308-21177-1-git-send-email-mst@redhat.com>
2016-02-06 19:15 ` [PULL v2 44/45] fix MSI injection on Xen Michael S. Tsirkin
2016-02-12 21:55   ` Daniel P. Berrange [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160212215511.GB17543@redhat.com \
    --to=berrange@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=mst@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).