Re: KVM devices assignment; PCIe AER?

Etienne Martineau
2010-10-27T18:25:26Z

On Wed, 27 Oct 2010, Alex Williamson wrote:
> I've actually been working on porting the qemu vfio driver over to
> qemu-kvm recently, and nearly have it working. For MSI-X interrupts
> I've ported to the common msix.c code, which abstracts how the interrupt
> is actually sent to the guest. I've also added irqfd support in the
> msix mask notifier so MSI-X interrupts avoid bouncing through qemu. MSI
> support should work the same once Michael's msi.c is upstream.
>
> For INTx interrupts, qemu_set_irq will also work with KVM (it has to or
> all of the emulated drivers would break). The problem is getting an EOI
> back from the KVM kernel apic. I'm currently working on code that adds
> a new KVM ioctl to register an eventfd for the EOI, which then triggers
> qemu-kvm to re-enable the interrupt. My hope is that we can add irqfd
> support to both of these paths, so INTx is injected directly from VFIO
> into KVM, and VFIO can directly consume the KVM EOI.

OK let me try to understand what you've done (please correct me if I'm
wrong). Emulated devices relies on 'kvm_irqfd' for interrupts delivery.
Somehow you've modify VFIO to understand 'kvm_irqfd' so that whenever the
assigned devices receive an IRQ it pass it directly to kvm without
bouncing to userspace?

I'm not sure to understand the part where VFIO signal back the EIO to KVM?

Also, with your change do you think that VFIO can be keept generic?
Reason I'm asking is because we are plannig to use VFIO for some userspace
drivers...

>> Because qemu device assignment is working on VFIO I'm making the
>> assumption that kvm iommu code can be entirely deprecated. Maybe I'm
>> totally wrong here?
>
> Yes, VFIO makes no use of it.

Yes I'm wrong?

Thanks,
-Etienne