qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Shannon Zhao <zhaoshenglong@huawei.com>,
	qemu-devel@nongnu.org, qemu-arm@nongnu.org,
	peter.maydell@linaro.org, christoffer.dall@linaro.org
Subject: Re: [Qemu-devel] [PATCH V2] virtio: Fix no interrupt when not creating msi controller
Date: Tue, 24 Jan 2017 16:00:55 +0100	[thread overview]
Message-ID: <9a61e616-9bf8-b4ff-43b9-68f1c908b910@redhat.com> (raw)
In-Reply-To: <20170124164204-mutt-send-email-mst@kernel.org>



On 24/01/2017 15:44, Michael S. Tsirkin wrote:
> On Tue, Jan 24, 2017 at 10:25:00AM +0100, Paolo Bonzini wrote:
>>
>>
>> On 23/01/2017 18:04, Michael S. Tsirkin wrote:
>>>> For virtio-blk, my patch moved the setting of ISR from
>>>> virtio_queue_guest_notifier_read to virtio_notify_irqfd.  This is
>>>> because the irqfd emulation only needs to trigger the interrupt.
>>>> Setting the ISR should have been done elsewhere.
>>>>
>>>> Can vhost set ISR (I thought it couldn't)?  If so, it seems like ARM was
>>>> relying on QEMU's irqfd emulation, as a work around for vhost not
>>>> setting ISR.  But this only works if irqfd is directed to QEMU and not
>>>> to KVM.  So if vhost cannot set ISR, I think vhost should be disabled
>>>> unless MSI is active.
>>>>
>>>> Am I missing something?
>>>
>>> vhost doesn't set ISR ATM.  Without MSI we are always bouncing
>>> interrupts through QEMU in particular in order to set ISR.
>>
>> Where is the code that disables KVM irqfd?
>
> This bit in virtio_pci_set_guest_notifiers does the trick I think:
> 
> 
>     bool with_irqfd = msix_enabled(&proxy->pci_dev) &&
>         kvm_msi_via_irqfd_enabled();
> 
> I don't think we ever used irqfd for level interrupts.

Ok, thanks!

So we have four cases:

- assign with emulated irqfd + ISR
- assign with emulated irqfd
- assign with irqfd
- deassign

Currently we don't distinguish the first two, so (which I don't like)
Shannon's patch ends up setting ISR twice.  The only (ugly) solution
that comes to mind is making with_irqfd an enum...

Paolo

  reply	other threads:[~2017-01-24 15:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-23  0:55 [Qemu-devel] [PATCH V2] virtio: Fix no interrupt when not creating msi controller Shannon Zhao
2017-01-23 16:07 ` Michael S. Tsirkin
2017-01-23 16:46   ` Paolo Bonzini
2017-01-23 17:04     ` Michael S. Tsirkin
2017-01-24  9:25       ` Paolo Bonzini
2017-01-24 14:44         ` Michael S. Tsirkin
2017-01-24 15:00           ` Paolo Bonzini [this message]
2017-01-24 15:05             ` Michael S. Tsirkin
2017-01-24 15:50               ` Paolo Bonzini
2017-01-24 15:55                 ` Michael S. Tsirkin

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=9a61e616-9bf8-b4ff-43b9-68f1c908b910@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=christoffer.dall@linaro.org \
    --cc=mst@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=zhaoshenglong@huawei.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).