From: Avi Kivity <avi@redhat.com>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: aik@ozlabs.ru, qemu-devel@nongnu.org, kvm@vger.kernel.org
Subject: Re: [Qemu-devel] [RFC PATCH] vfio: VFIO PCI driver for Qemu
Date: Thu, 26 Jul 2012 18:59:16 +0300 [thread overview]
Message-ID: <50116954.1040001@redhat.com> (raw)
In-Reply-To: <1343314583.3125.17.camel@ul30vt>
On 07/26/2012 05:56 PM, Alex Williamson wrote:
>> >> Let's use the same syntax as for kvm device assignment. Then we can
>> >> fall back on kvm when vfio is not available. We can also have an
>> >> optional parameter kernel-driver to explicitly select vfio or kvm.
>> >
>> > This seems confusing to me, pci-assign already has options like
>> > prefer_msi, share_intx, and configfd that vfio doesn't. I'm sure vfio
>> > will eventually get options that pci-assign won't have. How is a user
>> > supposed to figure out what options are actually available from -device
>> > pci-assign,?
>>
>> Read the documentation.
>
> And libvirt is supposed to parse the qemu-docs package matching the
> installed qemu binary package to figure out what's supported?
I was hoping that we could avoid any change in libvirt.
>
>> > Isn't this the same as asking to drop all model specific
>> > devices and just use -device net,model=e1000... hey, we've been there
>> > before ;) Thanks,
>>
>> It's not. e1000 is a guest visible feature. vfio and kvm assignment do
>> exactly the same thing, as far as the guest is concerned, just using a
>> different driver. This is more akin to -device virtio-net,vhost=on|off
>> (where we also have a default and a fallback, which wouldn't make sense
>> for model=e1000).
>
> I understand an agree with your desire to make this transparent from the
> user perspective, but I think the place to do that abstraction is
> libvirt. The qemu command line is just the final step in a process that
> already needs to be aware of which backend will be used. This is not
> simply a small tweak to the qemu options and now I'm using vfio. It
> goes something like this:
>
> KVM VFIO
> 1. Identify the assigned device 1. Identify the assigned device
> 2. Unbind from host driver 2. Identify the iommu group for the device
> 3. Bind to pci-stub 3. Evaluate all the devices for the group
> 4. Launch qemu 4. Unbind all devices in the group from host drivers
> 5. Bind all devices in the group to vfio-pci
> 6. Launch qemu
In the common case, on x86 (but I'm repeating myself), the iommu group
includes just one device, yes? Could we make pci-stub an alias for the
corresponding vfio steps?
Though I generally dislike doing magic behind the user's back. qemu and
even more the kernel are low level interfaces and should behave as
regularly as possible.
>
> I've actually already had a report from an early adopter that did
> everything under the VFIO list on the right, but but happened to be
> using qemu-kvm and the -device pci-assign option and couldn't figure out
> what was going on. Due to KVM's poor device ownership model, it was
> more than happy to bind to a device owned by vfio-pci. Imagine the
> support questions we have to ask if we support both via pci-assign;
In fact we had the same experience with kvm being enabled or not. We
have 'info kvm' for that.
> well, what version of qemu are you using and does that default to vfio
> or kvm assignment or has the distro modified it to switch the default...
> VFIO offers certain advantages, for instance correctly managing the
> IOMMU domain on systems like Andreas' where KVM can't manage the domain
> of the bridge because it doesn't understand grouping. There are also
> obvious advantages in the device ownership model. Users want to be sure
> they're using these things.
>
> Both KVM and VFIO do strive to make the device in the guest look as much
> like it does on bare metal as possible, but we don't guarantee they're
> identical and we don't guarantee to match each other. So in fact, we
> can expect subtle difference in how the guest sees it. Things like the
> capabilities exposed, the emulation/virtualization of some of those
> capabilities, eventually things like express config space support and
> AER error propagation. These are all a bit more than "add vhost=on to
> your virtio-net-pci options and magically your networking is faster".
I see. Thanks for the explanation.
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2012-07-26 15:59 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 [this message]
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
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=50116954.1040001@redhat.com \
--to=avi@redhat.com \
--cc=aik@ozlabs.ru \
--cc=alex.williamson@redhat.com \
--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).