From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:52888) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SuPhE-0006B8-8p for qemu-devel@nongnu.org; Thu, 26 Jul 2012 11:09:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SuPh8-00076J-Bs for qemu-devel@nongnu.org; Thu, 26 Jul 2012 11:09:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34473) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SuPh8-00076B-2t for qemu-devel@nongnu.org; Thu, 26 Jul 2012 11:09:42 -0400 Message-ID: <1343315377.3125.20.camel@ul30vt> From: Alex Williamson Date: Thu, 26 Jul 2012 09:09:37 -0600 In-Reply-To: <20120725165948.17260.82862.stgit@bling.home> References: <20120725165948.17260.82862.stgit@bling.home> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Mime-Version: 1.0 Subject: Re: [Qemu-devel] [RFC PATCH] vfio: VFIO PCI driver for Qemu List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aik@ozlabs.ru, kvm@vger.kernel.org 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: git://github.com/awilliam/qemu-vfio.git Thanks, Alex