From: Eduardo Habkost <ehabkost@redhat.com>
To: Andrea Bolognani <abologna@redhat.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
"Caio Carrara" <ccarrara@redhat.com>,
"Fabian Deutsch" <fdeutsch@redhat.com>,
qemu-devel@nongnu.org,
"Wainer dos Santos Moschetta" <wainersm@redhat.com>,
"Markus Armbruster" <armbru@redhat.com>,
Gonglei <arei.gonglei@huawei.com>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Laine Stump" <laine@redhat.com>,
"Cleber Rosa" <crosa@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] virtio: Provide version-specific variants of virtio PCI devices
Date: Wed, 14 Nov 2018 16:20:12 -0200 [thread overview]
Message-ID: <20181114182012.GE15086@habkost.net> (raw)
In-Reply-To: <6f8d59b8ee2d92d73d2957b520bd8bac989fc796.camel@redhat.com>
On Thu, Oct 18, 2018 at 12:25:12PM +0200, Andrea Bolognani wrote:
> On Wed, 2018-10-17 at 12:01 -0300, Eduardo Habkost wrote:
> > On Wed, Oct 17, 2018 at 12:43:02PM +0200, Andrea Bolognani wrote:
> > > The proposal doesn't directly address the interaction between virtio
> > > protocol version and slot type. [...]
> >
> > It does. See the interface names added to each device type.
>
> Sorry, I might be blind but I'm still not seeing it... I see a bunch
> of *-pci devices and exactly zero *-pcie devices. See below.
>
> [...]
> > The difference between the devices is not just the bus type: it
> > is a different type of device with different behavior. Using the
> > bus type to differentiate them would be misleading.
>
> I'm not arguing that we should use the bus type *only* to
> differentiate them, but rather that we should *also* differentiate
> them by bus type; failing to do so will mean that...
>
> > e.g. both modern and transitional virtio devices can be plugged
> > to Conventional PCI buses, but they have different PCI IDs.
>
> ... even people who should be very familiar with the topic by now,
> like you and me, will get it wrong from time to time, as Michael
> helpfully pointed out ;)
>
> > I'm considering doing this in v2:
> >
> > * Remove the -0.9 device type, because nobody seems to need it
> > * Add two device types:
> > * virtio-1-blk-pci-non-transitional
> > * virtio-1-blk-pci-transitional
> >
> > This way, we:
> > * Include only the major version of the spec (so
> > we don't require new device types for virtio 1.1, 1.2, etc),
> > * Use terms that come from the Virtio spec itself, to avoid
> > ambiguity.
>
> That's quite a mouthful :)
>
> Anyway, whether a device or not is transitional should go next to
> the spec version rather than at the end: this will also help with
> consistency because we will need -device and -ccw variants of all
> these, no?
Answering this question: we won't need this on the other variants
they don't have the code that silently breaks compatibility with
legacy drivers depending on the bus it's plugged. The device is
either always transitional or always non-transitional.
The root of the problem is in virtio-pci. More precisely, it
begins at virtio_pci_realize():
if (proxy->disable_legacy == ON_OFF_AUTO_AUTO) {
proxy->disable_legacy = pcie_port ? ON_OFF_AUTO_ON : ON_OFF_AUTO_OFF;
}
combined with virtio_pci_device_plugged():
if (legacy) {
[...]
pci_set_word(config + PCI_SUBSYSTEM_ID, virtio_bus_get_vdev_id(bus));
} else {
pci_set_word(config + PCI_VENDOR_ID,
PCI_VENDOR_ID_REDHAT_QUMRANET);
pci_set_word(config + PCI_DEVICE_ID,
0x1040 + virtio_bus_get_vdev_id(bus));
pci_config_set_revision(config, 1);
}
>
> Can we assume if and when virtio 2.0 comes around it will also have
> both a pure variant and a transitional one which is compatible with
> virtio 1.0? If so, I would suggest the names should be
>
> virtio-1-blk-pcie (1.x only, PCIe slot)
> virtio-1-transitional-blk-pci (transitional, PCI slot)
> virtio-1-transitional-blk-pcie (transitional, PCIe slot)
I don't see any need to make separate transitional-pci and
transitional-pcie device types. A -transitional device type that
supports both Conventional PCI and PCI Express will work and I
don't see any problem with that.
For reference, the next version of this patch will have 3 device
variants:
* virtio-blk-pci (existing device, for compatibility. Contains
magic transitional/non-transitional logic depending on bus)
* virtio-blk-pci-transitional (1.x transitional, supports legacy
drivers, Conventional PCI only)
* virtio-blk-pci-non-transitional (1.x non-transitional, no
legacy driver support, supports both Conventional PCI and PCI
Express)
--
Eduardo
next prev parent reply other threads:[~2018-11-14 18:20 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-13 2:54 [Qemu-devel] [PATCH] virtio: Provide version-specific variants of virtio PCI devices Eduardo Habkost
2018-10-14 21:35 ` Michael S. Tsirkin
2018-10-15 18:14 ` Eduardo Habkost
2018-10-16 8:39 ` Cornelia Huck
2018-10-16 13:32 ` Eduardo Habkost
2018-10-16 15:51 ` Cornelia Huck
2018-10-16 17:02 ` Daniel P. Berrangé
2018-10-16 19:12 ` Laine Stump
2018-10-17 5:57 ` [Qemu-devel] No more chameleon devices (was: [PATCH] virtio: Provide version-specific variants of virtio PCI devices) Markus Armbruster
2018-10-17 6:34 ` Gerd Hoffmann
2018-10-17 11:56 ` [Qemu-devel] No more chameleon devices Markus Armbruster
2018-10-17 15:56 ` [Qemu-devel] No more chameleon devices (was: [PATCH] virtio: Provide version-specific variants of virtio PCI devices) Eduardo Habkost
2018-10-17 16:38 ` Michael S. Tsirkin
2018-10-17 19:19 ` Eduardo Habkost
2018-10-18 14:11 ` [Qemu-devel] No more chameleon devices Marcel Apfelbaum
2018-10-18 14:15 ` Peter Maydell
2018-10-18 14:38 ` Daniel P. Berrangé
2018-10-18 14:41 ` Peter Maydell
2018-10-18 14:45 ` Marcel Apfelbaum
2018-10-18 14:48 ` Peter Maydell
2018-10-18 15:39 ` Marcel Apfelbaum
2018-10-18 18:07 ` Eduardo Habkost
2018-10-17 10:43 ` [Qemu-devel] [PATCH] virtio: Provide version-specific variants of virtio PCI devices Andrea Bolognani
2018-10-17 15:01 ` Eduardo Habkost
2018-10-17 15:06 ` Michael S. Tsirkin
2018-10-17 15:57 ` Eduardo Habkost
2018-10-18 10:25 ` Andrea Bolognani
2018-10-18 10:27 ` Daniel P. Berrangé
2018-11-14 18:20 ` Eduardo Habkost [this message]
2018-10-15 8:16 ` Gerd Hoffmann
2018-10-15 10:27 ` Michael S. Tsirkin
2018-10-15 23:03 ` Eduardo Habkost
2018-10-16 6:48 ` Gerd Hoffmann
2018-10-16 13:39 ` Eduardo Habkost
2018-10-16 18:42 ` Gerd Hoffmann
2018-10-17 5:49 ` [Qemu-devel] "no-user" for properties (was: [PATCH] virtio: Provide version-specific variants of virtio PCI devices) Markus Armbruster
2018-10-15 9:45 ` [Qemu-devel] [PATCH] virtio: Provide version-specific variants of virtio PCI devices Cornelia Huck
2018-10-15 23:32 ` Eduardo Habkost
2018-10-17 9:22 ` Stefan Hajnoczi
2018-10-17 15:10 ` Eduardo Habkost
2018-10-17 15:32 ` Michael S. Tsirkin
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=20181114182012.GE15086@habkost.net \
--to=ehabkost@redhat.com \
--cc=abologna@redhat.com \
--cc=arei.gonglei@huawei.com \
--cc=armbru@redhat.com \
--cc=ccarrara@redhat.com \
--cc=crosa@redhat.com \
--cc=fdeutsch@redhat.com \
--cc=kraxel@redhat.com \
--cc=laine@redhat.com \
--cc=mst@redhat.com \
--cc=philmd@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=wainersm@redhat.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.