qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH V2] virtio: Fix no interrupt when not creating m


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH V2] virtio: Fix no interrupt when not creating msi controller
Date: Tue, 24 Jan 2017 16:00:55 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1


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 via email to

[Prev in Thread] Current Thread [Next in Thread]