qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Halil Pasic <pasic@linux.ibm.com>
To: Cornelia Huck <cohuck@redhat.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>,
	David Hildenbrand <david@redhat.com>,
	Claudio Imbrenda <imbrenda@linux.ibm.com>,
	Richard Henderson <rth@twiddle.net>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	qemu-devel@nongnu.org,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	qemu-s390x@nongnu.org,
	Viktor Mihajlovski <mihajlov@linux.ibm.com>,
	David Gibson <david@gibson.dropbear.id.au>
Subject: Re: [PATCH v2 1/1] virtio-ccw: auto-manage VIRTIO_F_IOMMU_PLATFORM if PV
Date: Tue, 9 Jun 2020 11:41:30 +0200	[thread overview]
Message-ID: <20200609114130.0ca9190b.pasic@linux.ibm.com> (raw)
In-Reply-To: <20200609084402.35d317ec.cohuck@redhat.com>

On Tue, 9 Jun 2020 08:44:02 +0200
Cornelia Huck <cohuck@redhat.com> wrote:

> On Mon, 8 Jun 2020 19:00:45 +0200
> Halil Pasic <pasic@linux.ibm.com> wrote:
> 
> 
> > > I'm also not 100% sure about migration... would it make sense to
> > > discuss all of this in the context of the cross-arch patchset? It seems
> > > power has similar issues.
> > >   
> > 
> > I'm going to definitely have a good look at that. What I think special
> > about s390 is that F_ACCESS_PLATFORM is hurting us because all IO needs
> > to go through ZONE_DMA (this is a problem of the implementation that
> > stemming form a limitation of the DMA API, upstream didn't let me
> > fix it). 
> 
> My understanding is that power runs into similar issues, but I don't
> know much about power, so I might be entirely wrong :)
> 

I will come back to you once I've figured that patch-set out.

[..]

> > > > @@ -874,6 +874,20 @@ static void virtio_ccw_reset(DeviceState *d)
> > > >      VirtioCcwDevice *dev = VIRTIO_CCW_DEVICE(d);
> > > >      VirtIODevice *vdev = virtio_bus_get_device(&dev->bus);
> > > >      VirtIOCCWDeviceClass *vdc = VIRTIO_CCW_DEVICE_GET_CLASS(dev);
> > > > +    S390CcwMachineState *ms = S390_CCW_MACHINE(qdev_get_machine());
> > > > +
> > > > +    /*
> > > > +     * An attempt to use a paravirt device without VIRTIO_F_IOMMU_PLATFORM
> > > > +     * in PV, has catastrophic consequences for the VM. Let's force
> > > > +     * VIRTIO_F_IOMMU_PLATFORM not already specified.
> > > > +     */
> > > > +    if (vdev->access_platform_auto && ms->pv) {
> > > > +        virtio_add_feature(&vdev->host_features, VIRTIO_F_IOMMU_PLATFORM);
> > > > +        vdev->access_platform = ON_OFF_AUTO_ON;
> > > > +    } else if (vdev->access_platform_auto) {
> > > > +        virtio_clear_feature(&vdev->host_features, VIRTIO_F_IOMMU_PLATFORM);
> > > > +        vdev->access_platform = ON_OFF_AUTO_OFF;
> > > > +    }  
> > > 
> > > If the consequences are so dire, we really should disallow adding a
> > > device of IOMMU_PLATFORM off if pv is on.  
> > 
> > I totally agree. My previous patch didn't have the problem because there
> > we just forced what we need.
> > 
> > > 
> > > (Can we disallow transition to pv if it is off? Maybe with the machine
> > > property approach from the cross-arch patchset?)  
> > 
> > No we can't disallow transition because for hotplug that already
> > happened.
> 
> I mean, can a virtio devices without IOMMU_PLATFORM act as a transition
> blocker (i.e. an attempt by a guest to move to pv would fail?)
>

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.
 
[..]

> > 
> > Right, this is more about the machine than the transport. I was thinking
> > of a machine hook, but decided to discuss the more basic stuff first
> > (i.e. is it OK to change the property after stuff is realized).
> > 
> > This would already fix the most pressing issue which is virtio-ccw. I
> > didn't even bother checking if virtio-pci works with PV out of the box,
> > or if something needs to be done there. My bet is that it does not work.
> 
> I agree, virtio-pci + pv is unlikely to work. But if at all possible,
> I'd prefer a general solution anyway, as other architectures care about
> virtio-pci.
> 
> 

I'm with you. I hoped to get changing features on the fly approved first
before setting out to solve this. But I will look into it.

Regards,
Halil


  reply	other threads:[~2020-06-09  9:43 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 [this message]
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
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=20200609114130.0ca9190b.pasic@linux.ibm.com \
    --to=pasic@linux.ibm.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=david@gibson.dropbear.id.au \
    --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=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).