From: Jan Beulich <jbeulich@suse.com>
To: Jiqian Chen <Jiqian.Chen@amd.com>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
"Roger Pau Monné" <roger.pau@citrix.com>, "Wei Liu" <wl@xen.org>,
"George Dunlap" <george.dunlap@citrix.com>,
"Julien Grall" <julien@xen.org>,
"Stefano Stabellini" <sstabellini@kernel.org>,
"Anthony PERARD" <anthony@xenproject.org>,
"Juergen Gross" <jgross@suse.com>,
"Daniel P . Smith" <dpsmith@apertussolutions.com>,
"Stewart Hildebrand" <Stewart.Hildebrand@amd.com>,
"Huang Rui" <Ray.Huang@amd.com>,
xen-devel@lists.xenproject.org
Subject: Re: [XEN PATCH v9 2/5] x86/pvh: Allow (un)map_pirq when dom0 is PVH
Date: Mon, 10 Jun 2024 17:58:36 +0200 [thread overview]
Message-ID: <efc35614-561c-4baa-9d94-d17ecb528a4b@suse.com> (raw)
In-Reply-To: <20240607081127.126593-3-Jiqian.Chen@amd.com>
On 07.06.2024 10:11, Jiqian Chen wrote:
> If run Xen with PVH dom0 and hvm domU, hvm will map a pirq for
> a passthrough device by using gsi, see qemu code
> xen_pt_realize->xc_physdev_map_pirq and libxl code
> pci_add_dm_done->xc_physdev_map_pirq. Then xc_physdev_map_pirq
> will call into Xen, but in hvm_physdev_op, PHYSDEVOP_map_pirq
> is not allowed because currd is PVH dom0 and PVH has no
> X86_EMU_USE_PIRQ flag, it will fail at has_pirq check.
>
> So, allow PHYSDEVOP_map_pirq when dom0 is PVH and also allow
> PHYSDEVOP_unmap_pirq for the failed path to unmap pirq. And
> add a new check to prevent self map when subject domain has no
> PIRQ flag.
>
> Signed-off-by: Huang Rui <ray.huang@amd.com>
> Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
What's imo missing in the description is a clarification / justification of
why it is going to be a good idea (or at least an acceptable one) to expose
the concept of PIRQs to PVH. If I'm not mistaken that concept so far has
been entirely a PV one.
> --- a/xen/arch/x86/hvm/hypercall.c
> +++ b/xen/arch/x86/hvm/hypercall.c
> @@ -71,8 +71,14 @@ long hvm_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
>
> switch ( cmd )
> {
> + /*
> + * Only being permitted for management of other domains.
> + * Further restrictions are enforced in do_physdev_op.
> + */
> case PHYSDEVOP_map_pirq:
> case PHYSDEVOP_unmap_pirq:
> + break;
Nit: Imo such a comment ought to be indented like code (statements), not
like the case labels.
Jan
next prev parent reply other threads:[~2024-06-10 15:58 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-07 8:11 [XEN PATCH v9 0/5] Support device passthrough when dom0 is PVH on Xen Jiqian Chen
2024-06-07 8:11 ` [XEN PATCH v9 1/5] xen/vpci: Clear all vpci status of device Jiqian Chen
2024-06-07 8:11 ` [XEN PATCH v9 2/5] x86/pvh: Allow (un)map_pirq when dom0 is PVH Jiqian Chen
2024-06-10 15:58 ` Jan Beulich [this message]
2024-06-12 2:43 ` Chen, Jiqian
2024-06-12 8:53 ` Jan Beulich
2024-06-12 9:07 ` Chen, Jiqian
2024-06-12 9:21 ` Jan Beulich
2024-06-12 10:15 ` Chen, Jiqian
2024-06-07 8:11 ` [XEN PATCH v9 3/5] x86/pvh: Add PHYSDEVOP_setup_gsi for PVH dom0 Jiqian Chen
2024-06-10 16:04 ` Jan Beulich
2024-06-12 10:15 ` Chen, Jiqian
2024-07-22 21:27 ` Stefano Stabellini
2024-06-07 8:11 ` [RFC XEN PATCH v9 4/5] tools: Add new function to get gsi from dev Jiqian Chen
2024-06-07 8:11 ` [RFC XEN PATCH v9 5/5] domctl: Add XEN_DOMCTL_gsi_permission to grant gsi Jiqian Chen
2024-06-11 14:39 ` Jan Beulich
2024-06-12 10:12 ` Chen, Jiqian
2024-06-12 10:34 ` Jan Beulich
2024-06-12 10:55 ` Chen, Jiqian
2024-06-12 11:43 ` Jan Beulich
2024-06-13 12:51 ` Anthony PERARD
2024-06-14 3:11 ` Chen, Jiqian
2024-06-14 6:41 ` Jan Beulich
2024-06-14 6:53 ` Chen, Jiqian
2024-06-14 4:01 ` Chen, Jiqian
2024-06-10 16:07 ` [XEN PATCH v9 0/5] Support device passthrough when dom0 is PVH on Xen Jan Beulich
2024-06-12 2:33 ` Chen, Jiqian
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=efc35614-561c-4baa-9d94-d17ecb528a4b@suse.com \
--to=jbeulich@suse.com \
--cc=Jiqian.Chen@amd.com \
--cc=Ray.Huang@amd.com \
--cc=Stewart.Hildebrand@amd.com \
--cc=andrew.cooper3@citrix.com \
--cc=anthony@xenproject.org \
--cc=dpsmith@apertussolutions.com \
--cc=george.dunlap@citrix.com \
--cc=jgross@suse.com \
--cc=julien@xen.org \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--cc=wl@xen.org \
--cc=xen-devel@lists.xenproject.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 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.