[Top][All Lists]

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

Re: [Qemu-devel] [RFC PATCH] vfio: VFIO PCI driver for Qemu

From: Alex Williamson
Subject: Re: [Qemu-devel] [RFC PATCH] vfio: VFIO PCI driver for Qemu
Date: Thu, 26 Jul 2012 09:09:37 -0600

On Wed, 2012-07-25 at 11:03 -0600, Alex Williamson wrote:
> This adds PCI based device assignment to Qemu using the Linux VFIO
> userspace driver interface.  After setting up VFIO device access,
> devices can be added to Qemu guests using the vfio-pci device
> option:
>  -device vfio-pci,host=1:10.1,id=net0
> or for hotplug:
> (qemu) device_add vfio-pci,host=1:10.1,id=net0
> (qemu) device_del net0
> This patch adds support for assigning host physical PCI devices,
> with or without KVM[1] for x86 hosts and guests.  Support for
> POWER hosts and guests is working and expected to follow shortly.
> Other platforms wishing to make use of this need to do the following:
>  - Add a VFIO IOMMU interface to the host kernel driver or make us of
>    an existing one if possible (pre-req: linux host IOMMU support)
>  - Add corresponding mapping calls for your IOMMU in qemu, see
>    x86 and POWER for examples.
> And if you care about PCI legacy interrupts:
>  - Add support for EOI notification (TBD for everyone)
> While not requiring KVM support, VFIO based device assignment still
> supports acceleration through KVM.  MMIO regions with sufficient
> alignment are mapped directly into the guest addres space and
> platforms supporting direct interrupt injection through eventfds can
> bypass Qemu userspace.  This support is included and automatically
> enabled when KVM and KVM irqchip is enabled.  These allow VFIO
> based assignment to meet the same performance levels as KVM based
> assignment in the qemu-kvm tree.
> Sending this as an RFC for review as we're waiting on VFIO to be
> accepted into the Linux kernel.  I'm hoping it will be accepted
> for Linux v3.6.  Pending Linux VFIO acceptance, I'd like to get
> this support in for 1.2 and work on generic Qemu EOI infrastructure
> in-tree.  This patch is based on current qemu.git merged with MST's
> latest pull request.  Thanks,
> Alex
> [1] The proposed level IRQFD/EOIFD KVM interface is currently
> required to support legacy PCI INTx interrupts.  Qemu support for
> this is included here.  Qemu infrastructure for EOI notification
> is not yet in place to do this without KVM.  Device which rely only
> on MSI/MSIX work in unaccelerated Qemu.

I forgot to mention that anyone wanting to test this out can use the
vfio-for-qemu branch of my git tree here:


reply via email to

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