From: Halil Pasic <pasic@linux.ibm.com>
To: Cornelia Huck <cohuck@redhat.com>
Cc: Brijesh Singh <brijesh.singh@amd.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Jason Wang <jasowang@redhat.com>,
Daniel Henrique Barboza <danielhb413@gmail.com>,
qemu-devel@nongnu.org, Halil Pasic <pasic@linux.ibm.com>
Subject: Re: [PATCH 1/1] virtio: fix feature negotiation for ACCESS_PLATFORM
Date: Thu, 10 Feb 2022 14:29:29 +0100 [thread overview]
Message-ID: <20220210142929.668a1f3d.pasic@linux.ibm.com> (raw)
In-Reply-To: <877da3t1du.fsf@redhat.com>
On Thu, 10 Feb 2022 12:19:25 +0100
Cornelia Huck <cohuck@redhat.com> wrote:
[..]
>
> Nope, that's not my problem. We make sure that the bit is persistent, we
> fail realization if the bit got removed by the callback when required,
> and we fail feature validation if the driver removes the bit, which is
> in a different code path. We should not talk about FEATURES_OK in this
> code.
I agree. I changed my mind. Expanation follows...
>
> We force-add the bit, and then still might fail realization. The
> important condition is the has_iommu one, not the checks later on. I
> find it very confusing to talk about what a potential driver might do in
> that context.
>
I assumed stuff like virtiofs+SE regressed with commit 04ceb61a40
("virtio: Fail if iommu_platform is requested, but unsupported") but I
think, I was wrong. It didn't work before that, because we did not
present ACCESS_PLATFORM to the guest. I operated under the assumption
that virtio_add_feature(&vdev->host_features, VIRTIO_F_IOMMU_PLATFORM)
does not impact the set of features offered to the driver by the device,
but it does.
So we need both this patch and "[PATCH v5 1/1] virtio: fix the condition
for iommu_platform not supported" to get virtiofs to work with SE/SEV/Secure VM.
I have to admit I only tested for the error message, and not with a full
SE setup.
I agree my comment was inadequate. Can we use
/* make sure that the device did not drop a required IOMMU_PLATFORM */
I will think some more though. This is again about the dual nature
of ACCESS_PLATFORM...
> What about moving the virtio_add_feature() after the if
> (klass->get_dma_as) check, and adding a comment
>
> /* we want to always force IOMMU_PLATFORM here */
>
> [I'll withdraw from this discussion for now, I fear I might just add
> confusion.]
>
>
next prev parent reply other threads:[~2022-02-10 15:58 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-09 12:45 [PATCH 1/1] virtio: fix feature negotiation for ACCESS_PLATFORM Halil Pasic
2022-02-09 17:24 ` Cornelia Huck
2022-02-09 20:27 ` Halil Pasic
2022-02-10 9:55 ` Cornelia Huck
2022-02-10 10:32 ` Halil Pasic
2022-02-10 11:19 ` Cornelia Huck
2022-02-10 13:29 ` Halil Pasic [this message]
2022-03-04 8:12 ` Michael S. Tsirkin
2022-03-04 11:08 ` Halil Pasic
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=20220210142929.668a1f3d.pasic@linux.ibm.com \
--to=pasic@linux.ibm.com \
--cc=brijesh.singh@amd.com \
--cc=cohuck@redhat.com \
--cc=danielhb413@gmail.com \
--cc=jasowang@redhat.com \
--cc=mst@redhat.com \
--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).