All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Ladi Prosek <lprosek@redhat.com>
Cc: "Geoffrey McRae" <geoff@hostfission.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	qemu-devel <qemu-devel@nongnu.org>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 1/3] ivshmem: Don't update non-existent MSI routes
Date: Mon, 13 Nov 2017 18:26:45 +0100	[thread overview]
Message-ID: <87d14mytre.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <CABdb736hx3KEM__F6JB7FymJep+ZHrkA=d8ALok1MuNwaa3NYA@mail.gmail.com> (Ladi Prosek's message of "Mon, 13 Nov 2017 15:38:30 +0100")

Ladi Prosek <lprosek@redhat.com> writes:

> On Mon, Nov 13, 2017 at 3:22 PM, Markus Armbruster <armbru@redhat.com> wrote:
>> Ladi Prosek <lprosek@redhat.com> writes:
>>
>>> As of commit 660c97eef6f8 ("ivshmem: use kvm irqfd for msi notifications"),
>>> QEMU crashes with:
>>>
>>>   kvm_irqchip_commit_routes: Assertion `ret == 0' failed.
>>>
>>> if the ivshmem device is configured with more vectors than what the server
>>> supports. This is caused by the ivshmem_vector_unmask() being called on
>>> vectors that have not been initialized by ivshmem_add_kvm_msi_virq().
>>>
>>> This commit fixes it by adding a simple check to the mask and unmask
>>> callbacks.
>>>
>>> Note that the opposite mismatch, if the server supplies more vectors than
>>> what the device is configured for, is already handled and leads to output
>>> like:
>>>
>>>   Too many eventfd received, device has 1 vectors
>>>
>>> Fixes: 660c97eef6f8 ("ivshmem: use kvm irqfd for msi notifications")
>>> Signed-off-by: Ladi Prosek <lprosek@redhat.com>
>>
>> I think I understand your description of what's wrong.  Not obvious to
>> me is how it can happen.  The cover letter mentions a Windows ivshmem
>> driver.  Is this a device bug a driver can trigger?  If yes, how?
>
> I don't have a Linux guest handy but this code has existed for quite a
> long time so yes, I think it's safe to assume that it can't be
> (easily) triggered by the Linux driver.
>
> The reproducer is as simple as:
>
> ivshmem-server -n 0
> qemu ... -device ivshmem-doorbell,chardev=iv -chardev
> socket,path=/tmp/ivshmem_socket,id=iv
>
> and load the Windows driver in the guest.
>
> Maybe Linux won't enable MSI-X on the device?

Please work your reproducer into the commit message.  Make sure to note
that you're using "the Windows driver" (ideally with a pointer), and why
you assume the Linux driver doesn't trigger it.  With that, you can add
my

Reviewed-by: Markus Armbruster <armbru@redhat.com>

  reply	other threads:[~2017-11-13 17:26 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-10 17:34 [Qemu-devel] [PATCH 0/3] ivshmem: MSI bug fixes Ladi Prosek
2017-11-10 17:34 ` [Qemu-devel] [PATCH 1/3] ivshmem: Don't update non-existent MSI routes Ladi Prosek
2017-11-10 18:10   ` Marc-André Lureau
2017-11-10 20:04   ` geoff
2017-11-13 14:22   ` Markus Armbruster
2017-11-13 14:38     ` Ladi Prosek
2017-11-13 17:26       ` Markus Armbruster [this message]
2017-11-10 17:34 ` [Qemu-devel] [PATCH 2/3] ivshmem: Always remove irqfd notifiers Ladi Prosek
2017-11-13 14:36   ` Markus Armbruster
2017-11-13 14:40     ` Ladi Prosek
2017-11-10 17:34 ` [Qemu-devel] [PATCH 3/3] ivshmem: Improve MSI irqfd error handling Ladi Prosek
2017-11-13 17:27   ` Markus Armbruster
2017-11-13 17:47     ` geoff
2017-11-14  7:37       ` Markus Armbruster

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=87d14mytre.fsf@dusky.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=geoff@hostfission.com \
    --cc=lprosek@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.