From: Cornelia Huck <cohuck@redhat.com>
To: Stefano Garzarella <sgarzare@redhat.com>
Cc: Halil Pasic <pasic@linux.ibm.com>,
Qinghua Cheng <qcheng@redhat.com>,
qemu devel list <qemu-devel@nongnu.org>,
Stefan Hajnoczi <stefanha@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: virtio-vsock requires 'disable-legacy=on' in QEMU 5.1
Date: Tue, 18 Aug 2020 14:44:50 +0200 [thread overview]
Message-ID: <20200818144450.0701d68c.cohuck@redhat.com> (raw)
In-Reply-To: <20200817131128.lgxn3pyzuzly4edp@steredhat>
On Mon, 17 Aug 2020 15:11:28 +0200
Stefano Garzarella <sgarzare@redhat.com> wrote:
> On Mon, Aug 17, 2020 at 12:27:46PM +0200, Cornelia Huck wrote:
> > On Thu, 13 Aug 2020 14:04:15 +0200
> > Stefano Garzarella <sgarzare@redhat.com> wrote:
> >
> > > On Thu, Aug 13, 2020 at 12:37:37PM +0200, Cornelia Huck wrote:
> > > > On Thu, 13 Aug 2020 12:24:30 +0200
> > > > Stefano Garzarella <sgarzare@redhat.com> wrote:
> > > >
> > > > > On Thu, Aug 13, 2020 at 11:28:20AM +0200, Cornelia Huck wrote:
> > > > > > We basically have three possible ways to deal with this:
> > > > > >
> > > > > > - Force it to modern (i.e., what you have been doing; would need the
> > > > > > equivalent changes in ccw as well.)
> > > > >
> > > > > Oo, thanks for pointing out ccw!
> > > > > I don't know ccw well, in this case should we set dev->max_rev to 1 or 2
> > > > > to force to modern?
> > > >
> > > > No, ->max_rev is the wrong side of the limit :) You want
> > >
> > > Well :-) Thanks!
> > >
> > > >
> > > > ccw_dev->force_revision_1 = true;
> > > >
> > > > in _instance_init() (see e.g. virtio-ccw-gpu.c).
> > > >
> > > > >
> > > > > > Pro: looks like the cleanest approach.
> > > > > > Con: not sure if we would need backwards compatibility support,
> > > > > > which looks hairy.
> > > > >
> > > > > Not sure too.
> > > >
> > > > Yes, I'm not sure at all how to handle user-specified values for
> > > > legacy/modern.
> >
> > Thinking a bit more about it, I'm not sure whether we even *can*
> > provide backwards compatibility: we have different autoconfigurations
> > for PCI based upon where it is plugged, and ccw does not have a way to
> > turn legacy on/off, except from within the code.
>
> Yes, I discovered today for example that the PCIe bus set auto-legacy
> mode to off.
And vhost-vsock actually really seems to be modern-only, see below.
>
> >
> > > >
> > > > >
> > > > > > - Add vsock to the list of devices with legacy support.
> > > > > > Pro: Existing setups continue to work.
> > > > > > Con: If vsock is really virtio-1-only, we still carry around
> > > > > > possibly broken legacy support.
> > > > >
> > > > > I'm not sure it is virtio-1-only, but virtio-vsock was introduced in
> > > > > 2016, so I supposed it is modern-only.
> > > >
> > > > Yes, I would guess so as well.
> > > >
> > > > >
> > > > > How can I verify that? Maybe forcing legacy mode and run some tests.
> > > >
> > > > Probably yes. The likeliest area with issues is probably endianness, so
> > > > maybe with something big endian in the mix?
> > > >
> > >
> > > Yeah, I'll try this setup!
Ok, I tried this now with an x86 host and an s390x guest. Reverted the
checking commit, tried both with a -ccw and a -pci device and your ncat
example.
- When using virtio-1, both devices work fine.
- When using the -pci device with disable-modern=yes, I get "reset by
peer".
- When using the -ccw device with max_revision=0, I get an instant
timeout.
Smells like endianness problems (aka weird things are happening).
Also noticed that vhost-vsock-ccw does not have an immediate problem,
even with the commit: The code only checks whether the device has been
forced to legacy, not whether legacy is allowed (which cannot be
controlled by the user anyway). Probably best to address after we've
dealt with the vhost-vsock issue and made sure that there are no other
problems.
> > >
> > > > >
> > > > > > - Do nothing, have users force legacy off. Bad idea, as ccw has no way
> > > > > > to do that on the command line.
> > > > > >
> > > > > > The first option is probably best.
> >
> > The first option is now "force modern, but with no backwards
> > compatibility", which is not that great; but "allow legacy, even though
> > it should not exist" is not particularly appealing, either... what a
> > mess :(
>
> Yeah, it's a mess :-( anyway I still prefer option 1, it seems a little
> bit more correct to me.
It seems to me that the status before this was "works by accident, but
only if we're not negotiating to legacy, or the guest/host are both
little endian". IOW, no visible breakage for most people (or we'd
probably have heard of it already). Now we have a setup that's correct,
but forces users to adapt their QEMU command lines. Option 1 would
eliminate the need to do that, but would cause possibly
not-really-fixable migration issues (you can probably deal with that
manually, detaching and re-attaching the device as a last resort.)
So, force modern, probably also remove the -transitional device type,
and put a prominent explanation into the change log?
next prev parent reply other threads:[~2020-08-18 12:46 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-13 9:16 virtio-vsock requires 'disable-legacy=on' in QEMU 5.1 Stefano Garzarella
2020-08-13 9:28 ` Cornelia Huck
2020-08-13 10:24 ` Stefano Garzarella
2020-08-13 10:37 ` Cornelia Huck
2020-08-13 12:04 ` Stefano Garzarella
2020-08-17 10:27 ` Cornelia Huck
2020-08-17 13:11 ` Stefano Garzarella
2020-08-17 14:37 ` Cornelia Huck
2020-08-18 12:44 ` Cornelia Huck [this message]
2020-08-18 14:01 ` Stefano Garzarella
2020-08-18 14:31 ` Cornelia Huck
2020-08-18 15:28 ` Stefano Garzarella
2020-08-18 15:49 ` Cornelia Huck
2020-08-19 9:48 ` Auger Eric
2020-08-13 15:36 ` no-reply
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=20200818144450.0701d68c.cohuck@redhat.com \
--to=cohuck@redhat.com \
--cc=mst@redhat.com \
--cc=pasic@linux.ibm.com \
--cc=qcheng@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=sgarzare@redhat.com \
--cc=stefanha@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.