From: Sergio Lopez <slp@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: peter.maydell@linaro.org, Cornelia Huck <cohuck@redhat.com>,
Andrea Bolognani <abologna@redhat.com>,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RFC] virtio-mmio: implement modern (v2) personality (virtio-1)
Date: Wed, 31 Jul 2019 13:04:11 +0200 [thread overview]
Message-ID: <87h872wjmc.fsf@redhat.com> (raw)
In-Reply-To: <20190730160605-mutt-send-email-mst@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 5232 bytes --]
Michael S. Tsirkin <mst@redhat.com> writes:
> On Tue, Jul 30, 2019 at 03:14:00PM +0200, Cornelia Huck wrote:
>> On Tue, 30 Jul 2019 14:17:48 +0200
>> Andrea Bolognani <abologna@redhat.com> wrote:
>>
>> > On Tue, 2019-07-30 at 13:35 +0200, Cornelia Huck wrote:
>> > > On Tue, 30 Jul 2019 12:25:30 +0200
>> > > Andrea Bolognani <abologna@redhat.com> wrote:
>> > > > Can you please make sure virtio-mmio uses the existing interface
>> > > > instead of introducing a new one?
>> > >
>> > > FWIW, I really hate virtio-pci's disable-modern/disable-legacy... for a
>> > > starter, what is 'modern'? Will we have 'ultra-modern' in the future?
>> >
>> > AIUI the modern/legacy terminology is part of the VirtIO spec, so
>> > while I agree that it's not necessarily the least prone to ambiguity
>> > at least it's well defined.
>>
>> Legacy is, modern isn't :) Devices/drivers are conforming to the
>> standard, I don't think there's a special term for that.
>
> Right, if we followed the spec, disable-modern would have been
> force-legacy.
>
> I'm fine with adding force-legacy for everyone and asking tools to
> transition if there. Document it's same as disable-modern for pci.
> Cornelia?
FWIW, for this patch, I'm perfectly fine with changing the "modern"
property to "force-legacy", with "true" as the default value.
>> >
>> > > It is also quite backwards with the 'disable' terminology.
>> >
>> > That's also true. I never claimed the way virtio-pci does it is
>> > perfect!
>> >
>> > > We also have a different mechanism for virtio-ccw ('max_revision',
>> > > which covers a bit more than virtio-1; it doesn't have a 'min_revision',
>> > > as negotiating the revision down is fine), so I don't see why
>> > > virtio-mmio should replicate the virtio-pci mechanism.
>> > >
>> > > Also, IIUC, virtio-mmio does not have transitional devices, but either
>> > > version 1 (legacy) or version 2 (virtio-1). It probably makes more
>> > > sense to expose the device version instead; either as an exact version
>> > > (especially if it isn't supposed to go up without incompatible
>> > > changes), or with some min/max concept (where version 1 would stand a
>> > > bit alone, so that would probably be a bit awkward.)
>> >
>> > I think that if reinventing the wheel is generally agreed not to be
>> > a good idea, then it stands to reason that reinventing it twice can
>> > only be described as absolute madness :)
>> >
>> > We should have a single way to control the VirtIO protocol version
>> > that works for all VirtIO devices, regardless of transport. We might
>> > even want to have virtio-*-{device,ccw}-non-transitional to mirror
>> > the existing virtio-*-pci-non-transitional.
>> >
>> > FWIW, libvirt already implements support for (non)-transitional
>> > virtio-pci devices using either the dedicated devices or the base
>> > virtio-pci plus the disable-{modern,legacy} attributes.
>>
>> One problem (besides my dislike of the existing virtio-pci
>> interfaces :) is that pci, ccw, and mmio all have slightly different
>> semantics.
>>
>> - pci: If we need to keep legacy support around, we cannot enable some
>> features (IIRC, pci-e, maybe others as well.) That means transitional
>> devices are in some ways inferior to virtio-1 only devices, so it
>> makes a lot of sense to be able to configure devices without legacy
>> support. The differences between legacy and virtio-1 are quite large.
>> - ccw: Has revisions negotiated between device and driver; virtio-1
>> requires revision 1 or higher. (Legacy drivers that don't know the
>> concept of revisions automatically get revision 0.) Differences
>> between legacy and virtio-1 are mostly virtqueue endianness and some
>> control structures.
>> - mmio: Has device versions offered by the device, the driver can take
>> it or leave it. No transitional devices. Differences don't look as
>> large as the ones for pci, either.
>>
>> So, if we were to duplicate the same scheme as for pci for ccw and mmio
>> as well, we'd get
>>
>> - ccw: devices that support revision 0 only (disable-modern), that act
>> as today, or that support at least revision 1 (disable-legacy). We
>> still need to keep max_revision around for backwards compatibility.
>> Legacy only makes sense for compat machines (although this is
>> equivalent to max_revision 0); I don't see a reason why you would
>> want virtio-1 only devices, unless you'd want to rip out legacy
>> support in QEMU completely.
>
> Reduce security attack surface slightly. Save some cycles
> (down the road) on branches in the endian-ness handling.
> Make sure your guests
> are all up to date in preparation to the day when legacy will go away.
>
> Not a huge win, for sure, but hey - it's something.
>
>> - mmio: devices that support version 1 (disable-modern), or version 2
>> (disable-legacy). You cannot have both at the same time. Whether this
>> makes sense depends on whether there will be a version 3 in the
>> future.
>>
>> So, this might make some sense for mmio; for ccw, I don't see any
>> advantages other than confusing people further...
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
next prev parent reply other threads:[~2019-07-31 11:05 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-29 12:57 [Qemu-devel] [RFC] virtio-mmio: implement modern (v2) personality (virtio-1) Sergio Lopez
2019-07-29 13:10 ` no-reply
2019-07-30 7:06 ` Stefan Hajnoczi
2019-07-30 8:34 ` Michael S. Tsirkin
2019-07-31 12:22 ` Sergio Lopez
2019-07-31 19:34 ` Michael S. Tsirkin
2019-07-31 21:22 ` Eduardo Habkost
2019-07-30 10:25 ` Andrea Bolognani
2019-07-30 11:35 ` Cornelia Huck
2019-07-30 12:17 ` Andrea Bolognani
2019-07-30 13:14 ` Cornelia Huck
2019-07-30 20:02 ` Michael S. Tsirkin
2019-07-30 20:18 ` Michael S. Tsirkin
2019-07-31 11:04 ` Sergio Lopez [this message]
2019-07-31 13:55 ` Cornelia Huck
2019-07-31 19:06 ` Michael S. Tsirkin
2019-08-01 8:18 ` Cornelia Huck
2019-07-31 11:02 ` Sergio Lopez
2019-08-01 12:17 ` Michael S. Tsirkin
2019-07-30 16:06 ` Laszlo Ersek
2019-07-31 23:58 ` Paolo Bonzini
2019-08-01 19:45 ` Michael S. Tsirkin
2019-08-02 9:24 ` Paolo Bonzini
2019-08-02 0:26 ` Laszlo Ersek
2019-08-02 9:20 ` Peter Maydell
2019-08-02 22:33 ` Laszlo Ersek
2019-08-01 8:37 ` Sergio Lopez
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=87h872wjmc.fsf@redhat.com \
--to=slp@redhat.com \
--cc=abologna@redhat.com \
--cc=cohuck@redhat.com \
--cc=mst@redhat.com \
--cc=peter.maydell@linaro.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).