From: David Gibson <david@gibson.dropbear.id.au>
To: Halil Pasic <pasic@linux.ibm.com>
Cc: Thomas Huth <thuth@redhat.com>,
Boris Fiuczynski <fiuczy@linux.ibm.com>,
Janosch Frank <frankja@linux.ibm.com>,
Pierre Morel <pmorel@linux.ibm.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Claudio Imbrenda <imbrenda@linux.ibm.com>,
Cornelia Huck <cohuck@redhat.com>,
David Hildenbrand <david@redhat.com>,
qemu-devel@nongnu.org,
Christian Borntraeger <borntraeger@de.ibm.com>,
qemu-s390x@nongnu.org,
Viktor Mihajlovski <mihajlov@linux.ibm.com>,
Richard Henderson <rth@twiddle.net>
Subject: Re: [PATCH v2 1/1] virtio-ccw: auto-manage VIRTIO_F_IOMMU_PLATFORM if PV
Date: Fri, 19 Jun 2020 10:59:10 +1000 [thread overview]
Message-ID: <20200619005910.GG17085@umbus.fritz.box> (raw)
In-Reply-To: <20200610155703.661aca83.pasic@linux.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 5939 bytes --]
On Wed, Jun 10, 2020 at 03:57:03PM +0200, Halil Pasic wrote:
> On Wed, 10 Jun 2020 14:29:29 +1000
> David Gibson <david@gibson.dropbear.id.au> wrote:
>
> > On Tue, Jun 09, 2020 at 06:28:39PM +0200, Halil Pasic wrote:
> > > On Tue, 9 Jun 2020 17:47:47 +0200
> > > Claudio Imbrenda <imbrenda@linux.ibm.com> wrote:
> > >
> > > > On Tue, 9 Jun 2020 11:41:30 +0200
> > > > Halil Pasic <pasic@linux.ibm.com> wrote:
> > > >
> > > > [...]
> > > >
> > > > > I don't know. Janosch could answer that, but he is on vacation. Adding
> > > > > Claudio maybe he can answer. My understanding is, that while it might
> > > > > be possible, it is ugly at best. The ability to do a transition is
> > > > > indicated by a CPU model feature. Indicating the feature to the guest
> > > > > and then failing the transition sounds wrong to me.
> > > >
> > > > I agree. If the feature is advertised, then it has to work. I don't
> > > > think we even have an architected way to fail the transition for that
> > > > reason.
> > > >
> > > > What __could__ be done is to prevent qemu from even starting if an
> > > > incompatible device is specified together with PV.
> > >
> > > AFAIU, the "specified together with PV" is the problem here. Currently
> > > we don't "specify PV" but PV is just a capability that is managed by the
> > > CPU model (like so many other). I.e. the fact that the
> > > visualization environment is capable providing PV (unpack facility
> > > available), and the fact, that the end user didn't fence the unpack
> > > facility, does not mean, the user is dead set to use PV.
> > >
> > > My understanding is, that we want PV to just work, without having to
> > > put together a peculiar VM definition that says: this is going to be
> > > used as a PV VM.
> >
> > Having had a similar discussion for POWER, I no longer think this is a
> > wise model. I think we want to have an explicit "allow PV" option -
> > but we do want it to be a *single* option, rather than having to
> > change configuration of a whole bunch of places.
> >
> > My intention is for my 'host-trust-limitation' series to accomplish
> > that.
>
> Dave, many thanks for your input. I would be interested to read up that
> discussion you hand for POWER to try to catch the train of thought. Can
> you give me a pointer?
Urgh.. not really.. it was spread out over several discussions, some
of which were on IRC or Slack, rather than email.
> My current understanding is that s390x already has the "allow PV" option,
> which is the CPU model feature. But its dynamics is just like the
> dynamics of other CPU model features, in a sense that you may have to
> disable it explicitly.
>
> Our problem is, that iommu_platform=on comes at a price point for us,
> and we don't want to enforce it when it is not needed. And if the guest
> does not decide to do the transition to protected, it is not needed.
>
> Thus any scheme were we pessimise based on the sheer possibility of
> protected virtualization seems wrong to me.
Hrm, I see your point. So... I guess my thinking is that although the
strict meaning of the proposed host-trust-limitation option is just
that "protection _can_ be used, at the guest/platform's option", it is
a strong hint that we're expecting protection to be used.
So would this work for s390:
* The cpu feature remains, as now, enabled by default
* The host-trust-limitation option would apply the protection
necessary virtio options (and any other changes to defaults we
discover we need), just as it does for SEV and POWER PEF
* Optionally, the s390 machine type code could error out if
host-trust-limitation is specified, but the cpu option is
explicitly disabled
> The sad thing is that QEMU has every information it needs to do what is
> best: for paravirtualized devices
> * use F_ACCESS_PLATFORM when needed, to make the guest work harder and
> work around the access restrictions imposed by memory protection, and
> * don't use F_ACCESS_PLATFORM when when not needed, and allow for
> optimization based on the fact that no such access restrictions exist.
Right.. IIUC you're suggesting delaying finalization of the device's
featureset until the guest driver actually starts probing it
> Sure we can burden up the user, to tell us if the VM is intended to be
> used with memory protection or not. But what does it buy us? The
> opportunity to create dodgy configurations?
So, I don't know what the situation is with z, but for POWER machines
with the ultravisor running are rare (read, not actually available
outside IBM yet), and not directly tied to a cpu version (obviously
you need a cpu with support, but you also need to actually be running
under an ultravisor, which is optional). So what are our options:
1) Require explicitly enabling PEF support - this is burdening the
user, as you say, but..
2) Allow by default - but fail if the host doesn't have support. That
means explicitly *disabling* on non-ultravisor machines, a much
bigger imposition on the user
3) Enable conditionally depending on host support. Seems nice, but
it's badly broken, as we've found with previous times we've tried
to automatically do things based on host capabilities. The problem
is that once you have this, it's not obvious without knowing a
bunch about the hosts which ones it will be safe to migrate
between. That horribly breaks things like RHV that want to do load
balancing migrations within a cluster
Basically having different guest-visible features depending on host
properties is just unworkable, which brings us back to (1) being the
least bad option.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2020-06-19 1:02 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-14 22:11 [PATCH v2 1/1] virtio-ccw: auto-manage VIRTIO_F_IOMMU_PLATFORM if PV Halil Pasic
2020-05-20 12:16 ` Halil Pasic
2020-05-20 16:23 ` Michael S. Tsirkin
2020-05-22 21:04 ` Halil Pasic
2020-05-28 11:21 ` Cornelia Huck
2020-05-28 14:42 ` Janosch Frank
2020-05-28 18:49 ` Halil Pasic
2020-05-28 17:52 ` Halil Pasic
2020-06-05 23:32 ` Halil Pasic
2020-06-08 16:14 ` Cornelia Huck
2020-06-08 17:00 ` Halil Pasic
2020-06-09 6:44 ` Cornelia Huck
2020-06-09 9:41 ` Halil Pasic
2020-06-09 14:02 ` Pierre Morel
2020-06-09 15:47 ` Claudio Imbrenda
2020-06-09 16:05 ` Cornelia Huck
2020-06-09 16:41 ` Halil Pasic
2020-06-10 13:34 ` Halil Pasic
2020-06-09 16:28 ` Halil Pasic
2020-06-09 16:44 ` Michael S. Tsirkin
2020-06-10 4:31 ` David Gibson
2020-06-10 7:22 ` David Hildenbrand
2020-06-10 10:07 ` David Gibson
2020-06-10 10:24 ` David Hildenbrand
2020-06-10 13:00 ` Halil Pasic
2020-06-10 13:19 ` Viktor Mihajlovski
2020-06-10 14:00 ` David Hildenbrand
2020-06-19 0:36 ` David Gibson
2020-06-19 0:33 ` David Gibson
2020-06-10 13:15 ` Halil Pasic
2020-06-10 4:29 ` David Gibson
2020-06-10 13:57 ` Halil Pasic
2020-06-19 0:59 ` David Gibson [this message]
2020-06-09 16:41 ` Michael S. Tsirkin
2020-06-10 4:25 ` David Gibson
2020-06-10 21:37 ` Halil Pasic
2020-06-19 1:01 ` David Gibson
2020-06-08 16:53 ` 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=20200619005910.GG17085@umbus.fritz.box \
--to=david@gibson.dropbear.id.au \
--cc=borntraeger@de.ibm.com \
--cc=cohuck@redhat.com \
--cc=david@redhat.com \
--cc=fiuczy@linux.ibm.com \
--cc=frankja@linux.ibm.com \
--cc=imbrenda@linux.ibm.com \
--cc=mihajlov@linux.ibm.com \
--cc=mst@redhat.com \
--cc=pasic@linux.ibm.com \
--cc=pmorel@linux.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=rth@twiddle.net \
--cc=thuth@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 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).