qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@redhat.com>
To: qemu-devel@nongnu.org
Cc: aik@ozlabs.ru, kvm@vger.kernel.org
Subject: Re: [Qemu-devel] [RFC PATCH] vfio: VFIO PCI driver for Qemu
Date: Thu, 26 Jul 2012 09:09:37 -0600	[thread overview]
Message-ID: <1343315377.3125.20.camel@ul30vt> (raw)
In-Reply-To: <20120725165948.17260.82862.stgit@bling.home>

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

  parent reply	other threads:[~2012-07-26 15:09 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-25 17:03 [Qemu-devel] [RFC PATCH] vfio: VFIO PCI driver for Qemu Alex Williamson
2012-07-25 19:30 ` Avi Kivity
2012-07-25 19:53   ` Alex Williamson
2012-07-26  8:35     ` Avi Kivity
2012-07-26 14:56       ` Alex Williamson
2012-07-26 15:59         ` Avi Kivity
2012-07-26 16:33           ` Alex Williamson
2012-07-26 16:40             ` Avi Kivity
2012-07-26 19:11               ` Alex Williamson
2012-07-26 16:06         ` Avi Kivity
2012-07-26 16:40           ` Alex Williamson
2012-07-26 16:47             ` Avi Kivity
2012-07-26 15:09 ` Alex Williamson [this message]
2012-07-26 16:34 ` Avi Kivity
2012-07-26 17:40   ` Alex Williamson
2012-07-29 13:47     ` Avi Kivity
2012-07-30 22:29       ` Alex Williamson
2012-07-31 12:34         ` Avi Kivity
2012-07-31 16:56           ` Alex Williamson
2012-07-27 19:22 ` Blue Swirl
2012-07-27 20:28   ` Alex Williamson
2012-07-28  2:55   ` Alexey Kardashevskiy

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=1343315377.3125.20.camel@ul30vt \
    --to=alex.williamson@redhat.com \
    --cc=aik@ozlabs.ru \
    --cc=kvm@vger.kernel.org \
    --cc=qemu-devel@nongnu.org \
    /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).