[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC XEN PATCH v2 2/3] x86/pvh: Open PHYSDEVOP_map_pirq for PVH dom0
- To: Jan Beulich <jbeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, "Stefano Stabellini" <sstabellini@xxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Jiqian Chen <Jiqian.Chen@xxxxxxx>
- Date: Fri, 24 Nov 2023 18:41:35 +0800
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=z9hbAL4FWPfGgAGtUKX3DPgojoAEwTsd0FUOkaqhexU=; b=WrZ4QFP0FhJ0RvwmJ6BsmegM9C1TJ3wR8hNUiuzhru+fSfpIqlmVZdNHEmnzk2VfVIqYGlCRJVpdMP81jac282iyMXToQtqPrUaGV9uRtL/2q485lI5gai2HxmUWt9rQf2d4kKWATEHGQjZb2enISkbBrGnRcPPasU+/5aKZPQIGaHMa8ypxyrrHmAiBcappEx4+qfTR1oracvx7cUBFtjxURdUZAQB8rUZZDIHDLMcMgKYnXBbk+UVI9qEfR1QlFOJbbew8KYrTig42b8bzlX/PaMn6MhGv9YwGt9BsG7DY5lmf+3M3hdKHgPlt419zaZ6kOPMw9bpfjrRIdisGUw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VGaOgSwxxQm/or+BI44ULByzxJAk5Eh4iExtCJfkqzUmYig+o7ynzicPK0Jw2ECQPuaYIr9Ftj2qr8AiCrQCCWmoRdizaptNlaj6KzYbKxhVYLHrCVrQpeIpQY/MGyx8bcO+Oml9iRmj+CAx+sTpFY8khPsFh3V0aLJtgIF7HM1qF1zgouPaUE2pE9Hl7I2Wzi93mzeHPCUy36mPEzqzlLszQKcFK5R4xnSk/h9nWvjHcOX7OeStJxy1/mOwArOy03Y/1KbVv26Moz0QH8QadhYhr+pg8zDc1D65hn3N91dXYpnox5TAo4qg98b40h066kCnMnRCv1JJ5reiMS8wdw==
- Cc: Stewart Hildebrand <Stewart.Hildebrand@xxxxxxx>, Alex Deucher <Alexander.Deucher@xxxxxxx>, Xenia Ragiadakou <xenia.ragiadakou@xxxxxxx>, Stefano Stabellini <stefano.stabellini@xxxxxxx>, Huang Rui <Ray.Huang@xxxxxxx>, Honglei Huang <Honglei1.Huang@xxxxxxx>, Julia Zhang <Julia.Zhang@xxxxxxx>, Jiqian Chen <Jiqian.Chen@xxxxxxx>, Huang Rui <ray.huang@xxxxxxx>
- Delivery-date: Fri, 24 Nov 2023 10:42:26 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
If we run Xen with PVH dom0 and hvm domU, hvm will map a pirq for
a passthrough device by using gsi, see xen_pt_realize->xc_physdev_map_pirq
and 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, I think we may need to allow PHYSDEVOP_map_pirq when currd is dom0 (at
present dom0 is PVH).
Signed-off-by: Jiqian Chen <Jiqian.Chen@xxxxxxx>
Signed-off-by: Huang Rui <ray.huang@xxxxxxx>
---
xen/arch/x86/hvm/hypercall.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/xen/arch/x86/hvm/hypercall.c b/xen/arch/x86/hvm/hypercall.c
index 6ad5b4d5f1..f9c4a2243a 100644
--- a/xen/arch/x86/hvm/hypercall.c
+++ b/xen/arch/x86/hvm/hypercall.c
@@ -74,6 +74,8 @@ long hvm_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
{
case PHYSDEVOP_map_pirq:
case PHYSDEVOP_unmap_pirq:
+ if (is_hardware_domain(currd))
+ break;
case PHYSDEVOP_eoi:
case PHYSDEVOP_irq_status_query:
case PHYSDEVOP_get_free_pirq:
--
2.34.1
|