From: Alex Williamson <alex.williamson@redhat.com>
To: Laine Stump <laine@laine.org>
Cc: "Song, Jike" <jike.song@intel.com>,
"cjia@nvidia.com" <cjia@nvidia.com>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"libvir-list@redhat.com" <libvir-list@redhat.com>,
Michal Privoznik <mprivozn@redhat.com>,
"Tian, Kevin" <kevin.tian@intel.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
Kirti Wankhede <kwankhede@nvidia.com>,
"kraxel@redhat.com" <kraxel@redhat.com>,
Laine Stump <laine@redhat.com>,
"pbonzini@redhat.com" <pbonzini@redhat.com>,
"bjsdjshi@linux.vnet.ibm.com" <bjsdjshi@linux.vnet.ibm.com>
Subject: Re: [libvirt] [PATCH v7 0/4] Add Mediated device support
Date: Fri, 2 Sep 2016 13:15:07 -0600 [thread overview]
Message-ID: <20160902131507.0e5aceb8@t450s.home> (raw)
In-Reply-To: <e8cd86c8-ccab-060a-3726-e1d654e3c6aa@laine.org>
On Fri, 2 Sep 2016 13:55:19 -0400
Laine Stump <laine@laine.org> wrote:
> On 09/01/2016 12:59 PM, Alex Williamson wrote:
> > On Thu, 1 Sep 2016 18:47:06 +0200
> > Michal Privoznik <mprivozn@redhat.com> wrote:
> >
> >> On 31.08.2016 08:12, Tian, Kevin wrote:
> >>>> From: Alex Williamson [mailto:alex.williamson@redhat.com]
> >>>> Sent: Wednesday, August 31, 2016 12:17 AM
> >>>>
> >>>> Hi folks,
> >>>>
> >>>> At KVM Forum we had a BoF session primarily around the mediated device
> >>>> sysfs interface. I'd like to share what I think we agreed on and the
> >>>> "problem areas" that still need some work so we can get the thoughts
> >>>> and ideas from those who weren't able to attend.
> >>>>
> >>>> DanPB expressed some concern about the mdev_supported_types sysfs
> >>>> interface, which exposes a flat csv file with fields like "type",
> >>>> "number of instance", "vendor string", and then a bunch of type
> >>>> specific fields like "framebuffer size", "resolution", "frame rate
> >>>> limit", etc. This is not entirely machine parsing friendly and sort of
> >>>> abuses the sysfs concept of one value per file. Example output taken
> >>>> from Neo's libvirt RFC:
> >>>>
> >>>> cat /sys/bus/pci/devices/0000:86:00.0/mdev_supported_types
> >>>> # vgpu_type_id, vgpu_type, max_instance, num_heads, frl_config, framebuffer,
> >>>> max_resolution
> >>>> 11 ,"GRID M60-0B", 16, 2, 45, 512M, 2560x1600
> >>>> 12 ,"GRID M60-0Q", 16, 2, 60, 512M, 2560x1600
> >>>> 13 ,"GRID M60-1B", 8, 2, 45, 1024M, 2560x1600
> >>>> 14 ,"GRID M60-1Q", 8, 2, 60, 1024M, 2560x1600
> >>>> 15 ,"GRID M60-2B", 4, 2, 45, 2048M, 2560x1600
> >>>> 16 ,"GRID M60-2Q", 4, 4, 60, 2048M, 2560x1600
> >>>> 17 ,"GRID M60-4Q", 2, 4, 60, 4096M, 3840x2160
> >>>> 18 ,"GRID M60-8Q", 1, 4, 60, 8192M, 3840x2160
> >>>>
> >>>> The create/destroy then looks like this:
> >>>>
> >>>> echo "$mdev_UUID:vendor_specific_argument_list" >
> >>>> /sys/bus/pci/devices/.../mdev_create
> >>>>
> >>>> echo "$mdev_UUID:vendor_specific_argument_list" >
> >>>> /sys/bus/pci/devices/.../mdev_destroy
> >>>>
> >>>> "vendor_specific_argument_list" is nebulous.
> >>>>
> >>>> So the idea to fix this is to explode this into a directory structure,
> >>>> something like:
> >>>>
> >>>> ├── mdev_destroy
> >>>> └── mdev_supported_types
> >>>> ├── 11
> >>>> │ ├── create
> >>>> │ ├── description
> >>>> │ └── max_instances
> >>>> ├── 12
> >>>> │ ├── create
> >>>> │ ├── description
> >>>> │ └── max_instances
> >>>> └── 13
> >>>> ├── create
> >>>> ├── description
> >>>> └── max_instances
> >>>>
> >>>> Note that I'm only exposing the minimal attributes here for simplicity,
> >>>> the other attributes would be included in separate files and we would
> >>>> require vendors to create standard attributes for common device classes.
> >>> I like this idea. All standard attributes are reflected into this hierarchy.
> >>> In the meantime, can we still allow optional vendor string in create
> >>> interface? libvirt doesn't need to know the meaning, but allows upper
> >>> layer to do some vendor specific tweak if necessary.
> >> This is not the best idea IMO. Libvirt is there to shadow differences
> >> between hypervisors. While doing that, we often hide differences between
> >> various types of HW too. Therefore in order to provide good abstraction
> >> we should make vendor specific string as small as possible (ideally an
> >> empty string). I mean I see it as bad idea to expose "vgpu_type_id" from
> >> example above in domain XML. What I think the better idea is if we let
> >> users chose resolution and frame buffer size, e.g.: <video
> >> resolution="1024x768" framebuffer="16"/> (just the first idea that came
> >> to my mind while writing this e-mail). The point is, XML part is
> >> completely free of any vendor-specific knobs.
> > That's not really what you want though, a user actually cares whether
> > they get an Intel of NVIDIA vGPU, we can't specify it as just a
> > resolution and framebuffer size. The user also doesn't want the model
> > changing each time the VM is started, so not only do you *need* to know
> > the vendor, you need to know the vendor model
>
> as well as any other configuration that might change over time. A
> similar issue - libvirt really doesn't know or care what a "chassis" is
> in an ioh3420 (a PCIe root-port), but it's a guest-visible property of
> the device that qemu can set (and could presumably decide to change the
> default setting of some time in the future), so libvirt has to set a
> value for it in the config, and specify it on the qemu commandline.
>
> What I'm getting at is that if there is anything in the vendor-specific
> string that changes guest ABI, and that could change over time, then
> libvirt can't just rely on it remaining the same, it needs to have it
> saved in the config for later reproduction, even if it doesn't
> understand the contents.
>
> (for that matter, you may want to consider some type of "versioned vGPU
> type" similar to qemu's versions machinetypes (e.g. "pc-i440fx-2.6",
> which has some sort of incompatible ABI differences from
> "pc-i440fx-1.4"), where any guest-ABI-changing modifications to the vGPU
> would take effect only when the appropriate version of device was
> requested. That way a guest originally created to use today's version of
> vGPU X in resolution Y would continue to work even if incompatible guest
> ABI changes were made in the future.)
I fully agree, but I don't know if it's anything we can actually
codify, only document that this is the way the vendor driver *should*
behave. If the vendor driver modifies the guest visible device without
modifying the vendor string... well that's just something they
shouldn't have done. Bad vendor. Thanks,
Alex
prev parent reply other threads:[~2016-09-02 19:15 UTC|newest]
Thread overview: 95+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-25 3:53 [PATCH v7 0/4] Add Mediated device support Kirti Wankhede
2016-08-25 3:53 ` [PATCH v7 1/4] vfio: Mediated device Core driver Kirti Wankhede
2016-09-08 8:09 ` Jike Song
2016-09-08 9:38 ` Neo Jia
2016-09-09 6:26 ` Jike Song
2016-09-09 17:48 ` Kirti Wankhede
2016-09-09 18:42 ` Alex Williamson
2016-09-09 19:55 ` Kirti Wankhede
2016-09-12 5:10 ` Jike Song
2016-09-12 7:49 ` Kirti Wankhede
2016-09-12 15:53 ` Alex Williamson
2016-09-19 7:08 ` Jike Song
2016-09-19 17:29 ` Kirti Wankhede
2016-09-19 18:11 ` Alex Williamson
2016-09-19 20:09 ` Kirti Wankhede
2016-09-19 20:59 ` [Qemu-devel] " Alex Williamson
2016-09-20 12:48 ` Jike Song
2016-08-25 3:53 ` [PATCH v7 2/4] vfio: VFIO driver for mediated devices Kirti Wankhede
2016-08-25 9:22 ` Dong Jia
2016-08-26 14:13 ` Kirti Wankhede
2016-09-08 2:38 ` Jike Song
2016-09-19 18:22 ` [Qemu-devel] " Kirti Wankhede
2016-09-19 18:36 ` Alex Williamson
2016-09-19 19:13 ` Kirti Wankhede
2016-09-19 20:03 ` Alex Williamson
2016-09-20 2:50 ` Jike Song
2016-09-20 16:24 ` Alex Williamson
2016-09-21 3:19 ` Jike Song
2016-09-21 4:51 ` Alex Williamson
2016-09-21 5:02 ` Jike Song
2016-09-08 2:45 ` Jike Song
2016-09-13 2:35 ` Jike Song
2016-09-20 5:48 ` Dong Jia Shi
[not found] ` <20160920054851.GA2186@bjsdjshi@linux.vnet.ibm.com>
2016-09-20 6:37 ` Jike Song
2016-09-20 12:53 ` Jike Song
2016-08-25 3:53 ` [PATCH v7 3/4] vfio iommu: Add support " Kirti Wankhede
2016-08-25 7:29 ` Dong Jia
2016-08-26 13:50 ` Kirti Wankhede
2016-09-29 2:17 ` Jike Song
2016-09-29 15:06 ` Kirti Wankhede
2016-09-30 2:58 ` Jike Song
2016-09-30 3:10 ` Jike Song
2016-09-30 11:44 ` Kirti Wankhede
2016-10-08 7:09 ` Jike Song
2016-08-25 3:53 ` [PATCH v7 4/4] docs: Add Documentation for Mediated devices Kirti Wankhede
2016-09-03 16:40 ` Kirti Wankhede
2016-08-30 16:16 ` [PATCH v7 0/4] Add Mediated device support Alex Williamson
2016-08-31 6:12 ` Tian, Kevin
2016-08-31 7:04 ` Jike Song
2016-08-31 15:48 ` Alex Williamson
2016-09-01 4:09 ` Tian, Kevin
2016-09-01 4:10 ` Tian, Kevin
2016-09-01 18:22 ` Kirti Wankhede
2016-09-01 20:01 ` Alex Williamson
2016-09-02 6:17 ` Kirti Wankhede
2016-09-01 16:47 ` [Qemu-devel] " Michal Privoznik
2016-09-01 16:59 ` Alex Williamson
2016-09-02 4:48 ` [Qemu-devel] " Michal Privoznik
2016-09-02 5:21 ` Kirti Wankhede
2016-09-02 10:05 ` Paolo Bonzini
2016-09-02 17:15 ` Kirti Wankhede
2016-09-02 17:25 ` Paolo Bonzini
2016-09-02 18:33 ` Kirti Wankhede
2016-09-02 20:29 ` [libvirt] " John Ferlan
2016-09-03 16:31 ` [libvirt] " Kirti Wankhede
2016-09-06 17:54 ` [libvirt] [Qemu-devel] " Alex Williamson
2016-09-02 21:48 ` Paolo Bonzini
2016-09-03 11:56 ` [libvirt] " John Ferlan
2016-09-03 13:07 ` Paolo Bonzini
2016-09-03 17:47 ` [libvirt] " Kirti Wankhede
2016-09-03 16:34 ` [Qemu-devel] " Kirti Wankhede
2016-09-06 17:40 ` Alex Williamson
2016-09-06 19:35 ` Kirti Wankhede
2016-09-06 21:28 ` Alex Williamson
2016-09-07 8:22 ` Tian, Kevin
2016-09-07 16:00 ` Alex Williamson
2016-09-07 16:15 ` Kirti Wankhede
2016-09-07 16:44 ` Alex Williamson
2016-09-07 18:06 ` Kirti Wankhede
2016-09-07 22:13 ` Alex Williamson
2016-09-08 18:48 ` Kirti Wankhede
2016-09-08 20:51 ` Alex Williamson
2016-09-07 18:17 ` Neo Jia
2016-09-07 18:27 ` Daniel P. Berrange
2016-09-07 18:32 ` Neo Jia
2016-09-07 6:48 ` Tian, Kevin
2016-09-02 20:19 ` [libvirt] " John Ferlan
2016-09-02 21:44 ` Paolo Bonzini
2016-09-02 23:57 ` Laine Stump
2016-09-03 16:49 ` Kirti Wankhede
2016-09-05 7:52 ` Paolo Bonzini
2016-09-03 11:57 ` John Ferlan
2016-09-05 7:54 ` Paolo Bonzini
2016-09-02 17:55 ` Laine Stump
2016-09-02 19:15 ` Alex Williamson [this message]
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=20160902131507.0e5aceb8@t450s.home \
--to=alex.williamson@redhat.com \
--cc=bjsdjshi@linux.vnet.ibm.com \
--cc=cjia@nvidia.com \
--cc=jike.song@intel.com \
--cc=kevin.tian@intel.com \
--cc=kraxel@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=kwankhede@nvidia.com \
--cc=laine@laine.org \
--cc=laine@redhat.com \
--cc=libvir-list@redhat.com \
--cc=mprivozn@redhat.com \
--cc=pbonzini@redhat.com \
--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).