From nobody Thu Oct 30 22:53:26 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1752700962; cv=pass; d=zohomail.com; s=zohoarc; b=EuMvavUD2TbnXSwty78urYcEkrDXsxCRf2oRLmPb646dQF1CSJm4EZo7M+yJ65bqXRJ19kt2wCm7jqjNJEHhZP1XcI017VE+gN9HS5jdWUj+K4/GO49hfXgiASDNjxTNvJIq7svee1LgIKPEDToBtTA6Q9lHkVCcLYMXD1zvC3k= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752700962; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=5M874AgAk3AnYllKGR1EeBj7fMWDRaQxoJ2sGMdv1/A=; b=QvI/1ssXWu+Va/zb+onwdZNbHBAXctFHPU6ECGD9dp+7WMSN+cYUgzOwYsxyXoQt0PZa9vsQb7rQ6WNIICZJFPAyp/r2i/DTXH2wWQtWRzLll5j7a12/rifmeM0MdzSJgATgqfRkgpGPgFQSw4QGjxJEUzucp57ZIDc9ztnAQgg= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1752700962484524.5374758933514; Wed, 16 Jul 2025 14:22:42 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1045773.1415985 (Exim 4.92) (envelope-from ) id 1uc9Zz-0007gw-0T; Wed, 16 Jul 2025 21:22:19 +0000 Received: by outflank-mailman (output) from mailman id 1045773.1415985; Wed, 16 Jul 2025 21:22:18 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uc9Zy-0007gn-TC; Wed, 16 Jul 2025 21:22:18 +0000 Received: by outflank-mailman (input) for mailman id 1045773; Wed, 16 Jul 2025 21:22:17 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uc9Zx-0007F7-CC for xen-devel@lists.xenproject.org; Wed, 16 Jul 2025 21:22:17 +0000 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2062e.outbound.protection.outlook.com [2a01:111:f403:2408::62e]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id f2b12f39-628a-11f0-a319-13f23c93f187; Wed, 16 Jul 2025 23:22:16 +0200 (CEST) Received: from BLAPR03CA0163.namprd03.prod.outlook.com (2603:10b6:208:32f::7) by BN5PR12MB9464.namprd12.prod.outlook.com (2603:10b6:408:2ab::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8922.32; Wed, 16 Jul 2025 21:22:10 +0000 Received: from MN1PEPF0000F0DF.namprd04.prod.outlook.com (2603:10b6:208:32f:cafe::c4) by BLAPR03CA0163.outlook.office365.com (2603:10b6:208:32f::7) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8943.20 via Frontend Transport; Wed, 16 Jul 2025 21:22:10 +0000 Received: from SATLEXMB03.amd.com (165.204.84.17) by MN1PEPF0000F0DF.mail.protection.outlook.com (10.167.242.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8943.21 via Frontend Transport; Wed, 16 Jul 2025 21:22:09 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 16 Jul 2025 16:22:05 -0500 Received: from fedora.mshome.net (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Wed, 16 Jul 2025 16:22:04 -0500 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: f2b12f39-628a-11f0-a319-13f23c93f187 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=vifidIaQvvU8G/aTXp69WqBEKv3Wje5iCCBEJUHnjZiDeWAgMW4nbWwNGYY+pSzWQWnrHJDPHHwcnVp0hwHncIm1hgNk/8DOVt7tg4YFVkG9os5gfzZvUulASX5ahRV46TlRrguEXgfArZz7RakdncYhCv8t9On2F2IOttncZV8WWD7w+iC3MGgW6EkZzUdBjxQbK/1BJATkvS63OYqOo2fHbxmexr2QwFxx5SqtTDBsORfTyJXqFaTgzlVX4TI9f1+mImPXXCO/fLGGyz1jjLUlknjx5KYppgqanQygrT4D8cAEZJp/CcDUSpUg797+OIfFzbaOXpFgM4kG2ppDcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=5M874AgAk3AnYllKGR1EeBj7fMWDRaQxoJ2sGMdv1/A=; b=eMf1W/c9tNCOIzWuOtmE4uoCPwX/XfGAymaCfk+CgiHZpwmIZ0g/ib1kLjyKO1MRd6YsgkTiHGX+SXWCA5J/eR+4gR2Y4ToLLMeNC6cyB8Pq0o3r2395EsM7y1EYt2qJv/d4vXPU1WdBIOXz2Yx7O1c/B28cRQtC3crnMq/PEADDVH733W2baOeiZkyK4drHaCCFZ8eU/01XfsjJyU4Wo9rPBr+GY0aWahvfnV7GE/4i7O5VnkqcYttNTOvKbgdRJnMc67Q5Ke/8I4KTPBe59huLw9xRnJVFzPS5i67Fv4kku74lPSefSZwStt0KwG3OZ4vpBCLbMQZUXqnO1u9fSA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5M874AgAk3AnYllKGR1EeBj7fMWDRaQxoJ2sGMdv1/A=; b=tttf+AsGDi2vatDnnRxfmB34DzuMp2kAQUhKN1vOj9KEH9mYFey5IhamRosRYvZA3EGXlhVLYG5RsD/i7w+AMivoAIPqWFGmqkCdGw4wRMKwUP+X7utmYL3pLcshrtj99HX91XnnIvnYOpwXJx2r/tslTVESp1a9RcjZI74Dy+s= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C From: Jason Andryuk To: CC: Jason Andryuk , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , "Volodymyr Babchuk" , Andrew Cooper , Anthony PERARD , "Jan Beulich" , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , "Daniel P. Smith" Subject: [PATCH v2 01/17] xen/xsm: Add XSM_HW_PRIV Date: Wed, 16 Jul 2025 17:14:48 -0400 Message-ID: <20250716211504.291104-2-jason.andryuk@amd.com> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250716211504.291104-1-jason.andryuk@amd.com> References: <20250716211504.291104-1-jason.andryuk@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: None (SATLEXMB03.amd.com: jason.andryuk@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN1PEPF0000F0DF:EE_|BN5PR12MB9464:EE_ X-MS-Office365-Filtering-Correlation-Id: 77500afb-8347-473a-430b-08ddc4aed2f7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|36860700013|1800799024|7416014|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?Xa/x30/kHcKv2z30uCAsIh8ppqTumh3e7O0turJDrRdNuUWHxbiHtXJx99O7?= =?us-ascii?Q?mrWxV12yBgOumT0XxU1iPE9kuOwZmcP+oTUik3fEkY48uQbFWwDW15j4ZWBO?= =?us-ascii?Q?/vYk7Bg9pPgHIa59gofOqBU+PYacYn6dSIl2Sh1GXrUCT98Vsi8DHVvgbUFN?= =?us-ascii?Q?GQ0MEMJfyKSFUACxuHvn9Itldg55xbfsmZyLcOfB7lk9m/iyUC4A9S/b64db?= =?us-ascii?Q?Cyp38bxwV4jP9aOrBB2TFoMP2IUKApwpBm63OWxIdWp+H6gk/blsCaWScgVH?= =?us-ascii?Q?oGsGTUFgjrty8pD1WA3HG/445HCnX+X0jN84eRTNXdR/QPEQDDbF0Ukw33RC?= =?us-ascii?Q?poMaKIpazpFBFDuTlG22+0EurXVjibOJXWbJnLEILhodAAAPciiPXzoiCtuK?= =?us-ascii?Q?THkzPjiFT8dUrrIDz9779bf+M+eaRRDNZfREUe15JlYgJfPf5OmvjJfBouhb?= =?us-ascii?Q?AoAu/CAiLprTfzzlK/qXs9b5qMggEFtHQl1k5fHVaisdHN1iTYmRjCJJKtAI?= =?us-ascii?Q?9GUXzvhKHt92249pDIawSikGeln0oEm9U5+Zjc99acJXDmmdTIfkcHN9oc/O?= =?us-ascii?Q?iNhRNYC3duPUFOW4pV3j6ruNl+tExsx99kGEoT9qtW5vjiER+p+5HLGcDrCl?= =?us-ascii?Q?M4g2GrosI9dgW3kCK9WCYlVgTSVXgt4BCXBga5pdzVhRSp8lpt/aSd69lBMP?= =?us-ascii?Q?na4+XY06Mb7Pm3YPzif51t9XRtrfnwbC4Fx7C+yhZsudJMrdzmgBRe0t6I/K?= =?us-ascii?Q?+ZhiL6Fz0vPzs96bfLg4ShONG3wjEyLc8da/iMQvZQjJ6aZ3chYeIWS5Qjk7?= =?us-ascii?Q?ZL1/2X3bOMhgH1yuq2Mz5H7WyIiZioRjtO/pRSdqgCq3CiaQX53ry1BHTV1T?= =?us-ascii?Q?wkzKewTbDEG+AkssvAMZ9A+PHxTgLCQ4hlbWR9q87ZJmWJ5rACMY8CQAREIO?= =?us-ascii?Q?+Pa4H4n1lgMa75hqbCHDVNQQpw/9AyB4qu6mtqYh+uL/Hm0iikyAl3i9Q70k?= =?us-ascii?Q?NPT8G8Wg6MniJV8dz5k0kNr6xhfQCDl7gaPnnuRunFwz6hwFBTTRYzJdZS03?= =?us-ascii?Q?tHBhO+doJZ4BN/x2M2Hx7ShUoUYVvEWvDAChJ8AXnfnMYOMhe8onL2JzEdPx?= =?us-ascii?Q?+gpr3BCFZPCe87LSc1nlQjsHvZ2mvEca08QpyIbnANj7sYfb+YUGF+IqxCR0?= =?us-ascii?Q?q27IKseYfzlVvOHHHxmjgWpbLvogPwYIdZBnfhAaONbZ0oq0Mjl0jj2K0zAb?= =?us-ascii?Q?ktTG0ab8iYjcSq8pWNUPE10sIycBNro0c8wKivoS4XRHMtqashemYBFv/GOr?= =?us-ascii?Q?dgf9KdbUMTNB8dFEvFycX6kA6ZUqjFfoc6hseIL05FFqhnxedWLbrxHlUYes?= =?us-ascii?Q?GmZQXb4CCw3Wn5Tz+Y3Rp04mkJkbxtxk/sHpoPRpVS0IUx+gfg70+21CmbLM?= =?us-ascii?Q?GubqQ3N1B9W1taQTQJOhGnA/UDrrEKBZ6ucQr2Lnm2hMrtKydg9503xltEMo?= =?us-ascii?Q?h2wIUPeekOaWFH7Le3LODgHuplqicEnQRfF5?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(36860700013)(1800799024)(7416014)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jul 2025 21:22:09.8820 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 77500afb-8347-473a-430b-08ddc4aed2f7 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: MN1PEPF0000F0DF.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN5PR12MB9464 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1752700964021116600 Content-Type: text/plain; charset="utf-8" Xen includes disctinct concepts of a control domain (privileged) and a hardware domain, but there is only a single XSM_PRIV check. For dom0 this is not an issue as they are one and the same. With hyperlaunch and its build capabilities, a non-privileged hwdom and a privileged control domain should be possible. Today the hwdom fails the XSM_PRIV checks for hardware-related hooks which it should be allowed access to. Introduce XSM_HW_PRIV, and use it to mark many of the physdev_op and platform_op. The hwdom is allowed access for XSM_HW_PRIV. Make XSM_HW_PRIV a new privilege level that is exclusive to the hardware domain A traditional dom0 will be both privileged and hardware domain, so it continues to have all accesses. Why not XSM:Flask? XSM:Flask is fine grain, and this aims to allow coarse grain. domUs are still domUs. If capabilities are meant to be a first class citizen, they should be usable by the default XSM policy. Signed-off-by: Jason Andryuk --- v2: Make XSM_HW_PRIV exclusive to hardware_domain --- xen/arch/arm/platform_hypercall.c | 2 +- xen/arch/x86/msi.c | 2 +- xen/arch/x86/physdev.c | 12 ++++++------ xen/arch/x86/platform_hypercall.c | 2 +- xen/drivers/passthrough/pci.c | 5 +++-- xen/drivers/pci/physdev.c | 2 +- xen/include/xsm/dummy.h | 20 ++++++++++++-------- xen/include/xsm/xsm.h | 1 + 8 files changed, 26 insertions(+), 20 deletions(-) diff --git a/xen/arch/arm/platform_hypercall.c b/xen/arch/arm/platform_hype= rcall.c index ac55622426..a84596ae3a 100644 --- a/xen/arch/arm/platform_hypercall.c +++ b/xen/arch/arm/platform_hypercall.c @@ -35,7 +35,7 @@ long do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_o= p_t) u_xenpf_op) if ( d =3D=3D NULL ) return -ESRCH; =20 - ret =3D xsm_platform_op(XSM_PRIV, op->cmd); + ret =3D xsm_platform_op(XSM_HW_PRIV, op->cmd); if ( ret ) return ret; =20 diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c index 5389bc0867..30801d980c 100644 --- a/xen/arch/x86/msi.c +++ b/xen/arch/x86/msi.c @@ -1360,7 +1360,7 @@ int pci_restore_msi_state(struct pci_dev *pdev) if ( !use_msi ) return -EOPNOTSUPP; =20 - ret =3D xsm_resource_setup_pci(XSM_PRIV, + ret =3D xsm_resource_setup_pci(XSM_HW_PRIV, (pdev->seg << 16) | (pdev->bus << 8) | pdev->devfn); if ( ret ) diff --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c index 4dfa1c0191..ce1ba41fa3 100644 --- a/xen/arch/x86/physdev.c +++ b/xen/arch/x86/physdev.c @@ -358,7 +358,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(voi= d) arg) ret =3D -EFAULT; if ( copy_from_guest(&apic, arg, 1) !=3D 0 ) break; - ret =3D xsm_apic(XSM_PRIV, currd, cmd); + ret =3D xsm_apic(XSM_HW_PRIV, currd, cmd); if ( ret ) break; ret =3D ioapic_guest_read(apic.apic_physbase, apic.reg, &apic.valu= e); @@ -372,7 +372,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(voi= d) arg) ret =3D -EFAULT; if ( copy_from_guest(&apic, arg, 1) !=3D 0 ) break; - ret =3D xsm_apic(XSM_PRIV, currd, cmd); + ret =3D xsm_apic(XSM_HW_PRIV, currd, cmd); if ( ret ) break; ret =3D ioapic_guest_write(apic.apic_physbase, apic.reg, apic.valu= e); @@ -388,7 +388,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(voi= d) arg) =20 /* Use the APIC check since this dummy hypercall should still only * be called by the domain with access to program the ioapic */ - ret =3D xsm_apic(XSM_PRIV, currd, cmd); + ret =3D xsm_apic(XSM_HW_PRIV, currd, cmd); if ( ret ) break; =20 @@ -490,7 +490,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(voi= d) arg) if ( copy_from_guest(&dev, arg, 1) ) ret =3D -EFAULT; else - ret =3D xsm_resource_setup_pci(XSM_PRIV, + ret =3D xsm_resource_setup_pci(XSM_HW_PRIV, (dev.seg << 16) | (dev.bus << 8) | dev.devfn) ?: pci_prepare_msix(dev.seg, dev.bus, dev.devfn, @@ -501,7 +501,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(voi= d) arg) case PHYSDEVOP_pci_mmcfg_reserved: { struct physdev_pci_mmcfg_reserved info; =20 - ret =3D xsm_resource_setup_misc(XSM_PRIV); + ret =3D xsm_resource_setup_misc(XSM_HW_PRIV); if ( ret ) break; =20 @@ -567,7 +567,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(voi= d) arg) if ( setup_gsi.gsi < 0 || setup_gsi.gsi >=3D nr_irqs_gsi ) break; =20 - ret =3D xsm_resource_setup_gsi(XSM_PRIV, setup_gsi.gsi); + ret =3D xsm_resource_setup_gsi(XSM_HW_PRIV, setup_gsi.gsi); if ( ret ) break; =20 diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hype= rcall.c index 90abd3197f..8efb4ad05f 100644 --- a/xen/arch/x86/platform_hypercall.c +++ b/xen/arch/x86/platform_hypercall.c @@ -228,7 +228,7 @@ ret_t do_platform_op( if ( op->interface_version !=3D XENPF_INTERFACE_VERSION ) return -EACCES; =20 - ret =3D xsm_platform_op(XSM_PRIV, op->cmd); + ret =3D xsm_platform_op(XSM_HW_PRIV, op->cmd); if ( ret ) return ret; =20 diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c index 3edcfa8a04..9de7f0d358 100644 --- a/xen/drivers/passthrough/pci.c +++ b/xen/drivers/passthrough/pci.c @@ -672,7 +672,7 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn, else type =3D "device"; =20 - ret =3D xsm_resource_plug_pci(XSM_PRIV, (seg << 16) | (bus << 8) | dev= fn); + ret =3D xsm_resource_plug_pci(XSM_HW_PRIV, (seg << 16) | (bus << 8) | = devfn); if ( ret ) return ret; =20 @@ -824,7 +824,8 @@ int pci_remove_device(u16 seg, u8 bus, u8 devfn) struct pci_dev *pdev; int ret; =20 - ret =3D xsm_resource_unplug_pci(XSM_PRIV, (seg << 16) | (bus << 8) | d= evfn); + ret =3D xsm_resource_unplug_pci(XSM_HW_PRIV, + (seg << 16) | (bus << 8) | devfn); if ( ret ) return ret; =20 diff --git a/xen/drivers/pci/physdev.c b/xen/drivers/pci/physdev.c index 0161a85e1e..c223611dfb 100644 --- a/xen/drivers/pci/physdev.c +++ b/xen/drivers/pci/physdev.c @@ -86,7 +86,7 @@ ret_t pci_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void= ) arg) dev_reset.dev.bus, dev_reset.dev.devfn); =20 - ret =3D xsm_resource_setup_pci(XSM_PRIV, sbdf.sbdf); + ret =3D xsm_resource_setup_pci(XSM_HW_PRIV, sbdf.sbdf); if ( ret ) break; =20 diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h index 9227205fcd..2b0ed25cc5 100644 --- a/xen/include/xsm/dummy.h +++ b/xen/include/xsm/dummy.h @@ -98,6 +98,10 @@ static always_inline int xsm_default_action( if ( is_control_domain(src) ) return 0; return -EPERM; + case XSM_HW_PRIV: + if ( is_hardware_domain(src) ) + return 0; + return -EPERM; default: LINKER_BUG_ON(1); return -EPERM; @@ -275,7 +279,7 @@ static XSM_INLINE int cf_check xsm_console_io( if ( cmd =3D=3D CONSOLEIO_write ) return xsm_default_action(XSM_HOOK, d, NULL); #endif - return xsm_default_action(XSM_PRIV, d, NULL); + return xsm_default_action(XSM_HW_PRIV, d, NULL); } =20 static XSM_INLINE int cf_check xsm_profile( @@ -455,33 +459,33 @@ static XSM_INLINE int cf_check xsm_resource_unplug_co= re(XSM_DEFAULT_VOID) static XSM_INLINE int cf_check xsm_resource_plug_pci( XSM_DEFAULT_ARG uint32_t machine_bdf) { - XSM_ASSERT_ACTION(XSM_PRIV); + XSM_ASSERT_ACTION(XSM_HW_PRIV); return xsm_default_action(action, current->domain, NULL); } =20 static XSM_INLINE int cf_check xsm_resource_unplug_pci( XSM_DEFAULT_ARG uint32_t machine_bdf) { - XSM_ASSERT_ACTION(XSM_PRIV); + XSM_ASSERT_ACTION(XSM_HW_PRIV); return xsm_default_action(action, current->domain, NULL); } =20 static XSM_INLINE int cf_check xsm_resource_setup_pci( XSM_DEFAULT_ARG uint32_t machine_bdf) { - XSM_ASSERT_ACTION(XSM_PRIV); + XSM_ASSERT_ACTION(XSM_HW_PRIV); return xsm_default_action(action, current->domain, NULL); } =20 static XSM_INLINE int cf_check xsm_resource_setup_gsi(XSM_DEFAULT_ARG int = gsi) { - XSM_ASSERT_ACTION(XSM_PRIV); + XSM_ASSERT_ACTION(XSM_HW_PRIV); return xsm_default_action(action, current->domain, NULL); } =20 static XSM_INLINE int cf_check xsm_resource_setup_misc(XSM_DEFAULT_VOID) { - XSM_ASSERT_ACTION(XSM_PRIV); + XSM_ASSERT_ACTION(XSM_HW_PRIV); return xsm_default_action(action, current->domain, NULL); } =20 @@ -673,7 +677,7 @@ static XSM_INLINE int cf_check xsm_mem_sharing(XSM_DEFA= ULT_ARG struct domain *d) =20 static XSM_INLINE int cf_check xsm_platform_op(XSM_DEFAULT_ARG uint32_t op) { - XSM_ASSERT_ACTION(XSM_PRIV); + XSM_ASSERT_ACTION(XSM_HW_PRIV); return xsm_default_action(action, current->domain, NULL); } =20 @@ -701,7 +705,7 @@ static XSM_INLINE int cf_check xsm_mem_sharing_op( static XSM_INLINE int cf_check xsm_apic( XSM_DEFAULT_ARG struct domain *d, int cmd) { - XSM_ASSERT_ACTION(XSM_PRIV); + XSM_ASSERT_ACTION(XSM_HW_PRIV); return xsm_default_action(action, d, NULL); } =20 diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h index 24acc16125..264db4d8ee 100644 --- a/xen/include/xsm/xsm.h +++ b/xen/include/xsm/xsm.h @@ -36,6 +36,7 @@ enum xsm_default { XSM_DM_PRIV, /* Device model can perform on its target domain */ XSM_TARGET, /* Can perform on self or your target domain */ XSM_PRIV, /* Privileged - normally restricted to dom0 */ + XSM_HW_PRIV, /* Hardware Privileged - normally restricted to dom0/hwd= om */ XSM_XS_PRIV, /* Xenstore domain - can do some privileged operations */ XSM_OTHER /* Something more complex */ }; --=20 2.50.0 From nobody Thu Oct 30 22:53:26 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1752700960; cv=pass; d=zohomail.com; s=zohoarc; b=QxsTCenhg/8J5orJLzaBxrr21LHAS/iPrrxbb5dFFE0ybVwEqdaHxxtQJLki5S1IVWJnIzRSycFrUPUitQSUT+QC4gtKl9hXUsOci8oLJEtV+unNwQBnnkjQh8/1/STZCcj6h4wri1u6cWRXzgYUSdHwEoJbjurZ4+ALULQSb4w= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752700960; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=0aY3FMYTuQ7tdFM3fGV+p5FWokH/Sbpk9Ft38bfAWK0=; b=XQZO0SFBzJR/Z10c/HZLAPHNUYd+a2DJ3Q7BK+KNh7zfDLBCD2OVHObZmRUSRU0uMyx4OZ+hIwSgUWkGJcYIfJ++bH4q+PPqFLvsQyCLw0/lakwAwkzoB6WCl4pRmMwX4w31bxJIKIxVsKJipbcsC9qBiIsz/E79Pl3ZNmnlpVg= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1752700960787945.0347130279687; Wed, 16 Jul 2025 14:22:40 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1045772.1415971 (Exim 4.92) (envelope-from ) id 1uc9Zx-0007H2-RD; Wed, 16 Jul 2025 21:22:17 +0000 Received: by outflank-mailman (output) from mailman id 1045772.1415971; Wed, 16 Jul 2025 21:22:17 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uc9Zx-0007Gi-MB; Wed, 16 Jul 2025 21:22:17 +0000 Received: by outflank-mailman (input) for mailman id 1045772; Wed, 16 Jul 2025 21:22:16 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uc9Zw-0007F7-Ge for xen-devel@lists.xenproject.org; Wed, 16 Jul 2025 21:22:16 +0000 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2062d.outbound.protection.outlook.com [2a01:111:f403:200a::62d]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id f1304f1c-628a-11f0-a319-13f23c93f187; Wed, 16 Jul 2025 23:22:15 +0200 (CEST) Received: from MN2PR19CA0031.namprd19.prod.outlook.com (2603:10b6:208:178::44) by DM6PR12MB4468.namprd12.prod.outlook.com (2603:10b6:5:2ac::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8901.26; Wed, 16 Jul 2025 21:22:10 +0000 Received: from MN1PEPF0000F0E0.namprd04.prod.outlook.com (2603:10b6:208:178:cafe::2f) by MN2PR19CA0031.outlook.office365.com (2603:10b6:208:178::44) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8943.19 via Frontend Transport; Wed, 16 Jul 2025 21:22:10 +0000 Received: from SATLEXMB03.amd.com (165.204.84.17) by MN1PEPF0000F0E0.mail.protection.outlook.com (10.167.242.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8943.21 via Frontend Transport; Wed, 16 Jul 2025 21:22:09 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 16 Jul 2025 16:22:06 -0500 Received: from fedora.mshome.net (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Wed, 16 Jul 2025 16:22:06 -0500 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: f1304f1c-628a-11f0-a319-13f23c93f187 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=pc7u0fhp9ftcI03MaDLygqb/RKjNEtQngy7y+nv2ZfOdFahqvW3pVx8DAek7XW4ON11sFWpjpw5A1b6KW7vqyG0c3JL+vWcKzrLMoBXjhMW55uKSxJKAKpe0kc2q9oDdeh+Wj4Ec6ASLNP88Ro8gggxNiCs9uVx+Tci7JuM0L7x9RtOrL/qnXC06FOtY8XjEM/sQoMIO56v+jcSpAElxUdYlj1U/cD/V1a58laduR2wi5qyLyhvUZmCw927VXiUXxCx38WcOIK/vA3Y3+uSCl6/89VBDJIxaSrSlyU2tB5Tnz9y/78EKJFcFIzMHtwE5Nv3ACW3Iy2QECkOico6PjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=0aY3FMYTuQ7tdFM3fGV+p5FWokH/Sbpk9Ft38bfAWK0=; b=LaqKN67jV7sJbRD2uEJkoLCftLYN7M1YbSjTpp/gWliE0uKW0PF8s1u5jqKy4JG7fB7E5HNczS96cqUGE1cmwhr5tO/GWtTBOJz4oNsPxKGK4FCQxUMcC9n3Bw7MvgDlVoX1FD5qLa2wR1v3YBlafYRs3gCzwy5iF2CbXbdPlYgA3cX58TQ7PbIW1qHmP46ZITcqhvMHvIZUWyEVHvDCBzJWHmXXMxtpflOX0/7yiFunon7mVvuKTPUD7qXb6JaCtLEXqq3Xz+05zTbUVu6n8yy/YzASjCJGA2F2BPDWmqGG+jPy92NPat8zTBSGmy0dSm2Vu4oiiQOhxbtp6Y1HqQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0aY3FMYTuQ7tdFM3fGV+p5FWokH/Sbpk9Ft38bfAWK0=; b=fJFAu6tY3qncuQD4IbRBwa4lz8FQIuNQEL2TqKU6aczomH+B7uK8hSux3ADN2ZlxmncxAqD4uqfp1RyxMw2zzqFR5K2407qiuLl/XvUXyNQ9QXqD5d9HtINKLHjLNUePeDONzUx+01RtGvrEs8sDaMUeQy2IjwbFCRSgmt4Bu2w= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C From: Jason Andryuk To: CC: Jason Andryuk , "Daniel P. Smith" Subject: [PATCH v2 02/17] xsm/silo: Support hardware & xenstore domains Date: Wed, 16 Jul 2025 17:14:49 -0400 Message-ID: <20250716211504.291104-3-jason.andryuk@amd.com> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250716211504.291104-1-jason.andryuk@amd.com> References: <20250716211504.291104-1-jason.andryuk@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: None (SATLEXMB03.amd.com: jason.andryuk@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN1PEPF0000F0E0:EE_|DM6PR12MB4468:EE_ X-MS-Office365-Filtering-Correlation-Id: 3c5f8a9b-1c58-4364-be4f-08ddc4aed2ff X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|36860700013|1800799024|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?8QB4T+hlJl0wQ6nL5ymIrDHm6Efbdop2nC+6OV9KFN7ovQKbxNZ8OW2LW2HI?= =?us-ascii?Q?dZPGtzg3zhN8yCo3iHagbaZAH7cKYWYMHE2WJGwq4QJ/KJstJMXXSEb3cMBj?= =?us-ascii?Q?qK4IqemwxeVZYSFwuVjxxaZ9g4N0tMOeV2n4hgSEXtx+fjbmW0nIu+vzgv1x?= =?us-ascii?Q?NAgKMyacEquEMgQMsdG44gP5p+rOmv553sXSUkpzQn9abq5A6Rdn7yrfmRwb?= =?us-ascii?Q?+UQj1n7bQiYv0/AnijEhs1zTwVyZmO3oe0utUu8Tkn0gBNuwOCUyOpWrE/Fn?= =?us-ascii?Q?qo7FgtCAALUX8z2pRWHA6r4t+EFtSz57ZVqwweT2UF2ywuE9CEabQd38DG2p?= =?us-ascii?Q?lJJakj3WQ6jd78OgL427XIfBpjWaaFco0EkXJ2CCn5dIyrgjPr8gDgL54qiL?= =?us-ascii?Q?FlzGsBZBZuKIIQ9RpGOYNT5iMbQzaiLD6njDFhzEtU2THbZUUz68mGYpXx0/?= =?us-ascii?Q?iZ3xTlxSMZBcipCPpB5EoFZC8mUXy6XGOsDXSX7xj4tz1Oo4yIKsll42IqDc?= =?us-ascii?Q?NjPNPxB6IjlhizQx36sajSDTNxtBkPkHx3By7NTxgcCFwnhlOFqacVBWcCIn?= =?us-ascii?Q?UGhbyjKhG5N8n2XHVVCUydQ3Ptof80psm3zMekrZWo6TO0hpI0Gstkyd5Lfe?= =?us-ascii?Q?7UVgf+Pon8NL9PDj2Y3sMe92Pb5H8C8ZZ5tRNwAWBD/Drzeg40OjUhu7Avbt?= =?us-ascii?Q?p7FKhUOvXXuuCeZXwflz12FM35kFmwQQjmF7mwS5oAKYcMarWM90RVQBg86r?= =?us-ascii?Q?t01zC8w0Mt+Bgu9hyWHb0cXmQuS5rTEXS1uLolmG1vOOq0/KUG9j1zxZAz7D?= =?us-ascii?Q?6XwXQAB7tp2SNAAzd/yppmG+gFp4HL60+eQKLt/RGQ2tYHqyN1iHvA+S6Jur?= =?us-ascii?Q?XZ2rwYuVBPKvI80lgnyNJm9PXmLPcTLwGCBbw3kpfsj9opYkZ1MP/l92DbfQ?= =?us-ascii?Q?LfWA3EU93g/C3g/QCTxorl4vxojPjEj/8igru0qnBVcoiDbsP0oiSc6cY6jk?= =?us-ascii?Q?CKi8OA0Eob8Y3qQSoVkhaWufblw8Lzy9zxogL1AknM+Zl8Msm6D8WSsOaBgw?= =?us-ascii?Q?tAAKIo/JZSEKY8EMgXeLoo2mzxW9wvOLlSSmDbCpNGwCsjDiVZUshu0hujXZ?= =?us-ascii?Q?SnHgejW2P0QTAnr6uO63HU+hP3JLTJA9SR2bAZdyJDpxkCpJhocwgrEAQge9?= =?us-ascii?Q?VFLX8T2SRLHc6iMiKYK3mBWXA0StwxTEetFdpkAFx6UKvdxGJIv744Uf/LQ1?= =?us-ascii?Q?A54nsLaedKiAeE0WRQfPvfgtorfoVLFdA+2NnEmadnJ/1NX2l2QQMWOWmyN7?= =?us-ascii?Q?OM1mrl+gAujp2q8GbbKL1JYQPm/R7APsMvzXzCxFyVpVL9xULrfwUgs7X4Bj?= =?us-ascii?Q?djYeDJd2fA2F3G27bpEH6phAUZC1X6htmNQ+4gveM0LWIZA5OPoPpQMimXab?= =?us-ascii?Q?ljBbIRa7IMFbMXYOZ3HKCDBKheUTlrHaNPn0ed9gIG12TRwUaxvzG0/fy8Hs?= =?us-ascii?Q?ZgAHoCdurnnVbjty/OAFAwdvYAnHWYiko6Nq?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(36860700013)(1800799024)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jul 2025 21:22:09.9372 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3c5f8a9b-1c58-4364-be4f-08ddc4aed2ff X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: MN1PEPF0000F0E0.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4468 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1752700962067116600 Content-Type: text/plain; charset="utf-8" In a disaggregated environment, dom0 is split into Control, Hardware, and Xenstore domains, along with domUs. The is_control_domain() check is not sufficient to handle all these cases. Add is_priv_domain() to support allowing for the various domains. The purpose of SILO mode is to prevent domUs from interacting with each other. But dom0 was allowed to communicate with domUs to provide services. To provide xenstore connections, the Xenstore domain must be allowed to connect via grants and event channels. Xenstore domain must also be allowed to connect to Control and Hardware to provide xenstore to them. Hardware domain will provide PV devices to domains, so it must be allowed to connect to domains. That leaves Control. Xenstore and Hardware would already allow access to Control, so it can obtain services that way. Control should be "privileged", which would mean it can make the connections. But with Xenstore and Hardware providing their services to domUs, there may not be a reason to allow Control to use grants or event channels with domUs. This silo check is for grants, event channels and argo. The dummy policy handles other calls, so Hardware is prevented from foreign mapping Control's memory with that. Signed-off-by: Jason Andryuk --- v2: Use single evaluate_nospec() for checks. Remove Control Add xenstore domain Expand commit message Remove always_inline --- xen/xsm/silo.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/xen/xsm/silo.c b/xen/xsm/silo.c index b89b364287..b392f32507 100644 --- a/xen/xsm/silo.c +++ b/xen/xsm/silo.c @@ -20,6 +20,17 @@ #define XSM_NO_WRAPPERS #include =20 +static bool is_priv_domain(const struct domain *d) +{ + /* + * Open coding of: + * is_xenstore_domain(d) || is_hardware_domain(d) + * to place all within one speculative barrier. + */ + return evaluate_nospec((d->options & XEN_DOMCTL_CDF_xs_domain) || + d =3D=3D hardware_domain); +} + /* * Check if inter-domain communication is allowed. * Return true when pass check. @@ -29,8 +40,8 @@ static bool silo_mode_dom_check(const struct domain *ldom, { const struct domain *currd =3D current->domain; =20 - return (is_control_domain(currd) || is_control_domain(ldom) || - is_control_domain(rdom) || ldom =3D=3D rdom); + return (is_priv_domain(currd) || is_priv_domain(ldom) || + is_priv_domain(rdom) || ldom =3D=3D rdom); } =20 static int cf_check silo_evtchn_unbound( --=20 2.50.0 From nobody Thu Oct 30 22:53:26 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1752700970; cv=pass; d=zohomail.com; s=zohoarc; b=ITf5B3thzId6L2EKyceyOukGD7D3ZYxoh/gEXH/YRzH+8oLAh6G4Coflrm6pKuD+jOfXEjakze8iur5ZzOe11dFe4PiNVFp2y7DBySKu3sfpebZWLm5+fdEXJoxkVL/UEEPEmIXCyWutcSK1AYzdGh2nC5lt2EBaNzUyYzVhk7Y= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752700970; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=JF6+JxSKjzA4UzG7AozD85Y2sWpyR7xteKGEDVhlnLc=; b=CxI5U2SfPSkglSmMBLJfAPhZrQQcAbhd4gDZ3S9Sj75d2U6qNzRYPMSZ5J+uRUKul4eKt/MECllGPbvon3Jy4MROCTuDDfOvvpJUX9EXC7anYZjJVd6gKEZmbZ957TMvXZbpXqv2+02/LKEaGE4SuYzZ+vt0y7Kc+PkMunkLLY0= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1752700970769997.0925968423526; Wed, 16 Jul 2025 14:22:50 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1045780.1416024 (Exim 4.92) (envelope-from ) id 1uc9aD-0000Dd-5z; Wed, 16 Jul 2025 21:22:33 +0000 Received: by outflank-mailman (output) from mailman id 1045780.1416024; Wed, 16 Jul 2025 21:22:33 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uc9aC-0000CM-PV; Wed, 16 Jul 2025 21:22:32 +0000 Received: by outflank-mailman (input) for mailman id 1045780; Wed, 16 Jul 2025 21:22:31 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uc9aA-0007F2-V7 for xen-devel@lists.xenproject.org; Wed, 16 Jul 2025 21:22:31 +0000 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on20615.outbound.protection.outlook.com [2a01:111:f403:2412::615]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id f8ccfa8b-628a-11f0-b894-0df219b8e170; Wed, 16 Jul 2025 23:22:28 +0200 (CEST) Received: from BN9PR03CA0794.namprd03.prod.outlook.com (2603:10b6:408:13f::19) by SA3PR12MB9106.namprd12.prod.outlook.com (2603:10b6:806:37e::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8922.32; Wed, 16 Jul 2025 21:22:24 +0000 Received: from MN1PEPF0000F0DE.namprd04.prod.outlook.com (2603:10b6:408:13f:cafe::a3) by BN9PR03CA0794.outlook.office365.com (2603:10b6:408:13f::19) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8922.32 via Frontend Transport; Wed, 16 Jul 2025 21:22:24 +0000 Received: from SATLEXMB03.amd.com (165.204.84.17) by MN1PEPF0000F0DE.mail.protection.outlook.com (10.167.242.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8943.21 via Frontend Transport; Wed, 16 Jul 2025 21:22:24 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 16 Jul 2025 16:22:08 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 16 Jul 2025 16:22:08 -0500 Received: from fedora.mshome.net (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Wed, 16 Jul 2025 16:22:07 -0500 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: f8ccfa8b-628a-11f0-b894-0df219b8e170 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=qm04lwKejipEvP9bRBW3JabX+5X33oz+MhgN8rC/cYSlLiQ1gEm4ODfS7/Np7O+LxuDynAmAjww/of2CiqaM8pjXqI6vX8tld0xeSAnSkcCzK2Z7C9o9vt88nYCf4tnwHxJdiYjvMB9I4nsTVT6TO+TsZiyRfDIWLlKQpQOYZ1cSfP0ZxPW1+3TDHBQg2IHp6ZTm03x59tJSPEL+cWOTFyLbf3IVFRNA4DwiFhlN8k68Lzkl6NOqSuR11cyFs2lymGkqlnMDVMwDw5g5xF+V13Yb2s5rtsH7aj1h0KsvcnjvdmqpFsl0Uysp9n1NHVqgEzRaV7npazyV8hVzBeAHOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=JF6+JxSKjzA4UzG7AozD85Y2sWpyR7xteKGEDVhlnLc=; b=dhGiJqGBk4t320+YsWdnjcvZ0q8yVoCvv0brqdWDI4z61oIoxxd7fICmkC5UVmoRLLF4I0LR19jgiAaDV1+o21khp4mmT8mGqL6wBdv1Ua1ji1v3Yt8IlQ4LXwDb1RdE9plv/EFP3S2O/tfypkXCmRaWMVKSL+oJcqdAs1EWdBRJcSkQdt18D/K4SYprQJYNneY8/+UK1ddDHspfzXJJFnUA8sKJgAKxlCBVkTiYJPJgDb9E/B1qIAvLeWmRKvzv6yjyG82K9rLrSQeTf3SmCoiqpYAUFaeQs+2iTrQzaLguwamfsWQ+nPREr1iDBoe+seWl5C025b1TpbCBKvwnoA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JF6+JxSKjzA4UzG7AozD85Y2sWpyR7xteKGEDVhlnLc=; b=LwVA+Dsi6VUBwIwYxBRk90qhTF8R3GvaRnMOpH0IGtFJbMyC5s2mUp491Kosr1tFeCw6GeKDTJsVbQaWO3BoGV77aq3zYnullsMaLieRbKs0Ic16kc4ClohhRO/E05Hfz7qygiavwiFuR4lt+piXQPiATj/hxaIEaFyZsNjdEcg= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C From: Jason Andryuk To: CC: Jason Andryuk , Christian Lindig , David Scott , Anthony PERARD , Andrew Cooper , Michal Orzel , Jan Beulich , "Julien Grall" , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Stefano Stabellini , Bertrand Marquis , Volodymyr Babchuk , "Daniel P. Smith" , Christian Lindig Subject: [PATCH v2 03/17] xen: Add DOMAIN_CAPS_DEVICE_MODEL & XEN_DOMCTL_CDF_device_model Date: Wed, 16 Jul 2025 17:14:50 -0400 Message-ID: <20250716211504.291104-4-jason.andryuk@amd.com> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250716211504.291104-1-jason.andryuk@amd.com> References: <20250716211504.291104-1-jason.andryuk@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN1PEPF0000F0DE:EE_|SA3PR12MB9106:EE_ X-MS-Office365-Filtering-Correlation-Id: 22a2cfc6-4192-44e2-7b90-08ddc4aedb71 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|36860700013|1800799024|7416014|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?yJly645dfciSSzlDpxkGK90wK7E7Pb14Q1ftlsKyOnMf91TgL/xfjPWphUtr?= =?us-ascii?Q?iF/nPMEf7xkIDsAH5/cnXQSlKoAtSogtyHwVH0ZxFYD2qrrYjIwJP7rT7X6h?= =?us-ascii?Q?fqVpsha8qHA+IXMusc/XfD3eVHVmuZWT3iK6dOK2l+ZjwyOP8dvNdL7J/FM2?= =?us-ascii?Q?FmZtA3XnPXEkkYOEl1TqMjbZnuOjnvU8OE+OUd0FQm304rra4oBfGkrbsObr?= =?us-ascii?Q?zvS8VB7qwPD4sM1Q77hyVmQwjuegA1hgDH/XASPV1V0qS9U0Azu0rfKt//4x?= =?us-ascii?Q?5uOk7AGeYnDCn9sCHQyzN7uLoeA5GOg6nv/r31aUfGfiVA3myZY/uoZW72RM?= =?us-ascii?Q?VKpTgPHOAuS8YzbnU1nTt/aXrd0e61xtmh268aor99DLon3hO2PX6S49ZtQ+?= =?us-ascii?Q?0/cJT7SYdWaG0WrknMPSgr+JuhY7sooyx51aM4lCFUcE5fZAdB4jxpcF+dwU?= =?us-ascii?Q?iUFRA8WAjjwex5Xlijar4gGkviIOo6DgBDvDoV/x1l7l0qx7Eh3GiVa1DSv5?= =?us-ascii?Q?mAtw9L3Ma/pm61myfv0esxnHdC+M42mhbdnMraAKd6xaRAbVy4IiFQSZLqro?= =?us-ascii?Q?pVbkq96rAeoyzxOUbCjFty8LUYDH8fhh+9WZco34IdGmdOINAs4WR4X69bxf?= =?us-ascii?Q?kpiZmaqzBNY5uB+8reVsmaIaKRcS+zDxdYDij7R0b5dU1yKjQdsmiMIJAE6d?= =?us-ascii?Q?38uEcg9/B02SRCz6Kr3C+QMwLcNWAT0zwEg0u7+U6MLeEEhJYqfQ1Mco9u8P?= =?us-ascii?Q?t35jsx+/Tc/6kzd2/aUDAgz0urrSPBXZI6lzfj9fyHT98m8jYTJjqVMVP/Z+?= =?us-ascii?Q?dXfYIJBIwNfeTlLFo833LCj4t4vAPTBKN1wc8zPKF67A3l7+OummTyBqdliz?= =?us-ascii?Q?/9ss9z2pbDD0QhnUQ0QsXQX5WadJ6ialiOx8KAl/+dPM+JN6cKLKcG1xM7oF?= =?us-ascii?Q?mBz8LCBtyfjn0F5jAOHBaMf9xeTN+TAfo7n+j26v5LsHjvnzFC488Hf2OQyJ?= =?us-ascii?Q?9wPCzG7OOQQ6AXPQeggE97JGNqURa75ndbKbtvCMsADLitgycIfxEIXnKsRW?= =?us-ascii?Q?o1lJ8k9J4yBPzQu+F6oCxls4YSL5xtbuaU2ELRB01iiijDprQbBwy2pbtFzv?= =?us-ascii?Q?Rl5kbht2qr27LP8wvrGZbHd1LpzdgwKUbfc3Gh4iXjYbRKZzTSFNrxrtdAC0?= =?us-ascii?Q?qlcCtzR2xnyKHrLxXjGAykkjUk0GYa7bitr4PlS3NQXHpRbH6/uWrSMjhJ0o?= =?us-ascii?Q?wt9aEoKyFHqWPq4Q6IvChFD3y9/fA39ZOvFalcgjSroV8HxmOXlnuLuVKh5w?= =?us-ascii?Q?fS48WZwN4Ye1WnIamqpJip9zNxF8t1XdprzUnRWtDWqlgAw/cYCTcyt9+bOf?= =?us-ascii?Q?VJ5GMZinG20336lf2gLhrvfQKVFWDwSJ7F7oVhVHvJI2WYIUwmU43syCSb0n?= =?us-ascii?Q?bsbvN3Vyez50CXfec337BeMywZMu6wjnPpCzVpiLL+lRc9b/Wd5EWkEKqLJ7?= =?us-ascii?Q?fpWTbsjyA9zxBfmyO4sfXXDL8GkPUe7P16Qv?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(36860700013)(1800799024)(7416014)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jul 2025 21:22:24.1033 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 22a2cfc6-4192-44e2-7b90-08ddc4aedb71 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: MN1PEPF0000F0DE.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB9106 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1752700972216116600 Content-Type: text/plain; charset="utf-8" To add more flexibility in system configuration add the new DOMAIN_CAPS_DEVICE_MODEL flag and XEN_DOMCTL_CDF_device_model. Thie new flag corresponds to allowing XSM_DM_PRIV for the domain. This will enable running device model emulators (QEMU) from the assigned domain for multiple target domains. Stubdoms assign target allowing the stubdom to serve as the device model for a single domain. This new flag allows the single domain to provide emulators for multiple guests. The specific scenario is a disaggregated system with the hardware domain providing device models for multiple guest domains. This permission is also enough to run xenconsoled in the hardware domain. This is a byproduct of getdomaininfo being available. The grant permissions are also configured for the console page. The OCaml code needs the flag added in as well. Signed-off-by: Jason Andryuk Acked-by: Christian Lindig Reviewed-by: Stefano Stabellini --- v2: Add Christian's Ack XSM_DM_PRIV falls through to the is_control_domain() check - should this be a return to make them into disjoint sets? --- tools/ocaml/libs/xc/xenctrl.ml | 1 + tools/ocaml/libs/xc/xenctrl.mli | 1 + xen/arch/arm/domain.c | 3 ++- xen/common/device-tree/dom0less-build.c | 3 +++ xen/common/domain.c | 3 ++- xen/include/public/bootfdt.h | 12 ++++++++++-- xen/include/public/domctl.h | 4 +++- xen/include/xen/sched.h | 9 +++++++++ xen/include/xsm/dummy.h | 2 ++ 9 files changed, 33 insertions(+), 5 deletions(-) diff --git a/tools/ocaml/libs/xc/xenctrl.ml b/tools/ocaml/libs/xc/xenctrl.ml index 7e1aabad6c..f5835e7d95 100644 --- a/tools/ocaml/libs/xc/xenctrl.ml +++ b/tools/ocaml/libs/xc/xenctrl.ml @@ -71,6 +71,7 @@ type domain_create_flag =3D | CDF_NESTED_VIRT | CDF_VPMU | CDF_TRAP_UNMAPPED_ACCESSES + | CDF_DEVICE_MODEL =20 type domain_create_iommu_opts =3D | IOMMU_NO_SHAREPT diff --git a/tools/ocaml/libs/xc/xenctrl.mli b/tools/ocaml/libs/xc/xenctrl.= mli index f44dba61ae..b9471a56a8 100644 --- a/tools/ocaml/libs/xc/xenctrl.mli +++ b/tools/ocaml/libs/xc/xenctrl.mli @@ -64,6 +64,7 @@ type domain_create_flag =3D | CDF_NESTED_VIRT | CDF_VPMU | CDF_TRAP_UNMAPPED_ACCESSES + | CDF_DEVICE_MODEL =20 type domain_create_iommu_opts =3D | IOMMU_NO_SHAREPT diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c index 79a144e61b..57eecbd250 100644 --- a/xen/arch/arm/domain.c +++ b/xen/arch/arm/domain.c @@ -613,7 +613,8 @@ int arch_sanitise_domain_config(struct xen_domctl_creat= edomain *config) unsigned int flags_required =3D (XEN_DOMCTL_CDF_hvm | XEN_DOMCTL_CDF_h= ap); unsigned int flags_optional =3D (XEN_DOMCTL_CDF_iommu | XEN_DOMCTL_CDF= _vpmu | XEN_DOMCTL_CDF_xs_domain | - XEN_DOMCTL_CDF_trap_unmapped_accesses ); + XEN_DOMCTL_CDF_trap_unmapped_accesses | + XEN_DOMCTL_CDF_device_model); unsigned int sve_vl_bits =3D sve_decode_vl(config->arch.sve_vl); =20 if ( (config->flags & ~flags_optional) !=3D flags_required ) diff --git a/xen/common/device-tree/dom0less-build.c b/xen/common/device-tr= ee/dom0less-build.c index 221b875a2f..bb52291dfb 100644 --- a/xen/common/device-tree/dom0less-build.c +++ b/xen/common/device-tree/dom0less-build.c @@ -883,6 +883,9 @@ void __init create_domUs(void) d_cfg.flags |=3D XEN_DOMCTL_CDF_xs_domain; d_cfg.max_evtchn_port =3D -1; } + + if ( val & DOMAIN_CAPS_DEVICE_MODEL ) + d_cfg.flags |=3D XEN_DOMCTL_CDF_device_model; } =20 if ( dt_find_property(node, "xen,static-mem", NULL) ) diff --git a/xen/common/domain.c b/xen/common/domain.c index 303c338ef2..42c590b8d7 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -722,7 +722,8 @@ static int sanitise_domain_config(struct xen_domctl_cre= atedomain *config) XEN_DOMCTL_CDF_s3_integrity | XEN_DOMCTL_CDF_oos_off | XEN_DOMCTL_CDF_xs_domain | XEN_DOMCTL_CDF_iommu | XEN_DOMCTL_CDF_nested_virt | XEN_DOMCTL_CDF_vpmu | - XEN_DOMCTL_CDF_trap_unmapped_accesses) ) + XEN_DOMCTL_CDF_trap_unmapped_accesses | + XEN_DOMCTL_CDF_device_model) ) { dprintk(XENLOG_INFO, "Unknown CDF flags %#x\n", config->flags); return -EINVAL; diff --git a/xen/include/public/bootfdt.h b/xen/include/public/bootfdt.h index 86c46b42a9..c6b5afc76a 100644 --- a/xen/include/public/bootfdt.h +++ b/xen/include/public/bootfdt.h @@ -25,7 +25,15 @@ #define DOMAIN_CAPS_HARDWARE (1U << 1) /* Xenstore domain. */ #define DOMAIN_CAPS_XENSTORE (1U << 2) -#define DOMAIN_CAPS_MASK (DOMAIN_CAPS_CONTROL | DOMAIN_CAPS_HARDWARE |= \ - DOMAIN_CAPS_XENSTORE) +/* + * Device model capability allows the use of the dm_op hypercalls to provi= de + * the device model emulation (run QEMU) for other domains. This is a + * subset of the Control capability which can be granted to the + * Hardware domain for running QEMU. + */ +#define DOMAIN_CAPS_DEVICE_MODEL (1U << 3) + +#define DOMAIN_CAPS_MASK (DOMAIN_CAPS_CONTROL | DOMAIN_CAPS_HARDWARE = | \ + DOMAIN_CAPS_XENSTORE | DOMAIN_CAPS_DEVICE_MO= DEL ) =20 #endif /* __XEN_PUBLIC_BOOTFDT_H__ */ diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h index a69dd96084..88a294c5be 100644 --- a/xen/include/public/domctl.h +++ b/xen/include/public/domctl.h @@ -68,9 +68,11 @@ struct xen_domctl_createdomain { #define XEN_DOMCTL_CDF_vpmu (1U << 7) /* Should we trap guest accesses to unmapped addresses? */ #define XEN_DOMCTL_CDF_trap_unmapped_accesses (1U << 8) +/* Allow domain to provide device model for multiple other domains */ +#define XEN_DOMCTL_CDF_device_model (1U << 9) =20 /* Max XEN_DOMCTL_CDF_* constant. Used for ABI checking. */ -#define XEN_DOMCTL_CDF_MAX XEN_DOMCTL_CDF_trap_unmapped_accesses +#define XEN_DOMCTL_CDF_MAX XEN_DOMCTL_CDF_device_model =20 uint32_t flags; =20 diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h index fe53d4fab7..9863603d93 100644 --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -1148,6 +1148,15 @@ static always_inline bool is_control_domain(const st= ruct domain *d) return evaluate_nospec(d->is_privileged); } =20 +/* This check is for functionality specific to a device model domain */ +static always_inline bool is_dm_domain(const struct domain *d) +{ + if ( IS_ENABLED(CONFIG_PV_SHIM_EXCLUSIVE) ) + return false; + + return evaluate_nospec(d->options & XEN_DOMCTL_CDF_device_model); +} + #define VM_ASSIST(d, t) (test_bit(VMASST_TYPE_ ## t, &(d)->vm_assist)) =20 static always_inline bool is_pv_domain(const struct domain *d) diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h index 2b0ed25cc5..0b341efd18 100644 --- a/xen/include/xsm/dummy.h +++ b/xen/include/xsm/dummy.h @@ -91,6 +91,8 @@ static always_inline int xsm_default_action( return 0; fallthrough; case XSM_DM_PRIV: + if ( is_dm_domain(src) ) + return 0; if ( target && evaluate_nospec(src->target =3D=3D target) ) return 0; fallthrough; --=20 2.50.0 From nobody Thu Oct 30 22:53:26 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1752700972; cv=pass; d=zohomail.com; s=zohoarc; b=KGFrrHFSP2B9uYj0a9BsFV+/imnOZjhT7H/8BSI7bfWIl0RYD/7zFHaZOZYQkvbCTU/ia+aMlp/j9rxIZs9WWwQE4jNga0uIOfinwrscfiSulp69UsS5LIFRrzttILrK2plyFPJh9pLAqdC6eveTm0eCzQzmw3HA/KPH/2K9TVg= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752700972; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ykb3PuSX5SAI+R8wxC7PVzFq5Z1MUVmxV7kUfgrRp3A=; b=iOCVUK/pLsuaRztVWoJp2F0/keOB/wQNUpDR4awBYcWYgwEP0zxJyuposU5Yn4hgEKfhleGRvcchcJRFoq8U4uC/lpvOt7e86uFEVOeT3irAN6jkzHmSfsPbx9KcZ7N0mniS5eQVMg19kNGWTRoKY/7eexlwRHGWXLqlA4JjYOU= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1752700972359884.5299822663635; Wed, 16 Jul 2025 14:22:52 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1045777.1416005 (Exim 4.92) (envelope-from ) id 1uc9aB-0008Lw-L4; Wed, 16 Jul 2025 21:22:31 +0000 Received: by outflank-mailman (output) from mailman id 1045777.1416005; Wed, 16 Jul 2025 21:22:31 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uc9aB-0008Ln-H9; Wed, 16 Jul 2025 21:22:31 +0000 Received: by outflank-mailman (input) for mailman id 1045777; Wed, 16 Jul 2025 21:22:30 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uc9a9-0007F7-T5 for xen-devel@lists.xenproject.org; Wed, 16 Jul 2025 21:22:30 +0000 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on20623.outbound.protection.outlook.com [2a01:111:f403:2418::623]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id f97e0db4-628a-11f0-a319-13f23c93f187; Wed, 16 Jul 2025 23:22:28 +0200 (CEST) Received: from BN9PR03CA0801.namprd03.prod.outlook.com (2603:10b6:408:13f::26) by LV2PR12MB5869.namprd12.prod.outlook.com (2603:10b6:408:176::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8901.35; Wed, 16 Jul 2025 21:22:24 +0000 Received: from MN1PEPF0000F0DE.namprd04.prod.outlook.com (2603:10b6:408:13f:cafe::6b) by BN9PR03CA0801.outlook.office365.com (2603:10b6:408:13f::26) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8922.33 via Frontend Transport; Wed, 16 Jul 2025 21:22:24 +0000 Received: from SATLEXMB03.amd.com (165.204.84.17) by MN1PEPF0000F0DE.mail.protection.outlook.com (10.167.242.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8943.21 via Frontend Transport; Wed, 16 Jul 2025 21:22:24 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 16 Jul 2025 16:22:10 -0500 Received: from fedora.mshome.net (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Wed, 16 Jul 2025 16:22:09 -0500 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: f97e0db4-628a-11f0-a319-13f23c93f187 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=huGqY/1epyL8NEzdTlWX4aNcPjt94KOqAitBgHt7HIOnPl9Bxq3MASS+hjTMH82Mq3dnCM1PNaUypClE2Dty0FbepMXkq69ROykRq+Hdkhhf+AczeVO6DIqj9F39Eok24wLqrBPaGtq/MwsHqkmPf95D3WU66RGiyJW9cH/ItYGDHEkyTiIVLpfWw2k2s1HG00z6MiR5zItXtjojOfCQwl0V+1USSvsHGjhgSG+4oIcT2JynvXSy3BBACSHGs5xri6W0jxBJ+PzEgX1kRBJ0vf8fz12Xs/eUDGcI7rZJochkj4bRF0FiNbDfGZEkAUrIPX7STPhzs0NFhXKG8wsO/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=ykb3PuSX5SAI+R8wxC7PVzFq5Z1MUVmxV7kUfgrRp3A=; b=xIPTjzkwo/V9xjJ7GWlJZynOcq9F9yLTtT35wh7TexcD+ywI5Ik3sKOQXbfF22OFMc+jLMp6GjjgHMHM0zkVK4f07trpI/9Dg7G2xfs8ME/3g7uhf9GE2Ci8tdsIJZBH7EpxEPVBoNNZnRG0u4H4eSpeZy21037LJ9Cn1krvzm3DxD4bI71hGKvduzy0xZ4ozkKGP4eri42JkitZLpeL+HRXOq98OynpIcy8EOkq0fcCnVPUNNav/3qpig0cqJ3l1y0b8VLJDYXLimr3vj3ot0f+HI1cYpIFoC+rRpNtgaCXO7Hn95I2PhMeBE6zO17hsP47Dz/ITRFXu3PhW8D2HQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ykb3PuSX5SAI+R8wxC7PVzFq5Z1MUVmxV7kUfgrRp3A=; b=wtY997j6bIlX6MwTzjLW2fhnGgvWNEZAAoo7js86zkQ2t83s2vapRiZuLkw17f3KL6E3zTP7z3jSap/9d8CZaxPSTFSo4WOpiKP1SKUXC0ArV/OJlilorr03vJEXarh0XtENu8LXlqk4CJOatWJySeh5eCw1BcyjjMbUHKdp3AI= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C From: Jason Andryuk To: CC: Jason Andryuk , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , "Volodymyr Babchuk" , Andrew Cooper , Anthony PERARD , "Jan Beulich" , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Christian Lindig , "David Scott" , "Daniel P. Smith" Subject: [PATCH v2 04/17] xen: Introduce XEN_DOMCTL_CDF_not_hypercall_target Date: Wed, 16 Jul 2025 17:14:51 -0400 Message-ID: <20250716211504.291104-5-jason.andryuk@amd.com> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250716211504.291104-1-jason.andryuk@amd.com> References: <20250716211504.291104-1-jason.andryuk@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: None (SATLEXMB03.amd.com: jason.andryuk@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN1PEPF0000F0DE:EE_|LV2PR12MB5869:EE_ X-MS-Office365-Filtering-Correlation-Id: 309870da-e022-4eb8-8d3e-08ddc4aedb84 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|7416014|82310400026|1800799024|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?W2+2jV4wYV5Ci6UZxFYRgIHLKPEaJvKFlJGXRx/fWsnBsbz18cPJrZINZLMo?= =?us-ascii?Q?2/1snR/2EWH1aJzYy7CqzttS6RCnTA6UQxcYI0vsmr4IvMRKZWd+ewMMouA2?= =?us-ascii?Q?gkUJ6OoNhiwi1X0zakfsg0Ly9mAwIWmEuEmhBL4UuVNSfTOs5MoN/tnyRdg/?= =?us-ascii?Q?k4m6YguZME6CGcGrUvEKli0UQR+7roRq68ZRllx49GjSJ9WgH54dZC5xewfX?= =?us-ascii?Q?glVk2d1lJl0ShK0tfTyzuGrMvXreR7VKcjc6o1gfcPaZqwFUJsBj7CyGNRHE?= =?us-ascii?Q?NkOUjRweEhz3uqaBdqh5q6QHbbXQ3OZxaWpEaAK54sr/6PGYQ4o7NHfHMT/K?= =?us-ascii?Q?zrYtX3Y7h1b3ObIjW2fOy0/omPLmbmf3m2nkWVcMdgemF4fy23C/cnm6a/OB?= =?us-ascii?Q?p2Fyk4xk5VBFc7BSvNQzZfw21xCMraAzp0EaD4feMFrat1o28ksG5PyMCcmw?= =?us-ascii?Q?TJ5c7g7Z6WU0HLBh0zsr09TFAqzmVgMj5NbF2l+/jaanHi3aZ2/ZigqE5t0R?= =?us-ascii?Q?39jfTqu8xCaNqZU2wPO7Pp/aEefMoJ7YDxkQCKdbyPSo5DQ9zEZgtroVPEz1?= =?us-ascii?Q?heZShNCIxt7Lq+jmd5LtRrxSU4kwn6LxOayHQ/Q2xMk2e0fG8isB88k7ywjK?= =?us-ascii?Q?VMVmjD856M87amQuZVIVo7oMr4phVYOCt0vARdW0/DD3Q/jZt2ZNC+6GCHnK?= =?us-ascii?Q?tJS1a98lAXe610Qt0KZpap/SzRNxNs0dRhUx9escmKhBz2UfwvbpPcRCyvQt?= =?us-ascii?Q?vVkSfMX2qvMZ2oq1HobMMu6DSxfRpazVHMR48FPVY+LHRbcPmzo6vwaW94kS?= =?us-ascii?Q?/MRsanZCIhHNlMPvAQD813DiYAIWIoWTdHChFL56e50N3zGMZxDQl0RVNF1u?= =?us-ascii?Q?Fc4HqcjtD0+koB5gO4qoeSe1VVqfvhLoj7SN1W1CplyZHvIcw9KtXDxQvrmw?= =?us-ascii?Q?J3vQxPxuxrgJgqHXQG762au3gTB7ElCvWQn2pJD0UZ6U05rP2wQ4BJfPZoj5?= =?us-ascii?Q?AjyW7Oq5AbJto1TazmYtBzyDCIL9LzgC/Z+Sl4gAj27n6USPrfwYXiscTrdt?= =?us-ascii?Q?R3O3IUwJDc5lJLheZil45/Dcdk0BhgbHYjYXqtvxXiIxpG7r6ZFVQXkqWFzX?= =?us-ascii?Q?/T3eodtQDPcw/uo5FW0EthhUItAMhcRy7agR99Z7tNpXE1OcAoOmx/+ClKUe?= =?us-ascii?Q?/3aW6izVrDIM1L5+GcsuVr1NnF+1crI1HZbTl+m4NPiQtzK/eqZSwA3GNa7a?= =?us-ascii?Q?gMgxbQdViWWpmzJhwiZ0cLIj79mK44DD1TvDr/zLwaSWDCOZmbYnB7AspCzp?= =?us-ascii?Q?4v/EV1rhAt/isP+ujQQ+l0peBUzKXtjn+I8xVXkr55H7tR6fh/uPXI0tE2NC?= =?us-ascii?Q?jGdBoxgljMoLXK27gZvQfV9tmAnHp5dSCR1eDQyw42Z6ApfutS02Vyw+m7u5?= =?us-ascii?Q?nnt4r3P268txtlXNOXHRIyPdziJqeQWEti03kaHvskPkklk6KNI2qOB8u8Ut?= =?us-ascii?Q?RcZ1j22AVvuFeMOscCUOu/ZehNGD2qsNnJsL?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(7416014)(82310400026)(1800799024)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jul 2025 21:22:24.2293 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 309870da-e022-4eb8-8d3e-08ddc4aedb84 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: MN1PEPF0000F0DE.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5869 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1752700974127116600 Content-Type: text/plain; charset="utf-8" Add a new create domain flag to indicate if a domain can be the target of hypercalls. By default all domains can be targetted - subject to any other permission checks. This property is useful in a safety environment to isolate domains for freedom from interference. Signed-off-by: Jason Andryuk --- DOMAIN_CAPS_NOT_HYPERCALL_TARGET duplicates the hypercall-untargetable DT property, so it could be removed. Leaving it here for now to at least illustrate the alternate approach. --- docs/misc/arm/device-tree/booting.txt | 6 ++++++ tools/ocaml/libs/xc/xenctrl.ml | 1 + tools/ocaml/libs/xc/xenctrl.mli | 1 + xen/arch/arm/domain.c | 3 ++- xen/common/device-tree/dom0less-build.c | 6 ++++++ xen/common/domain.c | 2 +- xen/include/public/bootfdt.h | 10 ++++++++-- xen/include/public/domctl.h | 4 +++- xen/include/xen/sched.h | 12 ++++++++++++ xen/include/xsm/dummy.h | 4 ++++ 10 files changed, 44 insertions(+), 5 deletions(-) diff --git a/docs/misc/arm/device-tree/booting.txt b/docs/misc/arm/device-t= ree/booting.txt index 07acc7ba64..963dd81912 100644 --- a/docs/misc/arm/device-tree/booting.txt +++ b/docs/misc/arm/device-tree/booting.txt @@ -307,6 +307,12 @@ with the following properties: passed through. This option is the default if this property is missing and the user does not provide the device partial device tree for the d= omain. =20 +- hypercall-untargetable + + Optional. An empty property to specify the domain cannot be the target + of hypercalls. This protects a domain for freedom of interference from + other domains. + Under the "xen,domain" compatible node, one or more sub-nodes are present for the DomU kernel and ramdisk. =20 diff --git a/tools/ocaml/libs/xc/xenctrl.ml b/tools/ocaml/libs/xc/xenctrl.ml index f5835e7d95..00c29199dc 100644 --- a/tools/ocaml/libs/xc/xenctrl.ml +++ b/tools/ocaml/libs/xc/xenctrl.ml @@ -72,6 +72,7 @@ type domain_create_flag =3D | CDF_VPMU | CDF_TRAP_UNMAPPED_ACCESSES | CDF_DEVICE_MODEL + | CDF_NOT_HYPERCALL_TARGET =20 type domain_create_iommu_opts =3D | IOMMU_NO_SHAREPT diff --git a/tools/ocaml/libs/xc/xenctrl.mli b/tools/ocaml/libs/xc/xenctrl.= mli index b9471a56a8..daf6686f4d 100644 --- a/tools/ocaml/libs/xc/xenctrl.mli +++ b/tools/ocaml/libs/xc/xenctrl.mli @@ -65,6 +65,7 @@ type domain_create_flag =3D | CDF_VPMU | CDF_TRAP_UNMAPPED_ACCESSES | CDF_DEVICE_MODEL + | CDF_NOT_HYPERCALL_TARGET =20 type domain_create_iommu_opts =3D | IOMMU_NO_SHAREPT diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c index 57eecbd250..5f6358096f 100644 --- a/xen/arch/arm/domain.c +++ b/xen/arch/arm/domain.c @@ -614,7 +614,8 @@ int arch_sanitise_domain_config(struct xen_domctl_creat= edomain *config) unsigned int flags_optional =3D (XEN_DOMCTL_CDF_iommu | XEN_DOMCTL_CDF= _vpmu | XEN_DOMCTL_CDF_xs_domain | XEN_DOMCTL_CDF_trap_unmapped_accesses | - XEN_DOMCTL_CDF_device_model); + XEN_DOMCTL_CDF_device_model | + XEN_DOMCTL_CDF_not_hypercall_target); unsigned int sve_vl_bits =3D sve_decode_vl(config->arch.sve_vl); =20 if ( (config->flags & ~flags_optional) !=3D flags_required ) diff --git a/xen/common/device-tree/dom0less-build.c b/xen/common/device-tr= ee/dom0less-build.c index bb52291dfb..22af043aa5 100644 --- a/xen/common/device-tree/dom0less-build.c +++ b/xen/common/device-tree/dom0less-build.c @@ -886,6 +886,9 @@ void __init create_domUs(void) =20 if ( val & DOMAIN_CAPS_DEVICE_MODEL ) d_cfg.flags |=3D XEN_DOMCTL_CDF_device_model; + + if ( val & DOMAIN_CAPS_NOT_HYPERCALL_TARGET ) + d_cfg.flags |=3D XEN_DOMCTL_CDF_not_hypercall_target; } =20 if ( dt_find_property(node, "xen,static-mem", NULL) ) @@ -896,6 +899,9 @@ void __init create_domUs(void) flags |=3D CDF_staticmem; } =20 + if ( dt_property_read_bool(node, "hypercall-untargetable") ) + d_cfg.flags |=3D XEN_DOMCTL_CDF_not_hypercall_target; + if ( dt_property_read_bool(node, "direct-map") ) { if ( !(flags & CDF_staticmem) ) diff --git a/xen/common/domain.c b/xen/common/domain.c index 42c590b8d7..c347de4335 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -723,7 +723,7 @@ static int sanitise_domain_config(struct xen_domctl_cre= atedomain *config) XEN_DOMCTL_CDF_xs_domain | XEN_DOMCTL_CDF_iommu | XEN_DOMCTL_CDF_nested_virt | XEN_DOMCTL_CDF_vpmu | XEN_DOMCTL_CDF_trap_unmapped_accesses | - XEN_DOMCTL_CDF_device_model) ) + XEN_DOMCTL_CDF_device_model | XEN_DOMCTL_CDF_not_hypercall_targ= et) ) { dprintk(XENLOG_INFO, "Unknown CDF flags %#x\n", config->flags); return -EINVAL; diff --git a/xen/include/public/bootfdt.h b/xen/include/public/bootfdt.h index c6b5afc76a..1eba1cc487 100644 --- a/xen/include/public/bootfdt.h +++ b/xen/include/public/bootfdt.h @@ -32,8 +32,14 @@ * Hardware domain for running QEMU. */ #define DOMAIN_CAPS_DEVICE_MODEL (1U << 3) +/* + * Domain cannot be the target of hypercalls. This provides the domain + * freedom from interference from other domains. + */ +#define DOMAIN_CAPS_NOT_HYPERCALL_TARGET (1U << 4) =20 -#define DOMAIN_CAPS_MASK (DOMAIN_CAPS_CONTROL | DOMAIN_CAPS_HARDWARE = | \ - DOMAIN_CAPS_XENSTORE | DOMAIN_CAPS_DEVICE_MO= DEL ) +#define DOMAIN_CAPS_MASK (DOMAIN_CAPS_CONTROL | DOMAIN_CAPS_HARDWARE |= \ + DOMAIN_CAPS_XENSTORE | DOMAIN_CAPS_DEVICE_MOD= EL | \ + DOMAIN_CAPS_NOT_HYPERCALL_TARGET) =20 #endif /* __XEN_PUBLIC_BOOTFDT_H__ */ diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h index 88a294c5be..f1f6f96bc2 100644 --- a/xen/include/public/domctl.h +++ b/xen/include/public/domctl.h @@ -70,9 +70,11 @@ struct xen_domctl_createdomain { #define XEN_DOMCTL_CDF_trap_unmapped_accesses (1U << 8) /* Allow domain to provide device model for multiple other domains */ #define XEN_DOMCTL_CDF_device_model (1U << 9) +/* Domain cannot be the target of hypercalls */ +#define XEN_DOMCTL_CDF_not_hypercall_target (1U << 10) =20 /* Max XEN_DOMCTL_CDF_* constant. Used for ABI checking. */ -#define XEN_DOMCTL_CDF_MAX XEN_DOMCTL_CDF_device_model +#define XEN_DOMCTL_CDF_MAX XEN_DOMCTL_CDF_not_hypercall_target =20 uint32_t flags; =20 diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h index 9863603d93..8a32f9a1b6 100644 --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -1157,6 +1157,18 @@ static always_inline bool is_dm_domain(const struct = domain *d) return evaluate_nospec(d->options & XEN_DOMCTL_CDF_device_model); } =20 +/* + * Return whether this domain can be the target of hypercalls from other + * domains. + */ +static always_inline bool is_hypercall_target(const struct domain *d) +{ + if ( IS_ENABLED(CONFIG_PV_SHIM_EXCLUSIVE) ) + return true; + + return evaluate_nospec(!(d->options & XEN_DOMCTL_CDF_not_hypercall_tar= get)); +} + #define VM_ASSIST(d, t) (test_bit(VMASST_TYPE_ ## t, &(d)->vm_assist)) =20 static always_inline bool is_pv_domain(const struct domain *d) diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h index 0b341efd18..f2205575ed 100644 --- a/xen/include/xsm/dummy.h +++ b/xen/include/xsm/dummy.h @@ -91,12 +91,16 @@ static always_inline int xsm_default_action( return 0; fallthrough; case XSM_DM_PRIV: + if ( target && !is_hypercall_target(target) ) + return -EPERM; if ( is_dm_domain(src) ) return 0; if ( target && evaluate_nospec(src->target =3D=3D target) ) return 0; fallthrough; case XSM_PRIV: + if ( target && !is_hypercall_target(target) ) + return -EPERM; if ( is_control_domain(src) ) return 0; return -EPERM; --=20 2.50.0 From nobody Thu Oct 30 22:53:26 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1752700967; cv=pass; d=zohomail.com; s=zohoarc; b=ho8IoCs76+DUyDBGv2Vl+mqLkVscnHNI72cXx2C9S80fViiWvoSw4HB5jHUGIEWZdDBxN8uf7ATGXnO9HRLj1OyrJ25ZBxhcDERXLHXQWev3qCSLYZ3j3EAqkXbGOVGY0wTSrhlS3U7PBIha7W0EM9neVh2L2pZUEf5UJM5uuY8= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752700967; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=flbFdc0ODgOl/ffFodWP5kfJpi5M4Vh460vEQRALjBE=; b=edYhMcmePmo/QUnuyfWzq1HmWcUSttSPrr3clk4nVI8ekBtyX/GL1mZxcEKv4HOARd04qUNpSXrI50PaW9PbZzpvhF7Jia+h21gCs8ziKj5Fc0Gy5bdIk16oPN10Y0Haq3YMYb8WIJy0VwBleXMBt2oDYe6k8qOnY6yPjZDk0Lw= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1752700967561381.91567870247127; Wed, 16 Jul 2025 14:22:47 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1045778.1416010 (Exim 4.92) (envelope-from ) id 1uc9aC-0008Of-1X; Wed, 16 Jul 2025 21:22:32 +0000 Received: by outflank-mailman (output) from mailman id 1045778.1416010; Wed, 16 Jul 2025 21:22:31 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uc9aB-0008Np-Qd; Wed, 16 Jul 2025 21:22:31 +0000 Received: by outflank-mailman (input) for mailman id 1045778; Wed, 16 Jul 2025 21:22:30 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uc9aA-0007F2-4v for xen-devel@lists.xenproject.org; Wed, 16 Jul 2025 21:22:30 +0000 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on20631.outbound.protection.outlook.com [2a01:111:f403:2407::631]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id f92d37ba-628a-11f0-b894-0df219b8e170; Wed, 16 Jul 2025 23:22:28 +0200 (CEST) Received: from BL1PR13CA0325.namprd13.prod.outlook.com (2603:10b6:208:2c1::30) by DM6PR12MB4140.namprd12.prod.outlook.com (2603:10b6:5:221::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8901.35; Wed, 16 Jul 2025 21:22:25 +0000 Received: from MN1PEPF0000F0E5.namprd04.prod.outlook.com (2603:10b6:208:2c1:cafe::3d) by BL1PR13CA0325.outlook.office365.com (2603:10b6:208:2c1::30) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8964.12 via Frontend Transport; Wed, 16 Jul 2025 21:22:24 +0000 Received: from SATLEXMB03.amd.com (165.204.84.17) by MN1PEPF0000F0E5.mail.protection.outlook.com (10.167.242.43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8943.21 via Frontend Transport; Wed, 16 Jul 2025 21:22:24 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 16 Jul 2025 16:22:11 -0500 Received: from fedora.mshome.net (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Wed, 16 Jul 2025 16:22:10 -0500 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: f92d37ba-628a-11f0-b894-0df219b8e170 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NAzuXxw9ukkiGgpUpJwKnOgtwnp5pmGd3Y42MAyrjrgMKjVIC+MhwQvCkx7yI+ufWQh2TpzftCu4vNEDWJ13cZ/ULV+T/2h/YNRJ0NnONEAzFABa68BA+PEbtQUv63EoT6jU9KsCX2JWzZry4Hyg5U56tPGhyC1ODaw8ty1I0PAdWDGORN18NmV49ltaqYrBrFAwWFQGuFpHCZAGo6CaUD9Njwf3r+gBZxGMr9Bk8EfcFQc1PInolq7u+eVpMaxeF6byATe28bKt2ELVo1tFE+poBPoGaYzYS1xji+/F/NQ5UkEe+cjM9vBlToOvkhM+EAkDMi3I5m6gW8LV6hFmvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=flbFdc0ODgOl/ffFodWP5kfJpi5M4Vh460vEQRALjBE=; b=xv2CGAka7OvWhw+hnK4eEU0Jv/rVnY6yOP4t1j419z8Fa8j06u/Ouu+fNkIoEQHzHzPx/+vqfFyDLg8+MnsLyG1GyjCvuELxMynAafUSDtIKU6VtJAi6v4dHwf8xEms68R5WyuRVHGmbJA/kiWeyKyXoTYFPcrFyGHXkGHdP6RA7BX5rPsw8Ax6oRGKYzjfFVN9dxaRvierK1ua05tU/a1zlz/8Sgo6mI9WgSQRXP2rsFBGjdEeEt2YSWa9CDb9hSgITXQCgfLLNKhYosugI+kZogdVbgBifOiSJaw0VKZE412QcbGeKayunNE/klAGxx4CB7eRFM8Wyuacm4fI5dw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=flbFdc0ODgOl/ffFodWP5kfJpi5M4Vh460vEQRALjBE=; b=2/+lgIFs/6BsnzEP2ozotFZk2ElrSbK99qUgpQfREzovFlFZb5bLrHg/XLZFrVeoeBSkhJ6xQu9CNSSW2Mt2eQP7k83vXDQjfLqdtSreovFD83OZqeCXD9Ap4+X0+SpPY0wahXC9rPlLArgFR+sin+2cNW/87BVVo6GRK1TBlEM= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C From: Jason Andryuk To: CC: Jason Andryuk , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , "Daniel P. Smith" Subject: [PATCH v2 05/17] xen/dom0less: Workaround XSM for evtchn_alloc_unbound Date: Wed, 16 Jul 2025 17:14:52 -0400 Message-ID: <20250716211504.291104-6-jason.andryuk@amd.com> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250716211504.291104-1-jason.andryuk@amd.com> References: <20250716211504.291104-1-jason.andryuk@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: None (SATLEXMB03.amd.com: jason.andryuk@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN1PEPF0000F0E5:EE_|DM6PR12MB4140:EE_ X-MS-Office365-Filtering-Correlation-Id: eb8176d5-b36a-4370-c923-08ddc4aedbb1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|82310400026|1800799024|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?0MpSp7yZ6SSqOyGOaxlPJ1B5zSFxv+8Gwp8uifpvK5IKrEzDjlNlzDFCchmb?= =?us-ascii?Q?5Kd2BYn0Lwws34bey53W9W5LdvtkfPepzPVexI34LdpkDjMZLrdInzZT5hnV?= =?us-ascii?Q?7bjnDaVpY/lkJ37hfCXFk2pi+Q3RpIlhwBFatr4YioLeZq7kP7kTuiXujLAg?= =?us-ascii?Q?cJ4BzpCvXNEiD00kRTABq7IlndtO63z/9rBEveTBxJGg3kec9uC/ryAxphp9?= =?us-ascii?Q?zXK2c9p49rb0jWPnP279++6RPO1UOOPbGFfJIkyQ1/6bdTeEYyGdbBB2Dm08?= =?us-ascii?Q?p4A/EWcrVD3vzv8PT3205S82R8qSGtL4Jf5R57+3xefNPcDQ2gMN73I4ORRH?= =?us-ascii?Q?AnmxyErF4Uv5t+VR6pRTn89+LPS4WlCrsFSb7oCA0CK647xl/WBfv8cRmiat?= =?us-ascii?Q?G0fOhLpZL+jNxZ8/P1O82i21vxDEd+IDY9xE35ZxGEVe6ra+t1w8X+UHwEWv?= =?us-ascii?Q?t6/5AJslc4B/TG2uk875FT62PN9gkMZ10rpRGWbl6hqat6LCZO/irRxlCFv9?= =?us-ascii?Q?65/JjAMs5U9fVhVnIaQBzlSxAHuKHHME9ZRFBrXfpNjX72/yOuk4osEQzgYN?= =?us-ascii?Q?E87CoOWpDBBGbuodLQr+xeytmuDPdshWEa4X+0VTCvc/aOnANG9vKFyi6I9J?= =?us-ascii?Q?2basWnMUBuk/nBsNrz9VI5c9cSdSH4S9GKuYwPA4fPMbjYL/TuLNYjD7RC78?= =?us-ascii?Q?76Snp7Ujs48bz8IhkB0pfTyLXXO54WcVRS048xXrEaR7qvjfV0xmIDQNi+B+?= =?us-ascii?Q?GMDcMigbytljj/cHTkR0EHbODG5ejcTTXgg4LJTGpBJnslEn2b2VM9I6U6HA?= =?us-ascii?Q?y40neD0U3cbghmKrvUBoJwzaXEYn1Z+scQuOdCEtLHRCuLE1o4CVeTL5lW1M?= =?us-ascii?Q?sDeo3vX4iRUOhCFqs5HGt2YiUEKVHMtG5LgjGrxMS5VDoU2NTwq9ao8u6bi/?= =?us-ascii?Q?C77RwxyGWlxMF/3f1Ckk24MHSjDKQsPtvPvho0Bv6L0OWKuKMHrtayMytxVo?= =?us-ascii?Q?nhorHDXalDKqNmfCGROR4oKv7aFYU6VuqRWoeenvvLEpihvK1twO4VSj/LYr?= =?us-ascii?Q?nGsetpKHn8mfMUlRBQUf6djWlHhUL5E+x0+8Rry0ojAKfcsy59Qud/F97MIF?= =?us-ascii?Q?B1JZ4t7Tk36jME+oWe1iJNh6o3PtLttLEndqvaj4Wa1GBM1dkvDjVTqWDAc6?= =?us-ascii?Q?5EtM6NHeHHKdNykNY7ULWDSO23dksXkR7EYYwvI97XKkQ43sKkXydZiFimZ2?= =?us-ascii?Q?nR/rEBQp5k1hIZTLq+/aQwkJM32HolVUG8P200o6u7jz7oRGYeOQKG2J/1xR?= =?us-ascii?Q?+v7f2NJfOJqdDiAmmVnOi17eHRBLihPjnB8DVQ6IxltsaLGiypkndZeYWSh3?= =?us-ascii?Q?3/QPxKtviQYi2ZOSyhpsy2dVXf/wFEE+rJM1kJHYb9kQ7Ze8nWIB6TlOQUQn?= =?us-ascii?Q?8kzwUNYJzAUtXpc0Ywmlii6juwRhi/fT4Fh6OMSIucyarDbcFFvFGERBcGQd?= =?us-ascii?Q?49HDNX+capGhFFdsl2Km4+TDlnLFnZyWJZpJ?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(82310400026)(1800799024)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jul 2025 21:22:24.5246 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: eb8176d5-b36a-4370-c923-08ddc4aedbb1 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: MN1PEPF0000F0E5.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4140 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1752700967840116600 Content-Type: text/plain; charset="utf-8" When used with an untargetable domain, xsm_evtchn_unbound fails even though the idle domain has is_privileged =3D true. Switch current to the domain under construction so that event channel creation is allowed as XSM_TARGET. Signed-off-by: Jason Andryuk Reviewed-by: Stefano Stabellini --- v2: New This was Jan's suggestion when dom0less originally had trouble with evtchn_alloc_unbound() and xsm_set_system_active() was introduced. As noted, is_privileged is insufficient for operating on an untargetable domain. --- xen/common/device-tree/dom0less-build.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/xen/common/device-tree/dom0less-build.c b/xen/common/device-tr= ee/dom0less-build.c index 22af043aa5..a2789e3bdf 100644 --- a/xen/common/device-tree/dom0less-build.c +++ b/xen/common/device-tree/dom0less-build.c @@ -77,11 +77,20 @@ bool __init is_dom0less_mode(void) static int __init alloc_xenstore_evtchn(struct domain *d) { evtchn_alloc_unbound_t alloc; + struct vcpu *old_current; int rc; =20 alloc.dom =3D d->domain_id; alloc.remote_dom =3D xs_domid; + /* + * Switch current from the Xen idle vcpu to the domain's vcpu. This i= s to + * pass the xsm_evtchn_unbound() check for an untargetable domain. + */ + old_current =3D current; + set_current(d->vcpu[0]); rc =3D evtchn_alloc_unbound(&alloc, 0); + /* Restore Xen idle vcpu. */ + set_current(old_current); if ( rc ) { printk("Failed allocating event channel for domain\n"); --=20 2.50.0 From nobody Thu Oct 30 22:53:26 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1752700973; cv=pass; d=zohomail.com; s=zohoarc; b=i2RHYITQH5X75trvAO4N/BsyDOk6pycZsA4NxSczzdc7hJhEP4rOVdwZ+an0/IW+X8MPeZHu1k4FXL3mjrpNZrjZacYL3w6eaqQ4wgap00AX+vs4dsXQN704iYT9q6KVQVD34SonddO0n20ausd+8AgsIJ5uU9v1T7uviRAKgsA= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752700973; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=RC/j65QIU+fP7oEUp28jilWRcpySatiEoKnXk/jfLvM=; b=OM/cOM/DByFsA0XYkE2OVGiHXLUXq6FwzAS0KKRgrniNeNIx4/KmR0PfIJ/M3ueLn6Ia984JCdv9PVlSwXDeau3qlPxNR1TsfBG5O31/CHetu85oeblLEF0rtCBRi+MZoy4bBaDCE9AMxdMMLGHvZmwV3kVQLHexEqv4PAYp1HQ= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1752700973956151.35308934796967; Wed, 16 Jul 2025 14:22:53 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1045781.1416029 (Exim 4.92) (envelope-from ) id 1uc9aD-0000LK-Kc; Wed, 16 Jul 2025 21:22:33 +0000 Received: by outflank-mailman (output) from mailman id 1045781.1416029; Wed, 16 Jul 2025 21:22:33 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uc9aD-0000Hm-8A; Wed, 16 Jul 2025 21:22:33 +0000 Received: by outflank-mailman (input) for mailman id 1045781; Wed, 16 Jul 2025 21:22:32 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uc9aB-0007F7-TM for xen-devel@lists.xenproject.org; Wed, 16 Jul 2025 21:22:31 +0000 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2062b.outbound.protection.outlook.com [2a01:111:f403:2009::62b]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id fac03e20-628a-11f0-a319-13f23c93f187; Wed, 16 Jul 2025 23:22:30 +0200 (CEST) Received: from BN9PR03CA0783.namprd03.prod.outlook.com (2603:10b6:408:13f::8) by PH7PR12MB7428.namprd12.prod.outlook.com (2603:10b6:510:203::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8880.23; Wed, 16 Jul 2025 21:22:25 +0000 Received: from MN1PEPF0000F0DE.namprd04.prod.outlook.com (2603:10b6:408:13f:cafe::3f) by BN9PR03CA0783.outlook.office365.com (2603:10b6:408:13f::8) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8943.20 via Frontend Transport; Wed, 16 Jul 2025 21:22:24 +0000 Received: from SATLEXMB03.amd.com (165.204.84.17) by MN1PEPF0000F0DE.mail.protection.outlook.com (10.167.242.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8943.21 via Frontend Transport; Wed, 16 Jul 2025 21:22:24 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 16 Jul 2025 16:22:12 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 16 Jul 2025 16:22:12 -0500 Received: from fedora.mshome.net (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Wed, 16 Jul 2025 16:22:12 -0500 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: fac03e20-628a-11f0-a319-13f23c93f187 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=gXoWBJ2hjuqp+s+DBQGhj8e0OUHcc+dFINaaC6zreT10nbbO5z/8Ke4ZWbP3CBhx4szQOsKqkKp3uvqUMeQcOIM4CitrEXFk6eZ/1QBbTiYydp28JtIiB340BsL5N3Daowjb0k4f+5ahkstZYallIApcye5q2nOw/D30SyvcKFBFPkVZda3CBIJtK8lia1rZO+UUrZEu3N8dZjcssCIpPwBZ3Mag3FNVrqkf5Vk7y4NPWx+j4ui+MWUzDUVU0c5MZSuDcbts1glF/gPCfiatbsPaIG0f85+bGZ1mPGneQ2Ip1qtWyeI2fhro0nEDx4xqwKm2mNAeXkB+f+L8pzmbPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=RC/j65QIU+fP7oEUp28jilWRcpySatiEoKnXk/jfLvM=; b=VU3esb5b787D39sx/sbCUuCCs3wcjdRy8YCRuDoJKjOrO9HmkqKY4HH6CIFNy+vxZPv2IbhpZKDBtw86F2bm5ePjIxtYvI8mdhJLoJqSy9KOqNcXM9fiOfiWbr0MEqjoxZkUqjFCNs1ZJHir/0+pel8XwbvDkSQqqkV9updmUNbe1Hack52YXBB9E4uqtfvwW5BsBAggxBH/VJc87jySDLdWSaJwEXymgTHU+8Nrv/oBhGVWolN2We1d9HP1nxzME6+UxU7oeM8KH98tBlf0qYRrk+1pTlQqK3AYjQRyOsrh0TffZi7YIh6V7e2aLw8sSJC1VNYUpmbA5MpkzRkdeg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RC/j65QIU+fP7oEUp28jilWRcpySatiEoKnXk/jfLvM=; b=m6d6rg1oae4BlOn/yhc/SnwI8zagbtfRjH9loDmmUTBtsMpXRo7pSh0b6hd4ZPQaJM/AY2na2hnGNy0DDOm0FW6oqmimbN1gT2lEPUHWLSUADOZKHxECll940RNO1PL2tnC2GIIQKMNY65mBZzMAnI8Y90PiFMRjrzux3pvLfc8= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C From: Jason Andryuk To: CC: Jason Andryuk , "Daniel P. Smith" Subject: [PATCH v2 06/17] xen/xsm: Expand XSM_XS_PRIV for untargetable domains Date: Wed, 16 Jul 2025 17:14:53 -0400 Message-ID: <20250716211504.291104-7-jason.andryuk@amd.com> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250716211504.291104-1-jason.andryuk@amd.com> References: <20250716211504.291104-1-jason.andryuk@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: None (SATLEXMB05.amd.com: jason.andryuk@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN1PEPF0000F0DE:EE_|PH7PR12MB7428:EE_ X-MS-Office365-Filtering-Correlation-Id: 1b34d842-352b-4767-a3ac-08ddc4aedbcc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|82310400026|1800799024|36860700013; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?7hJ/Nj7EiJmYAyrBzQtUiPKygknnSKXtYXUma3VK/Lo4Gfj5u1/5WTN3PN4P?= =?us-ascii?Q?CND4tTXCQohM9i9bvFQ9ZV///D6HzOfoCWCsClMFb8LX5NgmPCoVMelErp9i?= =?us-ascii?Q?clQ68NJyRYS1lwRl5Zx9u04jdD4x33FR2NrUTBAZAidi5ewl25gwWdCROamo?= =?us-ascii?Q?acupYNkW4O8MuiR9a7zFWaB9BlcmdpYAHuqslyZWn2Sj06eboqlMZx2K2wF8?= =?us-ascii?Q?wIesgtzVyvme0g3uJwp7MzopQjfeyk5G+5XIu/s/84hXN8KW5itaJPIRUCay?= =?us-ascii?Q?VK8/9IT2aj6d4PTn9TcRXyddt2RmNH3Eggde2EGfaRTyAMUPecyQJlqLfjJ+?= =?us-ascii?Q?vsjbqEjvJ3Ezli5NoWT1eZGqmt9hMCIxV+2K1DCpo+5ukkly5wF4Kc4G6Ctj?= =?us-ascii?Q?ig6pM2YXJtjcuWTRA1sPaS818kj9ImQiw4mb4C0ZM95BtIQfDhwdC+CWmHjZ?= =?us-ascii?Q?u+Uc2qpPiEPbICZSad5CPodlFbdQrTGaXui81r8aIngUCdlMXXO3JH89MJH2?= =?us-ascii?Q?xWRyn5PLm9NJjzYTDcOvjpGt/rb9rqVNtcY91Yf2JBSKRT0ONprUAdShHGuO?= =?us-ascii?Q?tjCiNgS/ImCv4Ko5A/xES28yZ4AELd0wvN/OrNS/PcDh/Afa2JyEJugJwtIN?= =?us-ascii?Q?7YdrJWUQcFi43HXkWkrGyYrNx/HHQrT+feli1EmFNKceevIcciC4Z272RC5u?= =?us-ascii?Q?z5hxSV+ZRgrUFvSMcIQhNVxqPIxzagWMu7YjQX61BEmxzb4O+pkqiYkjcjLO?= =?us-ascii?Q?gXELwheW1ZtUbFMwFHn8sN5D7tpMs+N7QPzoeDJ3+/4gOGc5lWkHxRTghd9H?= =?us-ascii?Q?0ky2slKDiG+W9MXR/QhBx1GsxL1QBdbOlv5uPdff7w4FfeDtLS8AQOFbCEGP?= =?us-ascii?Q?U38MbysH5rOybIS+bV0BjoHoO+wyU05y4HPZdAFTJ2bEi3OV+5EmfnTtf5E0?= =?us-ascii?Q?C9oBEBQ7c57O2LfHScN/syT6pfRqyt6JYghvXx6vdYSrKJtxSx6GPjMb7Blp?= =?us-ascii?Q?NMQrAxePfjrucyMdhhvsd3EgfeL6N45wvbteYg9A4uTClp/E02Z5EIyKM1lv?= =?us-ascii?Q?FkE/e32VOzMuQSEHMAXMOt42MvwQbkdtt45v74gTpa9DwUg5mXl5loY3lYvE?= =?us-ascii?Q?KPWGBEyKeZMXf98gvMh/y8SKpp+5QLjEMLiQij9jHsri9GHpYPbVzhYDdn3d?= =?us-ascii?Q?iGQvEnZRwbrILt4mXDsQnwNtnZEaSeqBovAr1M9s2fwjLWFrdJ/ikJbigtQE?= =?us-ascii?Q?WGgoH5PpXNpHvi0N6ww0aA2ar7OoaVX0Hg3mdVJdpuZNHlpmYQTqAhwZ+GFt?= =?us-ascii?Q?27VPuYa1WcV3bIuY23W7AA+rHtoPW98Okoe5gw2r9U9mbf9PRpql2+sgpO64?= =?us-ascii?Q?F9ma/KmL1xj8g6wfasQVqJnDnUzNluocG61Lbf1MEPwMEn2yqeOfH3TIA2ND?= =?us-ascii?Q?z8QiLzoUbWtAjT28I6xd96SyNmyAH3QMtIAiHoHUBC9Up7ik2taLGLihC1CJ?= =?us-ascii?Q?PQCi2BpNKizH4x7BOuzNV2Yg0Uf2x8mRUK72?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(82310400026)(1800799024)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jul 2025 21:22:24.7023 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1b34d842-352b-4767-a3ac-08ddc4aedbcc X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: MN1PEPF0000F0DE.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB7428 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1752700975954116600 Content-Type: text/plain; charset="utf-8" Untargetable domains are currently hidden from the control domain - e.g. xl list will not show them. getdomaininfo fails on the !is_hypercall_target() check in XSM_TARGET. Add control domain to the XSM_XS_PRIV check so it can pass. Signed-off-by: Jason Andryuk Reviewed-by: Stefano Stabellini --- xen/include/xsm/dummy.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h index f2205575ed..4d7b1d61eb 100644 --- a/xen/include/xsm/dummy.h +++ b/xen/include/xsm/dummy.h @@ -87,7 +87,8 @@ static always_inline int xsm_default_action( fallthrough; case XSM_XS_PRIV: if ( action =3D=3D XSM_XS_PRIV && - evaluate_nospec(is_xenstore_domain(src)) ) + (evaluate_nospec(is_xenstore_domain(src)) || + is_control_domain(src)) ) return 0; fallthrough; case XSM_DM_PRIV: --=20 2.50.0 From nobody Thu Oct 30 22:53:26 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1752700974; cv=pass; d=zohomail.com; s=zohoarc; b=i/Qatu4KEc7edD0SmTuqKj+sTuFjb6/09k7SOQPZF4T1LndjaLWPbZCOvm/Mb8zpVzAgYGU1OgB3xZ4vBR+Y5kHvH9q8ejoZa1xtuhmwc2ilFVRUAlUTIfP7H5hiAvwic+Uc4YLm+VLFKr0nH1FERiTQFJtKdaC8wq+hPywb574= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752700974; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=DXR0t+pBKl3PsI0yc4pZiF7K0QaYfE7hIDcuE/EBq/M=; b=iJaHlShA2smSdj6NQduOV+hlzgzHaJqdSdE+pTz09YqjE4nJiipVoMLxyqkxIR9kOmni+YFXGMpbuUMZFjtrqJjlIWvLicjKbn8uGUZoMmLBCBUYCqbGnr2X1peg2YIGEnXWmGmH8KzghipRFxTUqLYaiYHoVTqHYOQH4JrttfA= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1752700974802374.4939116245944; Wed, 16 Jul 2025 14:22:54 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1045783.1416048 (Exim 4.92) (envelope-from ) id 1uc9aF-0000tC-EO; Wed, 16 Jul 2025 21:22:35 +0000 Received: by outflank-mailman (output) from mailman id 1045783.1416048; Wed, 16 Jul 2025 21:22:35 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uc9aF-0000rn-0y; Wed, 16 Jul 2025 21:22:35 +0000 Received: by outflank-mailman (input) for mailman id 1045783; Wed, 16 Jul 2025 21:22:33 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uc9aC-0007F7-Tm for xen-devel@lists.xenproject.org; Wed, 16 Jul 2025 21:22:32 +0000 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on20621.outbound.protection.outlook.com [2a01:111:f403:2418::621]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id fa7333d3-628a-11f0-a319-13f23c93f187; Wed, 16 Jul 2025 23:22:30 +0200 (CEST) Received: from BN9PR03CA0804.namprd03.prod.outlook.com (2603:10b6:408:13f::29) by IA1PR12MB6284.namprd12.prod.outlook.com (2603:10b6:208:3e4::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8922.33; Wed, 16 Jul 2025 21:22:25 +0000 Received: from MN1PEPF0000F0DE.namprd04.prod.outlook.com (2603:10b6:408:13f:cafe::10) by BN9PR03CA0804.outlook.office365.com (2603:10b6:408:13f::29) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8943.19 via Frontend Transport; Wed, 16 Jul 2025 21:22:25 +0000 Received: from SATLEXMB03.amd.com (165.204.84.17) by MN1PEPF0000F0DE.mail.protection.outlook.com (10.167.242.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8943.21 via Frontend Transport; Wed, 16 Jul 2025 21:22:25 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 16 Jul 2025 16:22:13 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 16 Jul 2025 16:22:13 -0500 Received: from fedora.mshome.net (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Wed, 16 Jul 2025 16:22:13 -0500 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: fa7333d3-628a-11f0-a319-13f23c93f187 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=oApQOS1w7G4m1Xk9M4e5iaxjCX1S5w/0u5ss/FcjCq7PriDs+GE8XXdd1XvWWJKqlWxa6ZTr/0S0b/LZEr2CDSax8Wv8ZlwJBcqTuIIEr1DbYFG7/EboXToGm+rDpyounPjTm0utO9YrcyndNWI5yQrjrK2fGSMmWzOe81D4YgZ9tMA7DmqzwlkZlw4DUZ5qks090IMXMyRITTKcQ2H1aXXixxDchNqxIIWeUjJZALd+ePlYqTDH2kLwGXlRwXFvUlmWUclxl8H46Bkk7H99hjhmLXCBwKIfi3BbrTF6/eZxneBVWP1CRkxM6lleqpoR0N1GINK+H2VMVBF71aE+kA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=DXR0t+pBKl3PsI0yc4pZiF7K0QaYfE7hIDcuE/EBq/M=; b=bExf+k2UNxAoX9bA4d+EI3ezksy8ur1QfJcsCceu5fHLutHj2VnxKQRvzUbEtFE0i83ELsp7Q8NWSHtsGsv2J/wLuMXFtvT5wHpL7JkQAI30a/wtNoLv5hxM8Te/GIIOmn1sOtySvmAU7GN1b/e+7nbgTTaVKVBh9vG0Arl57OaZMukRkWZHGtMYOWWnsTw0EOjMKgMjgh67VD64+PVwb2dLkxy6BoBU23JH7msQ60tw4JIiK36G3wMm9jIAnUqfoOma6wzozGsQlwq6Fr6m5RProfX88S7mDBHEp/pOVsUmxvX5WLxToKRWB1YYelIqZreTS1fG47ODBGMAUKzZdw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DXR0t+pBKl3PsI0yc4pZiF7K0QaYfE7hIDcuE/EBq/M=; b=HHkAAdFR0xH/mSjH9jJdHr1nyQ56AzAgPUyc5sl1K41dCR0GHBvzffPIK9/k/jxwPvLWJyb+nZpSReizgmLiw1pZZNPZcB5NCoZYEyTQuzlbpLoVE6CeIB5n3HC5RsqeNxg/mIjVXPwvegrDOUVQ+EpqbS8Psj725fwfi4d9pow= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C From: Jason Andryuk To: CC: Jason Andryuk , "Daniel P. Smith" Subject: [PATCH v2 07/17] xsm/dummy: Allow HVMOP_get_param for control domain Date: Wed, 16 Jul 2025 17:14:54 -0400 Message-ID: <20250716211504.291104-8-jason.andryuk@amd.com> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250716211504.291104-1-jason.andryuk@amd.com> References: <20250716211504.291104-1-jason.andryuk@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: None (SATLEXMB05.amd.com: jason.andryuk@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN1PEPF0000F0DE:EE_|IA1PR12MB6284:EE_ X-MS-Office365-Filtering-Correlation-Id: 97697a27-6c58-4bd3-a77e-08ddc4aedbfc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|36860700013|1800799024|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?+Mn5H3JVgQPmvmh9vVWgvJNJGEzmBm8XXHB/qnlZ5lTl+W7jGtwNfMpK1WEd?= =?us-ascii?Q?5RlK4kha2gXYB+fQwiC1mP9U/F1VqU1GROs+uli0XBr43dBiBRh51PwvedvN?= =?us-ascii?Q?I4ZvdKcwUrL3Jfy4clnDhPoQtXGMmEt8OJbCEKA9e5Pu01c6HHhszd+OkHMP?= =?us-ascii?Q?6aqAvCWK9NDVc6sybK/+DiaFQegnUhpbaI18PWKU01Qfrkm828AD1TIzhx6G?= =?us-ascii?Q?NUi/f7E0sRRYy1391gCeyLwvwI+6ZMUWdWH3UyCgbXOQAKK4eMZDVuZaWG3c?= =?us-ascii?Q?802OxtWnLsY58qEShZxSlIgZBV59eLUfwH0xisjc6UMB/SyDWkPbdi3VkSD5?= =?us-ascii?Q?R9JX+xy66mnL4bp+jcSV9HxCvHL6uDymhSIqcrzq1gqveEC0Up4lvnKNsaXc?= =?us-ascii?Q?CmfjoNZOBh/BPUPE316DDpfgypfxWxqAA5QwA+biAY2P7LDNUXT+1PxQ1XVz?= =?us-ascii?Q?BaLQXPuICBoLr3JGI6UFKE8oFDEjrUlSwa6ToFE9GQnVgH6Fl0Ic6eL+hjLm?= =?us-ascii?Q?vm5S7Bhv0BpQRVzEGEKbGTIBBozujM7dOBDFax297eCUKgKaLto+7haX4JzO?= =?us-ascii?Q?S8XxvceQbPITW3rEJRx3VjV01Vo+OQPMxdVPcPjTku25ImgUo2ib40wbIV/T?= =?us-ascii?Q?wuLPzoNOIYTKuuGpAeLaue+1dnTc/u1okYfGRehLW6473HifutI0BiCLJ7g+?= =?us-ascii?Q?t6xjdIWikKQXaWLuRIZ0j3Q+612H7NNG1LVmfa6jA4r2+fLnl4TTEZpvKuzn?= =?us-ascii?Q?4U5Gr/Mfqzn8Zs2X7dVxM7g2EoZuEi19c09eb/6/RfidcnFyxU4hqFVs7bKy?= =?us-ascii?Q?eoZ47GUnD86Z0Bl8XejaV3dS9XwZmU0X+OxUsPBB5rUfZAcEWD2UQtC4vTat?= =?us-ascii?Q?SaHVAcQlbgdcZR5hM4UjKFTsDskPaXWbanw1FYjI+saVoLrCFzgfh68oTWP5?= =?us-ascii?Q?JYzy6FmXssD5IXs9CEiZF0VglN5twtTkHWrVDLx2rJc3Hl5K5cwajyCURfbH?= =?us-ascii?Q?EwmjmgW8DrbvAQIzWT0M/+j85uZPxt5ksniEVg1MdTBQxSG4HzAEJS755G5v?= =?us-ascii?Q?hrmmiwGWTDpaH7Ds07MxxnXvZmvQ9oDNjUuPB6tUJy6o8Vbte17ErV+wrzpy?= =?us-ascii?Q?Cs5kfWQ3uJs3oj1wnPXJD0QM0/uLxNb5Gp1OLV2uccDfVW6RAB45NtndkeJr?= =?us-ascii?Q?PE9esYlp8+uI7kawiXK0Gcs4J0auyTVZdISO5ZJgBKWIaaiX3zlf+dSFriAY?= =?us-ascii?Q?TQwqjGsQLCq5OqrYTLHRzEuwhzoMWDz8tQzGwqY7AhyFZZa4xnIeSkAxdmOK?= =?us-ascii?Q?KLSj4kecLqN5LcTDbVBOyAnDvYhtPreJZPUsUA1XbOou2z/iGzum0TucRVRY?= =?us-ascii?Q?Rrs2DDzJfX3qkp0KMzLEiTlClNPKngKwYaC3MIfJJJxduQAOIMrM4oq930d3?= =?us-ascii?Q?vhL9cY/zN4RssRZzvv7P/BBC7qU6HmY4ct8IIQ17XubZuXIFHgEAsuNJAoyL?= =?us-ascii?Q?Z3wSRymbVJn9cSGoJXUPohUx+WY8cTF2cTfW?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(36860700013)(1800799024)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jul 2025 21:22:25.0167 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 97697a27-6c58-4bd3-a77e-08ddc4aedbfc X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: MN1PEPF0000F0DE.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6284 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1752700975998116600 Content-Type: text/plain; charset="utf-8" The Control domain is denied access to an untargetable domain. However init-dom0less wants to read the xenstore event channel HVM param to determine if xenstore should be set up. This is a read operation, so it is not modifying the domain. Special case the HVMOP_get_param operation for is_control_domain(). It is done in xsm_hvm_param() because xsm_default_action() is too complicated. HVMOP_get_param should be allowed for a domain itself (XSM_TARGET) and its device model - src->target or is_dm_domain(). It should otherwise be denied for untargetable domains. xsm_default_action() doesn't have sufficient information to identify the particular operation, so put it in xsm_hvm_param(). Signed-off-by: Jason Andryuk --- It's messy, but I couldn't think of a better way. --- xen/include/xsm/dummy.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h index 4d7b1d61eb..896ebee631 100644 --- a/xen/include/xsm/dummy.h +++ b/xen/include/xsm/dummy.h @@ -621,7 +621,10 @@ static XSM_INLINE int cf_check xsm_hvm_param( XSM_DEFAULT_ARG struct domain *d, unsigned long op) { XSM_ASSERT_ACTION(XSM_TARGET); - return xsm_default_action(action, current->domain, d); + /* Special case to allow init-dom0less to read HVM params. */ + if ( op =3D=3D HVMOP_get_param && is_control_domain(current->domain) ) + return 0; + return xsm_default_action(XSM_TARGET, current->domain, d); } =20 static XSM_INLINE int cf_check xsm_hvm_param_altp2mhvm( --=20 2.50.0 From nobody Thu Oct 30 22:53:26 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1752700966; cv=pass; d=zohomail.com; s=zohoarc; b=SG1H4h/qWvYjD84NWHI5XX4OGYkwbelKwQ1UTRsZcDwfrowcR2yhuCKI8yE5IdfAHlA0muukQNTu9gNI81N4/fqTMA0FqhXz2dJa8kV5XeDrTTIDMkWlcfq9+oLqHJG5xzS39aJwKblkTqJdP9Jx2tUQqhYPcLjWoTRdJ8bDDcA= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752700966; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=4SrHYelHHxhnkv89jdaZ0HdwLgpuE+uqyfBIn9726pg=; b=BK/dULSs8Jl9qZNnG6eIBiOTkUIIBV2v49XVzeAUGGFDqU/bzJwT26aQOFauF8Nyd4JWZgw6QITJK6QJ5byhL48TH1+9sMXpSKXHyrVthAlcE+4Fl9cKXpZipaV48VrwlanHq656/s3wyG5Iq88ubzPv6AQZVvXwE7b5xr5G62k= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1752700966103693.3692388467293; Wed, 16 Jul 2025 14:22:46 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1045775.1415995 (Exim 4.92) (envelope-from ) id 1uc9aA-000864-DW; Wed, 16 Jul 2025 21:22:30 +0000 Received: by outflank-mailman (output) from mailman id 1045775.1415995; Wed, 16 Jul 2025 21:22:30 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uc9aA-00085l-9H; Wed, 16 Jul 2025 21:22:30 +0000 Received: by outflank-mailman (input) for mailman id 1045775; Wed, 16 Jul 2025 21:22:29 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uc9a8-0007F2-Ut for xen-devel@lists.xenproject.org; Wed, 16 Jul 2025 21:22:28 +0000 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on20619.outbound.protection.outlook.com [2a01:111:f403:2412::619]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id f8e5979c-628a-11f0-b894-0df219b8e170; Wed, 16 Jul 2025 23:22:27 +0200 (CEST) Received: from DM6PR03CA0100.namprd03.prod.outlook.com (2603:10b6:5:333::33) by SJ2PR12MB7799.namprd12.prod.outlook.com (2603:10b6:a03:4d3::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8901.35; Wed, 16 Jul 2025 21:22:23 +0000 Received: from DS3PEPF000099D6.namprd04.prod.outlook.com (2603:10b6:5:333:cafe::ca) by DM6PR03CA0100.outlook.office365.com (2603:10b6:5:333::33) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8943.20 via Frontend Transport; Wed, 16 Jul 2025 21:22:22 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by DS3PEPF000099D6.mail.protection.outlook.com (10.167.17.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8943.21 via Frontend Transport; Wed, 16 Jul 2025 21:22:22 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 16 Jul 2025 16:22:14 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 16 Jul 2025 16:22:14 -0500 Received: from fedora.mshome.net (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Wed, 16 Jul 2025 16:22:14 -0500 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: f8e5979c-628a-11f0-b894-0df219b8e170 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=iNs9usH/Uh7qv/Yibszq5TrIclWrkNysxQnxWmZMyxCrNx32c5L1yZRl6lPHajlOWFemXQDSc79Q2LXTxorHDh3ZT4ZWvXMAVSK6uSQsbWAZfpsLLcfg6YL7J9u5GtjfnGpoKpmCKPGxRpmXFFGKW867vgeoqw//Kzolm6cw/xB389/Ca6b66yUrbr+zg5yhqzmHZTbcP0XzJKyBD0xS0sQ4uYNLq1TSiCkDAAXkVBBgrlNU3IbgnG5J4l8iyAgX+rB9dDDci2sYwOtcjRgzIrWpvFygVSC2AMRtSvIoOOPj4LeGf/EVPnm4DMzxOwsq5f2A3a9S2T5svAHqhvwgBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=4SrHYelHHxhnkv89jdaZ0HdwLgpuE+uqyfBIn9726pg=; b=n5km9/UC3YiBoExl4+rPjeInhRW8pxRfjzETXCJWILqhVNQ+FcYqZSdMsDZa3+mJJEZDh19gRGXjnka+iKr6vYxryVk+J0ifx9LhVUQP9sxfnEQbgEzraQ4q+NsiV4nyFm6o3j8TH1n7qya2FQxRKxmlq7dHg+IbsFEmQKjdvRFJOvJyYb01x+K2at8qKScRHlM+MRuvLD1vdCY54bUHvV46I2Bi7oSkyYCWcEd6CbK02NE93ejo8IxIduKLgteGtk0dFQouORS0BT020+Ot8kKnevMGDWeiTkL8qr3NJRR7dGsmmFwDpoorPw8oB/sXkILbNXrHvIu2T42KUJlvFA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4SrHYelHHxhnkv89jdaZ0HdwLgpuE+uqyfBIn9726pg=; b=cCBF7BtSVCdkkLhlQMejX3rGksc1/611PWd6PPMeo8u2G7pQ7gny3IGqd9/urRh2gA79GHOj/TlEVX1s0z05xH6IRmRUY3eAjTM1FxevlYXjKVSah2pwjWxSmyDxLDC6xyaORv4jZU2lgwEGOQpqbPqA45eGJiEaQlNMAPYHaXI= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C From: Jason Andryuk To: CC: Jason Andryuk , Juergen Gross Subject: [PATCH v2 08/17] public/io: xs_wire: Include event channel in interface page Date: Wed, 16 Jul 2025 17:14:55 -0400 Message-ID: <20250716211504.291104-9-jason.andryuk@amd.com> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250716211504.291104-1-jason.andryuk@amd.com> References: <20250716211504.291104-1-jason.andryuk@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS3PEPF000099D6:EE_|SJ2PR12MB7799:EE_ X-MS-Office365-Filtering-Correlation-Id: 20695f3c-46a7-4cf6-a7f1-08ddc4aeda5e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|1800799024|82310400026|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?08U5bPQjMBvwOPSOyLXsnYptlanH7uFPdymRxUYLHFPXDl4ILh3uQ2TEOV5l?= =?us-ascii?Q?nlcNZpewXoMteUnvCI3QFKqvjWbzDSFyHncHOpokYCMppGmznb6g9PaSHiMy?= =?us-ascii?Q?sUzJMFs4jVV35d0DrQiZEX2hKtwlBqlHHryaFLuAoo4WW05aQ+l76QbYX4Wi?= =?us-ascii?Q?BDokoM6ez12JFnh1ZRjD2boydMgkyiwSdkGmPaKgW1AiBnRiUi0DFjk476FK?= =?us-ascii?Q?bm7nbhK3qXN84P+ByWagpiMQzxoZfDDs5hPzqyEmBxPOnU4iY5boBSlAjQmR?= =?us-ascii?Q?xNL932cpTxr3vYlTnGDzmsUVenDZWoEPan5USkx1shjtMry1Pr6+aUGT6gnk?= =?us-ascii?Q?y6sZ0KoSjn4zWlIq6nj3QQouCWHWp8MQj7w4kGkEUG/SnQA+MpSm8NHjO1pG?= =?us-ascii?Q?UgQFE+IfkavgryG2SYrpgffPWQUCu8+8awyKrrPB8ZB3lEb/4ZnS2srK0NBp?= =?us-ascii?Q?BwNMSfvDvBfgEHeyvYmh+NV4MghTR1j6tYDnMuvcPEcFcwkMHPIourvb7jPx?= =?us-ascii?Q?I1hP0fuKd5wGNnlXvcG+hZ/3GOLA2KlEFksERkAHVqZaSv5YFn0Wf5Z05tri?= =?us-ascii?Q?gBevEgsS6YaPRjGlITsBRpz4mZm89ZBC4VZq6aWZbBlFfl7SM+l+YogByhvb?= =?us-ascii?Q?9z1TWL84edUD4JXN6hQ+07gHC5yoxpkCRxBBK8Ul+pQxOb7zqNid7rjbpq1E?= =?us-ascii?Q?/jZcExDIKgWvKzP2CFxIteOLugYaFRAKm5F1Y+/z7kgeBcH1iqeSwjIG2MUK?= =?us-ascii?Q?DHl/WBNP6+mPfuvq3z4Ek/rwYHerob65YeT0buNkAI+PT7G3H6vog0l/X9oj?= =?us-ascii?Q?SSm9/pmriQcg54oLHrNyvjHU4HSHF8JbMsqOgwJPAHDy8SzqcH8rEz5X/Fjj?= =?us-ascii?Q?qT01nnttvVAGmQIkjZ5s3ViMBY1AfwZYH21pV2Ne1g2VYoYT20MgisL0F7FA?= =?us-ascii?Q?UDyfzT6JRq48DE9wtcNbhe4cM55wBpW1+/tnCymIq6TO0fd4Sy2ojjI9M4hR?= =?us-ascii?Q?cdVrZoLh0Zt0/RbaudiYTIOd+8x5pHF+kfd54brGjwvI01jJZLnBOZ2xxHV3?= =?us-ascii?Q?ibf3s/msglq7CgVtUK8ErhvXEuQxHaB4x9BWwO8xbGMQh8Ot5ZurppO3LuPK?= =?us-ascii?Q?4MzTQIiKASzbWZX5qlW4s7ilYZ7knK+ASxFLZZ3Hfwu98/h/fkaiqI8NlpYB?= =?us-ascii?Q?5ScYUUbAAURu4wJwOSY9CkMma3omZaHBvY9mjFIjLW56eptsfFLh0pvguHYM?= =?us-ascii?Q?uZK5KQO6QRPTOUdFDeNyFaE3Mj554r+X9S3JAOT/uc49UCnBRJaNKW5l9q8V?= =?us-ascii?Q?xSjI1DAY6ryh8W47oTK3RYah/0TECAXJgGw4+xSaEOpFF14hf0DhXe3xMjlb?= =?us-ascii?Q?aPuztJCebYQE01xBIbbB/IUHD34aWlU9Cep1Gi+ACPyD+h6zuLtxvkZsly/U?= =?us-ascii?Q?pC3h3PGnGkwKl3yDMCYwetm0QVFksc4fKaibSWoN0impVRBFzJHKDYWtbnGG?= =?us-ascii?Q?WAglGrDJNkOZrL98n8YEvU1N2+HL24RpY0gK?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(1800799024)(82310400026)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jul 2025 21:22:22.2562 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 20695f3c-46a7-4cf6-a7f1-08ddc4aeda5e X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DS3PEPF000099D6.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB7799 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1752700967830116600 Content-Type: text/plain; charset="utf-8" Include the event channel in struct xenstore_domain_interface. This way the toolstack or xen can communicate the event channel to xenstored in memory xenstored already needs to access. xenstored maps the grant with the well known GNTTAB_RESERVED_XENSTORE index, so no further information is needed. Suggested-by: Juergen Gross Signed-off-by: Jason Andryuk Reviewed-by: Juergen Gross --- xen/include/public/io/xs_wire.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/xen/include/public/io/xs_wire.h b/xen/include/public/io/xs_wir= e.h index e92a87a07b..f2c0afd107 100644 --- a/xen/include/public/io/xs_wire.h +++ b/xen/include/public/io/xs_wire.h @@ -110,6 +110,7 @@ struct xenstore_domain_interface { uint32_t server_features; /* Bitmap of features supported by the serve= r */ uint32_t connection; uint32_t error; + uint32_t evtchn_port; }; =20 /* Violating this is very bad. See docs/misc/xenstore.txt. */ @@ -134,6 +135,12 @@ struct xenstore_domain_interface { #define XENSTORE_ERROR_RINGIDX 2 /* Invalid ring index */ #define XENSTORE_ERROR_PROTO 3 /* Protocol violation (payload too long) = */ =20 +/* + * The evtchn_port field is the domU's event channel for xenstored to sign= al. + * It is filled in by Xen for dom0less/Hyperlaunch domains. It is only us= ed + * when non-zero. Otherwise the event channel from XS_INTRODUCE is used. + */ + #endif /* _XS_WIRE_H */ =20 /* --=20 2.50.0 From nobody Thu Oct 30 22:53:26 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1752701471; cv=pass; d=zohomail.com; s=zohoarc; b=F7/PSzQcIW+ZSQUy/fHzY49N/3GvyvmboxPIksbmbi2mRVacYqENJpsA05LDaA6V6ZpZjeNA9J9pvZLTqo6N0dTTAIWkAoMdDaxHzK7Vlohe4zZLwXY1NYt7isiVkAT7PFi6tbf5N7eYeXiawLusVOGSfhKb27tbSN4noniuhBU= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752701471; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=UqUuUD6LRJlMEqjXYvj5y9JTuUtDy9k4ZoeGLFnyuaY=; b=ixmVad6XQ5ACz2wyqMzonqnEoUAJVL5Oh96KPon7sMDEHQst6yibaXuBHE8DwK96euvcD3ZBWb9z5jNdgGk6Y9bbq+LPT0kLHm2cASrHQWDUelrQuNR6YAL7+CFynTP0fZdecJURLHFM46rd1uX1TLJWNMU+0aRSyyvHf/0hqTw= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1752701471729221.12557188195876; Wed, 16 Jul 2025 14:31:11 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1045841.1416144 (Exim 4.92) (envelope-from ) id 1uc9iI-00017z-7R; Wed, 16 Jul 2025 21:30:54 +0000 Received: by outflank-mailman (output) from mailman id 1045841.1416144; Wed, 16 Jul 2025 21:30:54 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uc9iI-00017s-40; Wed, 16 Jul 2025 21:30:54 +0000 Received: by outflank-mailman (input) for mailman id 1045841; Wed, 16 Jul 2025 21:30:53 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uc9aF-0007F7-UI for xen-devel@lists.xenproject.org; Wed, 16 Jul 2025 21:22:35 +0000 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on20631.outbound.protection.outlook.com [2a01:111:f403:2417::631]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id faed7667-628a-11f0-a319-13f23c93f187; Wed, 16 Jul 2025 23:22:31 +0200 (CEST) Received: from BN9PR03CA0795.namprd03.prod.outlook.com (2603:10b6:408:13f::20) by SJ0PR12MB7036.namprd12.prod.outlook.com (2603:10b6:a03:483::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8901.29; Wed, 16 Jul 2025 21:22:26 +0000 Received: from MN1PEPF0000F0DE.namprd04.prod.outlook.com (2603:10b6:408:13f:cafe::a9) by BN9PR03CA0795.outlook.office365.com (2603:10b6:408:13f::20) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8943.22 via Frontend Transport; Wed, 16 Jul 2025 21:22:25 +0000 Received: from SATLEXMB03.amd.com (165.204.84.17) by MN1PEPF0000F0DE.mail.protection.outlook.com (10.167.242.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8943.21 via Frontend Transport; Wed, 16 Jul 2025 21:22:25 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 16 Jul 2025 16:22:16 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 16 Jul 2025 16:22:16 -0500 Received: from fedora.mshome.net (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Wed, 16 Jul 2025 16:22:15 -0500 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: faed7667-628a-11f0-a319-13f23c93f187 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=AFhoBkVLS/GU+GhtiUnq10Ma9LaJdGrReYO3XjVMX6XBPTJR1odKsSbXjEpw83yDvcGqxHjp6U7lY23twdh3VNF4mpBkEJctaBxVvZBf5Q4ks7+2lQTexRXhqmyAlOCGCNG4RGOYFeiTNVvzRaQ5ipZ3hEiZRSPBnuLq0ky7qC0ocTfewPni0FTjAsa8b5/Ercu0j1JKMCcnipswLAftM0KxAWbVeV14jkR4/JiMw7edxt9/7DqUoZjidBbxE7+tiJ2m4PNt01bimaLMxH1mn+3lIVIung8VVcho9PRcfhXND/ToulArcderuSRSY51Zp4SiVWOmeVRKvNqvKBGo4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=UqUuUD6LRJlMEqjXYvj5y9JTuUtDy9k4ZoeGLFnyuaY=; b=gk+luiv5aCZMIEh1VVQ4BLFHHZ3IXoFm6tunP+hZPewpmzNl+4Q60RTOiTjp1/wc/jB1ci5u6/2GORKqu928JBakN3ZUv/EpIiflvh7Kuo7vhhELsLQfuCpTqumHMp4IADP+OqL/c3INJFA/+ht2WqMJvWRlqKmHNAB9a/NiGd2kemY0FoAWuM9kqFJfg9wI26ku+SAT/bZkw3RBvGcJ2fKY4YHU4XCY6bltlR5OMtCRNGAhzmSMfGgFP5DDuxroiLrN7JylpO+coflR6Q1KbOUvXHvh4M3y8QxKslkmy3fA0gGvlT5gGW1vczrvUUGfLEZ1uiMylntmAN9n2EyS9w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UqUuUD6LRJlMEqjXYvj5y9JTuUtDy9k4ZoeGLFnyuaY=; b=EKadWf9PO5ZjjumGtWFq/9y/6reHDpyYz3XgfopObCUct5lLnRH1Wi3ngL+3oRb5GdccFHsiR+wc0sa8Lbrz+MZhtfRIiNtx+6onjQR5tKIjwPXc1rt5wIc3iBnZUWAIHpLI8pYOPjuHkvvc0wlhGS3K40/o7KrdTOiI7Ev/KP8= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C From: Jason Andryuk To: CC: Jason Andryuk , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel Subject: [PATCH v2 09/17] xen/dom0less: store xenstore event channel in page Date: Wed, 16 Jul 2025 17:14:56 -0400 Message-ID: <20250716211504.291104-10-jason.andryuk@amd.com> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250716211504.291104-1-jason.andryuk@amd.com> References: <20250716211504.291104-1-jason.andryuk@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: None (SATLEXMB05.amd.com: jason.andryuk@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN1PEPF0000F0DE:EE_|SJ0PR12MB7036:EE_ X-MS-Office365-Filtering-Correlation-Id: 236d32ba-2c7f-499f-bbab-08ddc4aedc5e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?vHDQPZxEKZxuJGz6k9FRXENynvH/OSJXFsI8GWR/XqAulmxw2Dj9760115in?= =?us-ascii?Q?zaDJdIEs9+pY0HwUeQFht16uxbsDEP9jsM6+YbSyNQ3nkCamL5fPci3c15Vc?= =?us-ascii?Q?H9HRB4h4/VZt+OL86WGJu2Iq66SHiZkFamIwckTwcp7n5hfFlGfcOoATOtSf?= =?us-ascii?Q?7Kd5WXSd80HQj0wANmNzk3pP29/lKtlPYPQdU+Lc8vppI88AklZfew7Ip5VO?= =?us-ascii?Q?rLF2cMWhx7pAt8an9lyqNrQnqPd+5uwcVGMdyo+Au34SwaGkbXkA7ar69I6v?= =?us-ascii?Q?1d3YYJDNaAsjrfmjRowXIQ6MSvNtslErvh77/Q5fbkYPj5Jkt7uZEmQqOUW8?= =?us-ascii?Q?VpgkNDNxa3ipAZ/HACuSPfxsRE7a4RGUKmpIKj/Ob7LcV+kQlbwX2XE5N7cU?= =?us-ascii?Q?F/w1P4DHrFYCrF72+GcSJhizinRcdfpRhr3G16NzY9LEA5HWy6L/E0IwVoBY?= =?us-ascii?Q?+Q4NaGlTDKegQK2leTz4KJMOSV6UgVKY+6XTWvWDbFVWfXcyPnOmi1BDlD9h?= =?us-ascii?Q?q+Xd7YU/68iNlOhi64JM2DF4BvP0Efzv9/ffDWrfduDdh6S5TaxWot1uMoCr?= =?us-ascii?Q?bNYlv3ttwI6PgrXptgu8l/alLiwx2h7eHDZtibBeVTb/olXOCSiy4/UNPLZ6?= =?us-ascii?Q?MG73R0j/zHA3ttLySjluSut5wXMjDymcXceclQDxtocHbBebV753jLhIZ/Yg?= =?us-ascii?Q?CX4ks7O9H7p1Fk5F0VHJVYRqoWMXKc2dD4fH5sxD7rDU7JFwjXC973zhyWTz?= =?us-ascii?Q?C8HaoNe1RcE5UT28CyEBiz6coEJ2GBfbR75X97NtoYciF4loyK1DK49x+ghn?= =?us-ascii?Q?oaUoP8ScJ14jernrZi8i96v+Uc2VYw8He4UcpU48y8CVjYopNBzG3G448XoC?= =?us-ascii?Q?DuUHaP/oOsB9sKerM8fjGNja8i6qGowu1wPQnA2TaqZA8L8EJbSVw4PlpB0T?= =?us-ascii?Q?RJFD81CoxXzTETHrMmJu+WE7necUoW4aruVv3NeBYLlScY34L9+F5LK/4WIN?= =?us-ascii?Q?R6RWljMJyf0Uv8R3QZ/hDxI9UAxyGHVGkn8k4t2zIj/YwTGyQ5UtdlHPeyHv?= =?us-ascii?Q?xTUa6d7fEAB/OYc25DDJRY8tYoYZMyxQe+Eu/l9KTepXTHcrW5/ClCDtDcbb?= =?us-ascii?Q?RFNCFDGwGL7x2gHh5eFAIGGG4TJLhItNpjNMqBBMsZ6SDOPMx00om+8KiXCP?= =?us-ascii?Q?/lMD0frJnLh5T75tijQclI0PR94IPSnAmOhTtUfFfBFI89tADNmhmQZPoCxg?= =?us-ascii?Q?CXfuf6zb1ALsaFAXQSECmBU1tVDXnAzbG+P/k4HUYT5MSkgBN5PsKZ5kcwge?= =?us-ascii?Q?RrKilo0kaq6XuzTOWz/OCy+8aZUhkWFDrCnbfdbh5+8u2jC1dpn88fGn96y+?= =?us-ascii?Q?InpV+BRcCF8Ll4eKhmwNQbq3j0kORMCUVZLSKkmyZkN5tpuSSoK7IiIhLrv1?= =?us-ascii?Q?hW03QJtKlEVXW8jwNnj78UVxczEnIYlb7eqUNQJ/HrWpYcYIdV3E3IFt3D3R?= =?us-ascii?Q?iMAbOMV7mgJwe4ct1SbJSr0r1YGIvobeLYeH?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(376014)(36860700013)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jul 2025 21:22:25.6599 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 236d32ba-2c7f-499f-bbab-08ddc4aedc5e X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: MN1PEPF0000F0DE.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB7036 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1752701473748116600 Content-Type: text/plain; charset="utf-8" Write the associated event channel into the xenstore page so xenstored can read it. xenstored can map the grant by the reserved grant table entry, and then read out the event channel and bind it. This eliminates the need for an additional mechanism to discover the event channel. Signed-off-by: Jason Andryuk --- xen/common/device-tree/dom0less-build.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/xen/common/device-tree/dom0less-build.c b/xen/common/device-tr= ee/dom0less-build.c index a2789e3bdf..284139bf14 100644 --- a/xen/common/device-tree/dom0less-build.c +++ b/xen/common/device-tree/dom0less-build.c @@ -26,6 +26,7 @@ #include =20 #include +#include #include =20 #include @@ -126,8 +127,14 @@ static void __init initialize_domU_xenstore(void) =20 if ( gfn !=3D XENSTORE_PFN_LATE_ALLOC && IS_ENABLED(CONFIG_GRANT_T= ABLE) ) { + evtchn_port_t port =3D d->arch.hvm.params[HVM_PARAM_STORE_EVTC= HN]; + paddr_t evtchn_gaddr =3D gfn_to_gaddr(_gfn(gfn)) + + offsetof(struct xenstore_domain_interface, evtchn_port); + ASSERT(gfn < UINT32_MAX); gnttab_seed_entry(d, GNTTAB_RESERVED_XENSTORE, xs_domid, gfn); + access_guest_memory_by_gpa(d, evtchn_gaddr, &port, sizeof(port= ), + true /* is_write */); } } } --=20 2.50.0 From nobody Thu Oct 30 22:53:26 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1752700976; cv=pass; d=zohomail.com; s=zohoarc; b=IBDzagjhqAwgpq3w3YlD2dBGCuuEJevddVmrhFdQbAbmYBmjYivbBYx5uiZZd7XyG+zmHTWgenIpj1eRieS6X2dwn/cS0Y7FhC5wwb5OC0u2hHw0MQLJ4M3Uaun4rQUnuu1YVlOLQ9k5k/eThjv2zcA61zmx7DmT38pYPNm6PAY= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752700976; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=SihKPN69NGNjyt8htAUPBNJrQwfMQFZ0+BHxqWgh8vk=; b=fn94UwwlYzdeHPYnidJc3SWW1SPLTvSail11G+etG8bbowU+D1NLXaIkxEWSXtDMo+sXvfotmMbsPa29SgRrJYXtt1g5BnyB8x91aif0DLig8U7xDwKy5jUoBNetiaGGm/Mlob9fF1WMWl3rEeAIrBBgVX/LdfRFzZu4u558UdU= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 17527009766911008.858858429499; Wed, 16 Jul 2025 14:22:56 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1045789.1416092 (Exim 4.92) (envelope-from ) id 1uc9aL-000297-3s; Wed, 16 Jul 2025 21:22:41 +0000 Received: by outflank-mailman (output) from mailman id 1045789.1416092; Wed, 16 Jul 2025 21:22:40 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uc9aK-00021F-BM; Wed, 16 Jul 2025 21:22:40 +0000 Received: by outflank-mailman (input) for mailman id 1045789; Wed, 16 Jul 2025 21:22:36 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uc9aF-0007F2-VI for xen-devel@lists.xenproject.org; Wed, 16 Jul 2025 21:22:35 +0000 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2062d.outbound.protection.outlook.com [2a01:111:f403:2413::62d]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id fac4ed30-628a-11f0-b894-0df219b8e170; Wed, 16 Jul 2025 23:22:31 +0200 (CEST) Received: from BL1PR13CA0328.namprd13.prod.outlook.com (2603:10b6:208:2c1::33) by DS0PR12MB7899.namprd12.prod.outlook.com (2603:10b6:8:149::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8901.35; Wed, 16 Jul 2025 21:22:26 +0000 Received: from MN1PEPF0000F0E1.namprd04.prod.outlook.com (2603:10b6:208:2c1:cafe::fb) by BL1PR13CA0328.outlook.office365.com (2603:10b6:208:2c1::33) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8943.19 via Frontend Transport; Wed, 16 Jul 2025 21:22:26 +0000 Received: from SATLEXMB03.amd.com (165.204.84.17) by MN1PEPF0000F0E1.mail.protection.outlook.com (10.167.242.39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8943.21 via Frontend Transport; Wed, 16 Jul 2025 21:22:25 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 16 Jul 2025 16:22:17 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 16 Jul 2025 16:22:17 -0500 Received: from fedora.mshome.net (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Wed, 16 Jul 2025 16:22:17 -0500 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: fac4ed30-628a-11f0-b894-0df219b8e170 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=VXzi0RU3GeC8oU94E6Fhh5buKidh996E4/65hK0fGYdJIJl3ReM+2reMpRS+3Moa8aPpXf3jQQFK6h6uczlm84EewrZhXoywoV+aHOgj27T4FRI4tvwtDNFulbWM6Xbn/O4OuIAN+g8xIN0z9rCG8bByL9rJcbyqS3Gof478EkJQoG1gTcIuhLJSkZHNOdvhncQJaysURAWtM+Yl0QlGKDQh5H6LuMVf+Noj41ywSuum13uk1fkqDC3+BuSLVJ2AVfsDMQ+5nxv9voX/bkzAWKV6l0/bv9wUqi9z/8SmDOKG2TTqlEuNb1CQw1LYmzzdA/loXjAp34rUjBA93v7inQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=SihKPN69NGNjyt8htAUPBNJrQwfMQFZ0+BHxqWgh8vk=; b=Ob9zSMsFK64xjgv+CHr2aQdW1EWmczVb5ALOeAHntW1pe6RSiEqYxhHhGSgkIft6H/avDlmKUouR/ylHSWX21NIeH1yp/RmQh8+3WnhSJIafA4Ux0wu1f3TBpKhti41E8cOhfWYC0/RYhYBkI3RJ1EU7brSLHmLHSHWr+2cFv7FRbnLfjz1a+nqf/lYBvgdw5gIpqt68IFrsrv3ToWr3u9nn1FDjlo3gklBTXic3Xc8jMt/IHvRtA8QFUqHNrVWz+YcsleObVBJtsR0vB9OIyNm2RHLP17uz+8VfQ9vLTlZ+usDQxwKEZDDNcW3PtE1rZSLmh2lDQ09SttvTQ9sh+Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SihKPN69NGNjyt8htAUPBNJrQwfMQFZ0+BHxqWgh8vk=; b=q5U3Hngb44SdvMy5mOtozerX3gr+eWY58SLDDeNn1HS7KnhCJR4vFJPQWIlA2kJ0L+lT8kplo7gCx9po7WGsgW6afDaOvADhEl+DK9hISBgr+uc8INIK1ETEQS0nfWbqt7mbIVOvxRffG6+Nv6dfZd3RhoSd3uUA0ufZuQvAKFg= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C From: Jason Andryuk To: CC: Jason Andryuk , Juergen Gross , Julien Grall , Anthony PERARD Subject: [PATCH v2 10/17] tools/xenstored: Read event channel from xenstored page Date: Wed, 16 Jul 2025 17:14:57 -0400 Message-ID: <20250716211504.291104-11-jason.andryuk@amd.com> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250716211504.291104-1-jason.andryuk@amd.com> References: <20250716211504.291104-1-jason.andryuk@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN1PEPF0000F0E1:EE_|DS0PR12MB7899:EE_ X-MS-Office365-Filtering-Correlation-Id: d7c78432-57a8-4ba9-4f50-08ddc4aedc61 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|36860700013|1800799024|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?NUlKRk43zns5X9i6WlDXDZJojlBHmBeewlm5TInmv654shVyOHBSE3/iio4E?= =?us-ascii?Q?0owD9IUcxwQ3cILfJuA639C4itHej5a59Ju+rqrDlKWwXVcJbcXuYDASQaZZ?= =?us-ascii?Q?q0uGaCuF3sQ1fm+801wpUte4oJ3jxObynf+HYY79v8JyzN+PehVgjkWCD7GM?= =?us-ascii?Q?hfTTfolwwlrHmvTK+1+dau/p7HLMYy9mBeQw4OTwQag13dvU/wQoCQ4vraW4?= =?us-ascii?Q?/ObyaXWobXBLxdlObCLCPnde+Ma/GprQc7PK4bjwEV+UQVJIsRESO4CFnjO0?= =?us-ascii?Q?nNHm+yJDnTWjznJNfRs7UduJtZDEpe5VckY1Ch3MDUOZX48fHy8oHIgd1gij?= =?us-ascii?Q?WDWl5GAsbics45whwCb1Gl+8bhBafaDMpHKpXYRwdFNSgGJQAc3//NsKdepS?= =?us-ascii?Q?EhObek1Gb8LnSh+5+dhcZ7szbU0QQq5RuUHsgbJ4WvBXELy/3NNtTgPFquWK?= =?us-ascii?Q?N9N2j5DEpbrwOxasB+gOxkgIZyW94eRqQfJVFiWcWd8E0LkplleKoBvOyZUN?= =?us-ascii?Q?drDDRrAc2XJyiTiokyFcnOawWxV+8pKffBEvj350VNO2bqizJnTOhH6/pvj/?= =?us-ascii?Q?FPhFd42Xmrkyl4I9piURnls+38emnQyatAslik7i5orW7cHvk8rQYBzq+VOa?= =?us-ascii?Q?efdHn8Zt8ykeXQ9nC2nhbCVpK6KWRwLoSPbGB0fQnf0Llsx2JznVT8U0yf9q?= =?us-ascii?Q?BtwwridD6bsnHA2uCQNqEsUInwylx4fWjGAuKSGUMWFL451Bh5GoYaZJoXJT?= =?us-ascii?Q?ZVyltQ5eSSc0dLlz7Y0q3uxm4rX4Fp+6dWqCULmXZ37Zp+1xWRx31787orab?= =?us-ascii?Q?5gyS62l7SBkA5IaXMKZugXy8mERltkUAKCYCjFh6cV8B4tfSdKO54gUHeojR?= =?us-ascii?Q?1fntXE72aPjR8oqdGSjw2F/gVpHpG73H/6dpFP9dZXUSHHC2ZRDKhiB7gshS?= =?us-ascii?Q?sx+DpaWQIw+tb/6FtU/HFJmT7n9PnAUyWoQEx3il13/aUapJsh4lvCElPPFV?= =?us-ascii?Q?B5Pw9fstNq9JztAqPeIt4Y/cX3dVxhyABX+NyNI1ZdyU9Nv4smoclJdnaZSQ?= =?us-ascii?Q?mkEQAwLv1AUa877O6x5vabu74Mg45iPdzpWrtknrJvFTrHHv7LmEcQzVXLvr?= =?us-ascii?Q?NmH2hy5z5bJbhO1iootGZ3wb2W5uOznJ39LOVuRdMTShzr1S8Sl7g2e94mfp?= =?us-ascii?Q?v4AE1I032xN8za++anSOfKPLyYRp6PPH8zAGhkOcAfHuSZ0VKPjKc1tZJC3N?= =?us-ascii?Q?2+MPkGxk39QnC2lWY8enx5evf4h3IfRLIswh8EQM29IFrZLHWRn8kywNUWWe?= =?us-ascii?Q?2lZuKAIJAQaneSLtRLoNe6tytpQvEaUJF5JsrRva0Oyf+0u3a/zSKHYCNKSX?= =?us-ascii?Q?yYDgWMYOdh6AZziO18LUTcVxM+0P9TA+mLksh1AKnchO2CXHMO5+9AhyCdN0?= =?us-ascii?Q?YYLXAGI9dXd+wZ7mpZ5LrnDg57XBedc40/HpJ0yvh6RSg60/TG3/XNUNBnS6?= =?us-ascii?Q?6DOEWrdJHSP+XWUaL4MgmK1IzPGal3fbbyk7?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(36860700013)(1800799024)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jul 2025 21:22:25.6757 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d7c78432-57a8-4ba9-4f50-08ddc4aedc61 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: MN1PEPF0000F0E1.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB7899 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1752700977986116600 Content-Type: text/plain; charset="utf-8" Make introduce_domain() use an event channel from the the xenstore page. It is only used if non-zero. Otherwise the passed in event channel port is used. The is useful for a xenstored stubdom to configure domains autonomously. Signed-off-by: Jason Andryuk --- tools/xenstored/domain.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/xenstored/domain.c b/tools/xenstored/domain.c index e1d5e8d614..94b2a1eaa7 100644 --- a/tools/xenstored/domain.c +++ b/tools/xenstored/domain.c @@ -1021,9 +1021,15 @@ static struct domain *introduce_domain(const void *c= tx, return NULL; =20 if (!domain->introduced) { + evtchn_port_t iface_port; interface =3D map_interface(domid); if (!interface && !restore) return NULL; + + iface_port =3D interface->evtchn_port; + if (iface_port) + port =3D iface_port; + if (new_domain(domain, port, restore)) { rc =3D errno; if (interface) --=20 2.50.0 From nobody Thu Oct 30 22:53:26 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1752700980; cv=pass; d=zohomail.com; s=zohoarc; b=mbjIeFBviQMYU4IZm6n6dL0WIfiOAM350crP0f2490VKrnylO/uflJN3mukX21iMVTYNGNgI/PKQH1RNbrnG5bSF/dWAMeUhY62ZsErLoKPU0UicsUXCF7I+zESIdpSfJ2tA7RWbcliSm7edlaTNjBV7r8rYbV3BT8xOpYkEUBA= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752700980; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=TXtpVXAytLx8JwHV5FurFJ6G8JTrFaKMclbVblfR9J4=; b=J+P1enGatMfBNjSv+qssZfiQh5Hh3AiIaW86dha0aw4V545MiASfiDaoMAGb1J4vrptLO6M/ZVczmURiq5FbGE/uev7JH2kpoEHFU16mcKsjbA59yRIBnPkw4ZV5mPjY5vprzSWJ31ljso4D0RJ0B4fOVHbF2hOhvpkiD3OQAeA= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1752700980463183.4999828275378; Wed, 16 Jul 2025 14:23:00 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1045785.1416070 (Exim 4.92) (envelope-from ) id 1uc9aI-0001Ya-HQ; Wed, 16 Jul 2025 21:22:38 +0000 Received: by outflank-mailman (output) from mailman id 1045785.1416070; Wed, 16 Jul 2025 21:22:38 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uc9aH-0001Tw-OW; Wed, 16 Jul 2025 21:22:37 +0000 Received: by outflank-mailman (input) for mailman id 1045785; Wed, 16 Jul 2025 21:22:34 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uc9aD-0007F7-Tq for xen-devel@lists.xenproject.org; Wed, 16 Jul 2025 21:22:33 +0000 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on20618.outbound.protection.outlook.com [2a01:111:f403:2405::618]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id fa4b727b-628a-11f0-a319-13f23c93f187; Wed, 16 Jul 2025 23:22:30 +0200 (CEST) Received: from DM6PR07CA0101.namprd07.prod.outlook.com (2603:10b6:5:337::34) by IA0PR12MB9047.namprd12.prod.outlook.com (2603:10b6:208:402::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8922.33; Wed, 16 Jul 2025 21:22:25 +0000 Received: from DS3PEPF000099D8.namprd04.prod.outlook.com (2603:10b6:5:337:cafe::b3) by DM6PR07CA0101.outlook.office365.com (2603:10b6:5:337::34) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8943.20 via Frontend Transport; Wed, 16 Jul 2025 21:22:24 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by DS3PEPF000099D8.mail.protection.outlook.com (10.167.17.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8943.21 via Frontend Transport; Wed, 16 Jul 2025 21:22:24 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 16 Jul 2025 16:22:19 -0500 Received: from fedora.mshome.net (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Wed, 16 Jul 2025 16:22:18 -0500 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: fa4b727b-628a-11f0-a319-13f23c93f187 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=is3S6P/bC8kRH0yAFaEmbqu9z09yckOIRo4e0MQfkuQHPgF6a5KMtSm4U/1mGjAkzczSaX+TqmrQiGENqSdGxTnGlcl+auJC/TDVZXCXR1MhbDbJ1/BBjiqbm6wmqVqHfKK8yvdLXMWNbS+tvKMVMsq8Uy6FGHcwW+jqJXVwSCzd9x1USYQ/LoHXmZOnzSJEzY7MJHPr9+ikGyuv2IAh/hQsgIFOMPWfmP0JO7ZaIuDaTKP4iHZtkHMdcSmzRMXn2tjsY9e3upKQ0e/tVAZBzZghBuCDgqfqtJAavuwCQ9rrN1+Q+pTufzBaJ6FxV4xhM3WVKZnCtbKQm2nawc/46Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=TXtpVXAytLx8JwHV5FurFJ6G8JTrFaKMclbVblfR9J4=; b=Zu/Es54DIwW+yxyuo1ZNQRE2rFh/OjYpWngK/DRjrd8x09YA7mganBNLq8S6oeu8L51dE7Y/DdwKBeKOipNSSxbf8wfhdx+W41UCx91B/5YhfyajI8nLF3lDdLFk0ODHxr4hZTsf4z4MNDjv30Mm4V9EHbWbqV2l40oulI45eFzV4g0P4IGxvdj2BlbkS5dBQL40KY1JkAheRPKqOR+6p5f2mrSVWExtP5d/yVcAD4TPTdCsFoWQsLNHDCKsfdPDCl9oQLSfig/G+BJlTgSI87RumJxAftOD3SuG2ZBqnWM1M1emxu4tedqTQjUjffE/cNi9vNC/6/9tXGUr4LQb4A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TXtpVXAytLx8JwHV5FurFJ6G8JTrFaKMclbVblfR9J4=; b=F/qy9YyiB7HcSaDyIxoGGrN+aQC7FWLN5NU5qM99+cJYqDu/od3rV9yZzOFatp7FyJK8CZUXP4wPVfC1uEzzS/XIwPYkCqFSs/ePJJUzxhST6nPx2I0ocS5JYjeAOU92guAGmo/DRs+Dn8NNWWODVx3jvmb3IMmZ4hImXBvk4dk= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C From: Jason Andryuk To: CC: Jason Andryuk , Andrew Cooper , Anthony PERARD , Michal Orzel , Jan Beulich , "Julien Grall" , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Stefano Stabellini Subject: [PATCH v2 11/17] xen: Add capabilities to get_domain_state Date: Wed, 16 Jul 2025 17:14:58 -0400 Message-ID: <20250716211504.291104-12-jason.andryuk@amd.com> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250716211504.291104-1-jason.andryuk@amd.com> References: <20250716211504.291104-1-jason.andryuk@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: None (SATLEXMB04.amd.com: jason.andryuk@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS3PEPF000099D8:EE_|IA0PR12MB9047:EE_ X-MS-Office365-Filtering-Correlation-Id: 54f33946-0cab-4f1e-ed74-08ddc4aedba4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|1800799024|36860700013|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?xVDddR4KLzFR7je5+RmSi4D8N5Ne1zywZV9bs6VMFz8aLL/7g2CzU0dE6pu4?= =?us-ascii?Q?QSy/7GSj8jEl2Q3ozUoz4fr2qEGBSDdrNxxwd6urh2ti6Lv1VUinEHgTYhCI?= =?us-ascii?Q?mr7+qjTdU+lYEr58lYr1HyDA2kd3ANC/hd+3mgCSO9AAw46rYHTLWGU1CK2l?= =?us-ascii?Q?YJs9vvXQtuupmcMalwAK5gy4fvOKRw/9P/+lKBp4M9Y7uV7loTeKa3e5I5G1?= =?us-ascii?Q?MMfo8cWjBW0hc+4W3O6YsBC3sqh/urlGaAElarZJWCVjDmP1cSQM3bw2+ViM?= =?us-ascii?Q?L5oakJ93FBaFfBKuY77guMdsEYjY6a3I/se56MAmQfCdOJCbL8IexrDco9Yg?= =?us-ascii?Q?WbUqy4djU/5jOhp8hSOVniSaH4F0xelI3WRkyolRln43ijl2VoZgcTBgoMeZ?= =?us-ascii?Q?3ru9gkJkMSpY0QB9tFyN+lAtltg2RJQ8WCFkkPOBLzVUrNHmjry06McSnBp1?= =?us-ascii?Q?gnJH0ohMVIQjftL6z7BeZ49Er/cg2Zn4KHr06VC28wVzWkOCve1R0Yg8mWFK?= =?us-ascii?Q?PdrsjFxJAl1qLkmxKH4rxQ+Dj4h5RlNahs2ILb0XFg0uj6dHwG5qy6cyOAEw?= =?us-ascii?Q?olLQQb1fYxOTIfdMeC84RJScYVWMBi0QfncXdgiNT7uJLYsw4saFy3sf0z91?= =?us-ascii?Q?o6caKj8sAUVQr0qOcKyyyA5O1SEbGeo+2g1ZoMgfqvMgB0ZNsghK/s0aA+nT?= =?us-ascii?Q?z/BGzroxgLd+MCwItMPgG2BmcGCObyK/a5BH2+Ea5wksE3L7VbvXUxDLg/vI?= =?us-ascii?Q?QvhtXTkvkgtltPmFZJeQbNgUWnvpytufbue+/M5YWwfT4LQf+0pOfNcs1L/T?= =?us-ascii?Q?cQavq0BYLyIHsD2hzamcKlgoSQ5ZfHO18YYiilYviodXYzp2vpL0qKlA2aTC?= =?us-ascii?Q?1Gz5pt9zEZeyHTlhbs5XHFly8pTqVu97OHiehQAmu4z9WzpEHOXmEBVxPMXo?= =?us-ascii?Q?MIVhMsqVjiZZ6xGBaTJscVR1DcmJBy2Er74iOipOZHZ/74T+ztn///Tjnbtf?= =?us-ascii?Q?dQ312bU4UetdEDUMd+8qzYAjVWqahzz20qJwfO0TgByTq1ZvZhIiX08W7X87?= =?us-ascii?Q?ZaXcpJbXOOEFGhfX3llR9+mEq2ozhHgCZ/l0eUPWBQFYVaidOAcKqlueSCGI?= =?us-ascii?Q?mx7CrdKlRy9qPYxZlvDMkIcooNk3pRSzdEgOq/nOl8EZutSsAPSXqQXLpZlc?= =?us-ascii?Q?5w3BQq8ZBWuCqpHWD2y8mgUCfH5TqDwYFnYg/+Xrm9HB1rkZKLEaP3mRcR9/?= =?us-ascii?Q?mwHM726xbdCX+5wvt0JBA2/RWqqjbCeI5WU5BHG9snT/865AtJsEtDFhQHBG?= =?us-ascii?Q?2U81GosGLYHzYaJbSNzv27YUVTzkyB8REwGbPOmzznRhfa16d19dtH3qi6XL?= =?us-ascii?Q?FFb22kKm0DjasR1LewQ9BD3klF5r690sVHmozbUq6tzLAc6Fh3wk0pIMxkuR?= =?us-ascii?Q?5suJmliqjHsQF4Fc2yrBdTpy8+grjmi3nTk+vvA220e11k6PD+GaoxFlES7s?= =?us-ascii?Q?pVPWY0eiPcXOpy1G08VmnduU4M9hiLodD995?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(1800799024)(36860700013)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jul 2025 21:22:24.3982 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 54f33946-0cab-4f1e-ed74-08ddc4aedba4 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DS3PEPF000099D8.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB9047 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1752700982024116600 Content-Type: text/plain; charset="utf-8" Expose a domain's capabilities - control, hardware or xenstore - through stable get domain state hypercall. The xenstore domain can use this information to assign appropriate permissions on connections. Repurpose the 16bit pad field for this purpose. Signed-off-by: Jason Andryuk Reviewed-by: Juergen Gross --- xen/common/domain.c | 8 +++++++- xen/include/public/domctl.h | 7 +++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/xen/common/domain.c b/xen/common/domain.c index c347de4335..8b0151a8f7 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -195,6 +195,12 @@ static void set_domain_state_info(struct xen_domctl_ge= t_domain_state *info, info->state |=3D XEN_DOMCTL_GETDOMSTATE_STATE_DYING; if ( d->is_dying =3D=3D DOMDYING_dead ) info->state |=3D XEN_DOMCTL_GETDOMSTATE_STATE_DEAD; + if ( is_control_domain(d) ) + info->caps |=3D XEN_DOMCTL_GETDOMSTATE_CAP_CONTROL; + if ( is_hardware_domain(d) ) + info->caps |=3D XEN_DOMCTL_GETDOMSTATE_CAP_HARDWARE; + if ( is_xenstore_domain(d) ) + info->caps |=3D XEN_DOMCTL_GETDOMSTATE_CAP_XENSTORE; info->unique_id =3D d->unique_id; } =20 @@ -205,7 +211,7 @@ int get_domain_state(struct xen_domctl_get_domain_state= *info, struct domain *d, int rc =3D -ENOENT; struct domain *hdl; =20 - if ( info->pad0 || info->pad1 ) + if ( info->pad0 ) return -EINVAL; =20 if ( d ) diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h index f1f6f96bc2..879343b21d 100644 --- a/xen/include/public/domctl.h +++ b/xen/include/public/domctl.h @@ -1269,8 +1269,11 @@ struct xen_domctl_get_domain_state { #define XEN_DOMCTL_GETDOMSTATE_STATE_SHUTDOWN 0x0002 /* Shutdown finishe= d. */ #define XEN_DOMCTL_GETDOMSTATE_STATE_DYING 0x0004 /* Domain dying. */ #define XEN_DOMCTL_GETDOMSTATE_STATE_DEAD 0x0008 /* Domain dead. */ - uint16_t pad0; /* Must be 0 on input, returned as 0. */ - uint32_t pad1; /* Must be 0 on input, returned as 0. */ + uint16_t caps; /* Must be 0 on input, returned as 0. */ +#define XEN_DOMCTL_GETDOMSTATE_CAP_CONTROL 0x0001 /* Control domain. = */ +#define XEN_DOMCTL_GETDOMSTATE_CAP_HARDWARE 0x0002 /* Hardware domain.= */ +#define XEN_DOMCTL_GETDOMSTATE_CAP_XENSTORE 0x0004 /* Xenstore domain.= */ + uint32_t pad0; /* Must be 0 on input, returned as 0. */ uint64_t unique_id; /* Unique domain identifier. */ }; =20 --=20 2.50.0 From nobody Thu Oct 30 22:53:26 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1752700973; cv=pass; d=zohomail.com; s=zohoarc; b=jThdUbZljhnzLhIjOVjwqG0dmSXB7kB7b5W6raEGUGFa8qhZ24wtJz2rgVPjkBYfwKHv7vDXUNeXv9aOW8Ru+epjNa7FU0ahd+cjKebkN4pOW/L3cATEtFgjMluSQYMrF8GFyWpzqLiDVuwr0RJmvXl9mBDvDorw5a0CtozSLJU= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752700973; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=QsiFTii6WnW1lgN0+xgzujQyv5+/+TSNTj97FMWM9SQ=; b=c/GrcETgDSUdD82b/t+/kEa6Wz9rXbTMRbAHryhoVnq9ArjYrIiLAQxQj8SVeDlffFwl8OqK9gA5/64XEc3sfZOdhKNEBGNx08zM/OLn7eAlr2+o4Lo+hl8BGGKCWdMbi6+nTst42WsIfwX4OoSRpgQ/7V3AjcpWfqMZGMo6180= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1752700973024499.5872995758757; Wed, 16 Jul 2025 14:22:53 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1045784.1416057 (Exim 4.92) (envelope-from ) id 1uc9aG-00011d-BD; Wed, 16 Jul 2025 21:22:36 +0000 Received: by outflank-mailman (output) from mailman id 1045784.1416057; Wed, 16 Jul 2025 21:22:36 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uc9aF-0000zC-Lj; Wed, 16 Jul 2025 21:22:35 +0000 Received: by outflank-mailman (input) for mailman id 1045784; Wed, 16 Jul 2025 21:22:33 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uc9aC-0007F2-VA for xen-devel@lists.xenproject.org; Wed, 16 Jul 2025 21:22:33 +0000 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on20620.outbound.protection.outlook.com [2a01:111:f403:2009::620]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id fa399488-628a-11f0-b894-0df219b8e170; Wed, 16 Jul 2025 23:22:30 +0200 (CEST) Received: from CH2PR10CA0008.namprd10.prod.outlook.com (2603:10b6:610:4c::18) by IA1PR12MB6387.namprd12.prod.outlook.com (2603:10b6:208:389::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8922.33; Wed, 16 Jul 2025 21:22:25 +0000 Received: from DS3PEPF000099D9.namprd04.prod.outlook.com (2603:10b6:610:4c:cafe::ca) by CH2PR10CA0008.outlook.office365.com (2603:10b6:610:4c::18) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8943.20 via Frontend Transport; Wed, 16 Jul 2025 21:22:24 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by DS3PEPF000099D9.mail.protection.outlook.com (10.167.17.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8943.21 via Frontend Transport; Wed, 16 Jul 2025 21:22:24 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 16 Jul 2025 16:22:20 -0500 Received: from fedora.mshome.net (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Wed, 16 Jul 2025 16:22:19 -0500 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: fa399488-628a-11f0-b894-0df219b8e170 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=D+gIJMegVvA3LdlItvvNHPiaiI7f8ClRXtZr5AFVRfnf7Ibz8/OaYGmD7J6L4a0GH27/sPhOa6Uj9qE90fHMmtB5RIziB9sQ0MWlwwSs4tswNWXa8xvaP79bk65lC+xkppKixXphCHXsErs/OjNr0DejwsDwJiJoTL+wuZsBPP0F/8C2TrJ9sElGOKIuKHhqcchzk9KLx4TcOY6UUrdMnhdlcDQLV/ioeVY9HztstaM9NtAw8GmQteHqX3DlSDekMFulGZOgi+5haVJpagIKjeEv5saebYgh17ZWTVv9X3uCZFi++dieGFLqokQy5Bu5MY0HhzA7Pn+XoP+cW8PpKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=QsiFTii6WnW1lgN0+xgzujQyv5+/+TSNTj97FMWM9SQ=; b=DiBMSgDzJ+9Ed35SR2eUx+9qxvApPVAXEv9qiT+da2iTfbLnEggPF7eh9PG47F9QbwS400zgdZ/kXxHICVSPxhAPfx9tUFiLPqgEBxmQVa1dJqmGLE+waSsUpHpy2Kdd/ReYVkpy8S58+R0F/ui7Kp0Lah/kd4+itxh9D0p2UnDNhaoPdMMxYxXL7ZpOuoq1odUYnMghMtykvU8YyapIgacDWhEmVxExFrlGD3rfBvgkg+x7Apcyj+j8WqNBgHvNjDB/L3RyHpWZdhOM3zf23qkZ5muPQqVqb6tdLyCIMNeyjxhwsGcw/BiQ0TQAWT0W/o6kQeZmVgIhc7kOikBIxg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QsiFTii6WnW1lgN0+xgzujQyv5+/+TSNTj97FMWM9SQ=; b=cF9OH+uQz3hLLLT6QqhzTEJkuYs4fXaC/rK9lQyhe8XA6sS/vYRfgXSzwnbWKc8k9kreiKOBDeVrB2CwvTolXgLwBxtFJBzykEXzanzDeOr+JlCz5E6Zl4DrdjCKo7ptmm4aFUvdkFAI7tEZqozYkJPaKsnOw8nA6TOR6w/Zseg= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C From: Jason Andryuk To: CC: Jason Andryuk , Anthony PERARD , Juergen Gross , Julien Grall Subject: [PATCH v2 12/17] tools/manage: Expose domain capabilities Date: Wed, 16 Jul 2025 17:14:59 -0400 Message-ID: <20250716211504.291104-13-jason.andryuk@amd.com> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250716211504.291104-1-jason.andryuk@amd.com> References: <20250716211504.291104-1-jason.andryuk@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: None (SATLEXMB04.amd.com: jason.andryuk@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS3PEPF000099D9:EE_|IA1PR12MB6387:EE_ X-MS-Office365-Filtering-Correlation-Id: 12e723c3-e236-434e-9065-08ddc4aedbb4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|1800799024|36860700013|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?beghXXzOKb6qwRzonIWbcqZwKSeBKKe7taDlK1hVPkS2z7Jd7sevjuLGIzys?= =?us-ascii?Q?GeFAQtilHteMn1wp6wrSzzGp21iRTcN0T9xzsOgXKxEO9qfRVq5gQyzoSU+0?= =?us-ascii?Q?0LCReHZ80hxLAphOkUD+SnkMWmTpXy/gzbHNHSHFLuS/SMTDl0Gge5eU3o0O?= =?us-ascii?Q?gJehwa8XUj4/WtU+SCcrkxN1v9Nq4CV87RWCHrarfKMFRGyN4O6RMQ4tJDlY?= =?us-ascii?Q?aJKsoQSajKcSXyZY3RU5PFhOjnNRVbUgE4x+U0oKHNxn1A+ipFYjLTs8PjY6?= =?us-ascii?Q?Q2X00wU8yUAyp8388VcfWY6gzle2SpCMnxUoI2aN0TqOeGfwfJdPkMESnLwM?= =?us-ascii?Q?iKenugoFlZp0BJIxm4HIKdkUVXIunaC0ch1Bl1DMMN48ede2nblu1poa0Q8J?= =?us-ascii?Q?Ef9t7XZmqHnsGU+FulnT/KZ1iKknPWUI/e3esVafyglObXnn8WU62lfkR0a1?= =?us-ascii?Q?AFFLZVvyMYUka5WCASds/49OEsAnWLsu1rMtzOUtvqM2Re+ctSCrfy+p+rer?= =?us-ascii?Q?37d64LP9SE3Qh/J0OV1zwMAY7qLpsChLwiAQ/fwhXP9sQCcliC1q2pkUWsWU?= =?us-ascii?Q?WWUoaxk5KO/dIHj1lQGb6SpkKWJ5aOlEnUnn7vDGeheaJQiYykG8uZU10NJi?= =?us-ascii?Q?Y1REOmHQ8N/zhAPPhOeli6HtlSn4AedL+gN3B/d7mXP0CyDjr498ejCs7t6m?= =?us-ascii?Q?hya0Mz0CBz38FL0eL7d/r6iS4LEEWrMNPJxwudzc6NebmcCljFQ6ux17k4+p?= =?us-ascii?Q?lLriRUFtH7adHBGcvVTwnCffnUUEsglZiInjXuKINDPhxZZPccBjh8EnvdYU?= =?us-ascii?Q?W7s6pmQS7wWixhjWsg4UozfJXeJYfdOU3PrQRSzDmFOBeYTKF3s0auEFQcEp?= =?us-ascii?Q?cqUO7IAf2SEM4C74KYAO8Hcj3P+bQeSXhwWrPxlcpuAuH2UQAVViujoh/CNC?= =?us-ascii?Q?XxbYfd7Z42pBvMo1bEDjEfNZheILGZVqKNJOh0KfCEkPArbPAPcopythVonP?= =?us-ascii?Q?M2KyOsWnDrs6nozr0FOwMTDf9fAKIznqseJoJerfP6mZijKjwEWoIxldGeW0?= =?us-ascii?Q?Ysc3KX15z5LpJFmGCcTmzQkUQjeFgYsn5N5DhJXYVp+VeRFI+Saclfb0e7pu?= =?us-ascii?Q?uuu4dHiFsfCA6w6aWijZT0FTekeUCUogn+yC47gAFI8JN68O1gx518jqHplz?= =?us-ascii?Q?6EJvKrkUDTVJq2IbCxPP4wdbtXhXXQpwwUFvGZXMYdXIU2PRbYDKQHJjZCmI?= =?us-ascii?Q?g8JqE5CCX1gE0Uk/dqvhDLrkH8t0T/DIcbDHRETyFYi5kQLcEv7ehoDoydX5?= =?us-ascii?Q?kZMriGZphrpjLs5DmQEc9CiXVlShQFPsT+GzUeSJFyfAckcU1yB+u7zfsOG/?= =?us-ascii?Q?UKLi8/fvK+f/93VfjciNfL6vQ65zvgVvuk+gMv7gb2HM71SlLzW5w4qFhv1Q?= =?us-ascii?Q?czv7ll8syMIdSLJawLM4X68V2q6FDAB1e+KxxctHlabtlJhou+NVXm7Je/T6?= =?us-ascii?Q?pT4O1R/njqK2fgY3hbKqIwn25OQSWw3EOHlS?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(1800799024)(36860700013)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jul 2025 21:22:24.5086 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 12e723c3-e236-434e-9065-08ddc4aedbb4 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DS3PEPF000099D9.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6387 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1752700974122116600 Content-Type: text/plain; charset="utf-8" Add an additional "caps" argument to the libxenmanage functions to obtain a domains capabilities - control, hardware, and xenstore. Update the xenstored callers at the same time. Signed-off-by: Jason Andryuk Reviewed-by: Juergen Gross --- tools/include/xenmanage.h | 14 ++++++++++++-- tools/libs/manage/core.c | 21 +++++++++++++++++---- tools/xenstored/domain.c | 8 ++++---- 3 files changed, 33 insertions(+), 10 deletions(-) diff --git a/tools/include/xenmanage.h b/tools/include/xenmanage.h index 956b7a0a44..6fc0d9fe24 100644 --- a/tools/include/xenmanage.h +++ b/tools/include/xenmanage.h @@ -45,6 +45,12 @@ int xenmanage_close(xenmanage_handle *hdl); #define XENMANAGE_GETDOMSTATE_STATE_DYING 0x0004 /* Domain dying. */ #define XENMANAGE_GETDOMSTATE_STATE_DEAD 0x0008 /* Domain dead. */ =20 +/* Control Domain capability. */ +#define XENMANAGE_GETDOMSTATE_CAP_CONTROL 0x0001 +/* Hardware Domain capability. */ +#define XENMANAGE_GETDOMSTATE_CAP_HARDWARE 0x0002 +/* Xenstore Domain capability. */ +#define XENMANAGE_GETDOMSTATE_CAP_XENSTORE 0x0004 /* * Return state information of an existing domain. * @@ -59,7 +65,8 @@ int xenmanage_close(xenmanage_handle *hdl); * Return value: 0 if information was stored, -1 else (errno is set) */ int xenmanage_get_domain_info(xenmanage_handle *hdl, unsigned int domid, - unsigned int *state, uint64_t *unique_id); + unsigned int *state, unsigned int *caps, + uint64_t *unique_id); =20 /* * Return information of a domain having changed state recently. @@ -73,12 +80,15 @@ int xenmanage_get_domain_info(xenmanage_handle *hdl, un= signed int domid, * domid: where to store the domid of the domain (not NULL) * state: where to store the state (XENMANAGE_GETDOMSTATE_STATE_ fla= gs, * nothing stored if NULL) + * caps: where to store the capabilities (XENMANAGE_GETDOMSTATE_CAP_ + * flags, nothing stored if NULL) * unique_id: where to store the unique id of the domain (nothing stored= if * NULL) * Return value: 0 if information was stored, -1 else (errno is set) */ int xenmanage_poll_changed_domain(xenmanage_handle *hdl, unsigned int *dom= id, - unsigned int *state, uint64_t *unique_id= ); + unsigned int *state, unsigned int *caps, + uint64_t *unique_id); #endif /* XENMANAGE_H */ =20 /* diff --git a/tools/libs/manage/core.c b/tools/libs/manage/core.c index 8fb421df41..2fabdecaab 100644 --- a/tools/libs/manage/core.c +++ b/tools/libs/manage/core.c @@ -92,6 +92,7 @@ static int xenmanage_do_domctl_get_domain_state(xenmanage= _handle *hdl, unsigned int domid_in, unsigned int *domid_out, unsigned int *state, + unsigned int *caps, uint64_t *unique_id) { struct xen_domctl *buf; @@ -130,6 +131,16 @@ static int xenmanage_do_domctl_get_domain_state(xenman= age_handle *hdl, if ( st->state & XEN_DOMCTL_GETDOMSTATE_STATE_DEAD ) *state |=3D XENMANAGE_GETDOMSTATE_STATE_DEAD; } + if ( caps ) + { + *caps =3D 0; + if ( st->caps & XEN_DOMCTL_GETDOMSTATE_CAP_CONTROL ) + *caps |=3D XENMANAGE_GETDOMSTATE_CAP_CONTROL; + if ( st->caps & XEN_DOMCTL_GETDOMSTATE_CAP_HARDWARE ) + *caps |=3D XENMANAGE_GETDOMSTATE_CAP_HARDWARE; + if ( st->caps & XEN_DOMCTL_GETDOMSTATE_CAP_XENSTORE ) + *caps |=3D XENMANAGE_GETDOMSTATE_CAP_XENSTORE; + } if ( unique_id ) *unique_id =3D st->unique_id; } @@ -142,7 +153,8 @@ static int xenmanage_do_domctl_get_domain_state(xenmana= ge_handle *hdl, } =20 int xenmanage_get_domain_info(xenmanage_handle *hdl, unsigned int domid, - unsigned int *state, uint64_t *unique_id) + unsigned int *state, unsigned int *caps, + uint64_t *unique_id) { if ( !hdl || domid >=3D DOMID_FIRST_RESERVED ) { @@ -150,12 +162,13 @@ int xenmanage_get_domain_info(xenmanage_handle *hdl, = unsigned int domid, return -1; } =20 - return xenmanage_do_domctl_get_domain_state(hdl, domid, NULL, state, + return xenmanage_do_domctl_get_domain_state(hdl, domid, NULL, state, c= aps, unique_id); } =20 int xenmanage_poll_changed_domain(xenmanage_handle *hdl, unsigned int *dom= id, - unsigned int *state, uint64_t *unique_id) + unsigned int *state, unsigned int *caps, + uint64_t *unique_id) { if ( !hdl || !domid ) { @@ -164,5 +177,5 @@ int xenmanage_poll_changed_domain(xenmanage_handle *hdl= , unsigned int *domid, } =20 return xenmanage_do_domctl_get_domain_state(hdl, DOMID_INVALID, domid, - state, unique_id); + state, caps, unique_id); } diff --git a/tools/xenstored/domain.c b/tools/xenstored/domain.c index 94b2a1eaa7..d2b6fffa62 100644 --- a/tools/xenstored/domain.c +++ b/tools/xenstored/domain.c @@ -667,7 +667,7 @@ static int check_domain(const void *k, void *v, void *a= rg) unsigned int state; uint64_t unique_id; =20 - if (xenmanage_get_domain_info(xm_handle, domain->domid, &state, + if (xenmanage_get_domain_info(xm_handle, domain->domid, &state, NULL, &unique_id)) { unique_id =3D 0; state =3D 0; @@ -700,7 +700,7 @@ static void do_check_domains(void) struct domain *domain; bool notify =3D false; =20 - while (!xenmanage_poll_changed_domain(xm_handle, &domid, &state, + while (!xenmanage_poll_changed_domain(xm_handle, &domid, &state, NULL, &unique_id)) { domain =3D find_domain_struct(domid); if (domain) @@ -829,7 +829,7 @@ static struct domain *find_or_alloc_existing_domain(uns= igned int domid) domain =3D find_domain_struct(domid); if (!domain || !domain->unique_id) dom_valid =3D !xenmanage_get_domain_info(xm_handle, domid, - NULL, &unique_id); + NULL, NULL, &unique_id); =20 if (dom_valid) { if (!domain) @@ -1383,7 +1383,7 @@ int domain_alloc_permrefs(struct node_perms *perms) domid =3D perms->p[i].id; d =3D find_domain_struct(domid); if (!d) { - if (xenmanage_get_domain_info(xm_handle, domid, + if (xenmanage_get_domain_info(xm_handle, domid, NULL, NULL, &unique_id)) perms->p[i].perms |=3D XS_PERM_IGNORE; else if (!alloc_domain(NULL, domid, unique_id)) --=20 2.50.0 From nobody Thu Oct 30 22:53:26 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1752700982; cv=pass; d=zohomail.com; s=zohoarc; b=d5xpl807nhoaQh7gx66Eo+cUzaz1ghiC2wZCmwkIdykNSWTJnqWaPnU6wUCHE4xZDa1NFJnpmbVbDKJjq2OYBP+r/n6MzUTkwX3dERhpY8U2EKh0eb7aaHkV+sISTX1to7UScFiCPOUG1A1KXjbTg2zWTN7suErRswn/hEGlnDs= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752700982; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=97KUf7mPxnlBQ7FNs7Dg1VDm2iUHMnZSy61+ihwrWT4=; b=HEYHC9tehYUTPrziVZIJmcMz20CgappCb8rCPHlh4qC8ATdT6IFpoTc1dMmf9pE70WIgzhSevvCI0ksu0OggV2kzV6MIFkeARIzipdjIPaKgaJHwW8WdwCZGwFQfCr5q7McsPzMfDBXZ7IV8FEOzsxVwfcUkrzgaPmdkstgbUT4= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1752700982764396.66193316507906; Wed, 16 Jul 2025 14:23:02 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1045790.1416105 (Exim 4.92) (envelope-from ) id 1uc9aN-0002aX-5X; Wed, 16 Jul 2025 21:22:43 +0000 Received: by outflank-mailman (output) from mailman id 1045790.1416105; Wed, 16 Jul 2025 21:22:42 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uc9aM-0002W4-2f; Wed, 16 Jul 2025 21:22:42 +0000 Received: by outflank-mailman (input) for mailman id 1045790; Wed, 16 Jul 2025 21:22:37 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uc9aG-0007F2-VL for xen-devel@lists.xenproject.org; Wed, 16 Jul 2025 21:22:36 +0000 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on20607.outbound.protection.outlook.com [2a01:111:f403:2413::607]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id fad9978f-628a-11f0-b894-0df219b8e170; Wed, 16 Jul 2025 23:22:31 +0200 (CEST) Received: from DM6PR03CA0091.namprd03.prod.outlook.com (2603:10b6:5:333::24) by SJ2PR12MB8875.namprd12.prod.outlook.com (2603:10b6:a03:543::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8922.32; Wed, 16 Jul 2025 21:22:25 +0000 Received: from DS3PEPF000099D6.namprd04.prod.outlook.com (2603:10b6:5:333:cafe::a7) by DM6PR03CA0091.outlook.office365.com (2603:10b6:5:333::24) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8943.19 via Frontend Transport; Wed, 16 Jul 2025 21:22:25 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by DS3PEPF000099D6.mail.protection.outlook.com (10.167.17.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8943.21 via Frontend Transport; Wed, 16 Jul 2025 21:22:24 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 16 Jul 2025 16:22:21 -0500 Received: from fedora.mshome.net (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Wed, 16 Jul 2025 16:22:21 -0500 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: fad9978f-628a-11f0-b894-0df219b8e170 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ZLQ1BshmjSsrbPEJYkFFZDyajgi2LWH0vrVlFu+IT0bttlin8Encycsw4bhMT/v8LSApaPmPQ9ul5EC1Jq/l4gIYW+VpaAaSRcpdCnWMLHy1UHjEbEYqCxVXA9wuwpUYb10PHjkVrYSOpEkE1y0TRD8ZR7JUCcb5+2p1Q2gOgWpa5CmWIb5ADRs1yQM/JMRJ7iU0rwDfOtSDOTyRPNaoygjP/Zax8mRoa76sWWm3RKqYOcODFn/ymW79FToMXsuffYrygrUt4ESLEf3eYMOWMY4UePT+u8i7E6cr6vuMIzb505AwLcXBH9N2RvcuKGmguxiNH2whdJyV+GYJDF8HdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=97KUf7mPxnlBQ7FNs7Dg1VDm2iUHMnZSy61+ihwrWT4=; b=I6yx2TUMorJq8FTGnuBMyEGrCAZy56Bm0aENtsk9FQnWMq5xivrHLH61Sd57xvGS5Lcp21Qho0BiHTCo0B57V6ndymeLLz6DfnaV9nmcscBRNE+U0isVz/K0THA8jdXp0botvXtFWLoeA1w+59H403CfqDlpLOHG+7sGCovat+5jOpY0bJqxNIly+ZwuGS7MBE4nZTbFM6pm8I/hT7V3HlELu+gCVInvg53oxHEXmU3s9qPOW50QdKn7pmoxpEvMJeN+rFBQr6CRtn+YF6wEPKXyQwVZzQS16ijEvi5G1/O9f4472nHD7UlqgUyc9/GtusRUi0pW2jW/zJQWBSC3qQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=97KUf7mPxnlBQ7FNs7Dg1VDm2iUHMnZSy61+ihwrWT4=; b=Kzup2kg7QffOl3hq+hHApTP29pM7rz0S5BI8uhhncbOc6a+6h+vsq09zOkDJaEDuf/+JcKMwklPCSAN0Gb8UoU00qmiji0KA+TolPKm7iY0cgrHzRbYGvuubJ5H4kytSB78+nmU/0OFMc3z1Je4Bk9LDTSA8WqzF6UjYMuRCsQs= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C From: Jason Andryuk To: CC: Jason Andryuk , Juergen Gross , Julien Grall , Anthony PERARD Subject: [PATCH v2 13/17] tools/xenstored: Delay firing special watches Date: Wed, 16 Jul 2025 17:15:00 -0400 Message-ID: <20250716211504.291104-14-jason.andryuk@amd.com> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250716211504.291104-1-jason.andryuk@amd.com> References: <20250716211504.291104-1-jason.andryuk@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: None (SATLEXMB04.amd.com: jason.andryuk@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS3PEPF000099D6:EE_|SJ2PR12MB8875:EE_ X-MS-Office365-Filtering-Correlation-Id: bae8fb9c-d551-4038-277f-08ddc4aedbf2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|1800799024|376014|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?E6UgghSZ8HpkCblTl02V3t4D8Vdxs4Z+T3Epau7LKSTiGKY4mLC3zIsv3Mft?= =?us-ascii?Q?KTi450ZukX7ClUIGxXaP9PW9IkxfGEmuIV3JIkutMe6TAARO5nPKiDINbH9b?= =?us-ascii?Q?6CgZXsDC1K2LP/pJTNMC27FvLQWNuA0tHG/PDAU7T8z438rQr8YPDPfdylEH?= =?us-ascii?Q?YgpeQ8RiBBGLDT6sWdOdvxAfw2jTfpgqfBU8Q2uHp90BSnGsClXJzQnQ1uJ8?= =?us-ascii?Q?el7CJeV12Q6GyJAiyH1Jlya0TKwIX1my9qcJ2c7wS77XySP93zv2c/4rsuUN?= =?us-ascii?Q?Jt0Jno7SXPTG5EHhHhVetYyGtRBT67BbpNboDEO1T2RU0AitA+wXRO13jlC8?= =?us-ascii?Q?p9ukI0Y3H6ndiGc38sm6rmpHz5kaVXNOZNN+ULY2HSRNZPBsA2FBErkYPwgG?= =?us-ascii?Q?Fg4cDM+z1O+xQR/JqCVBd8mzZinbyItA6k/DVD9MGjzJaU42yuTlnNryQ9gN?= =?us-ascii?Q?RxrzhwfDu0t8Iz2itQyWQVqYCripcIVNVTWLOHdlK8SGt19ayXWLmdhcIymp?= =?us-ascii?Q?ieg5tu7P5vDAxhoyayevfv2UWxe/SnXKtRjxwyfE8ZNKuDAx/2ttUn3Vp8Ba?= =?us-ascii?Q?uhNeXEZCaBsZogLiXWiwbxDYFh0w8gwZJu9/PSB9B7JkOnl17aN1bc6Kzeb2?= =?us-ascii?Q?urzZWmg6yzHKeaFzqHtYMmbkh5v7yOPY6ru5DfY5ok62mxQpHx+guftOJRhf?= =?us-ascii?Q?OA5AWu+08zCPB7C4adEmN2U9YAAQZ48YX1qdVXFFpQFPQp1yodstqKHnyXDS?= =?us-ascii?Q?wbnf1/VJESizLXvaBAZcuEEn/9pYdJlxuGLjXNZXIwrmzNXmKTioEAahTrjw?= =?us-ascii?Q?8CzQtFJSiJ4FL24cO6glwD+Ij9ZTMiVG/h4RS/h/mXmIm2Bj/RgAzLttrJNN?= =?us-ascii?Q?gKUAqlqXywvtzFoydp/DjaYYPnlRPFalX54vglj5ZWgldoTTfxpmXbnzCEE5?= =?us-ascii?Q?5gp2Yz6nFPGudPto7b2zZGtHsZrusrQMfwWP2gVzFizsWdZbV0egyRspjfhO?= =?us-ascii?Q?zPGKLImIEB9kYXV6yoj9qfKVzmbl2m22r89FMpOAHYx0oOviVnBy+jNuHyd8?= =?us-ascii?Q?u2bNFI/aaCnEVWiytcczO/Hp8t+VAhWajCkW69nbFtL8xf+ypuRS4O3F7dgI?= =?us-ascii?Q?WLWk5lU0iGnznZclHf1hjuS0tY60glzzpRDmDx+KZ5awRs9FpX8i+VQTi1YA?= =?us-ascii?Q?Xw0VbJKTGmddADT/z4ip3x2u1sb5M2QxS4VzlkZetTdVJTziW6FVgus++So2?= =?us-ascii?Q?4/oV+0MD22Kt7qfcXUtP73MFtsjkpa6u66j6b8p8tf9BDIpLkUqJIgz/Ookt?= =?us-ascii?Q?+ZIThFjHYn9moNbfkxFi0/co3bBVkdqHxmKLOCWpotfbH1TVy46sWm3HzqDO?= =?us-ascii?Q?mVla3r034GdoLn0byEF/xuhqaTeOYafym9nB4fyR4R26dho9WbCrN2T/XwWf?= =?us-ascii?Q?4P6Fs/+uFJs2fgzb1ZIlltZ4yRgvHKcl/PKaCNCBhX0dC24Mi2mKn3ba9xHd?= =?us-ascii?Q?bgCX4vtDP2oENpn2/kKRkLxLCVEW8zkAJm83?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(1800799024)(376014)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jul 2025 21:22:24.9114 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bae8fb9c-d551-4038-277f-08ddc4aedbf2 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DS3PEPF000099D6.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB8875 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1752700984261116600 Content-Type: text/plain; charset="utf-8" fire_special_watches() can only be called after setup_structure() has been called. If it is called before setup_structure(), the hashtable search will segfault as the nodes hashtable has not been allocated. Normally, dom0 is setup up first and setup_structure() runs before any other domain. If we iterate xenmanage_poll_changed_domain() to discover domains, there is no guarantee the local domain running xenstored will be created first. Suppress firing special watches until the hashtable has been allocated. Signed-off-by: Jason Andryuk --- With a known domid, xenstored could construct that first and the iterate skipping itself. --- tools/xenstored/core.c | 5 +++++ tools/xenstored/core.h | 1 + tools/xenstored/domain.c | 6 +++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/tools/xenstored/core.c b/tools/xenstored/core.c index 37e4dd5a5b..550e879a00 100644 --- a/tools/xenstored/core.c +++ b/tools/xenstored/core.c @@ -2321,6 +2321,11 @@ void setup_structure(bool live_update) } } =20 +bool setup_structure_complete(void) +{ + return nodes !=3D NULL; +} + int remember_string(struct hashtable *hash, const char *str) { char *k =3D talloc_strdup(NULL, str); diff --git a/tools/xenstored/core.h b/tools/xenstored/core.h index 632886cecf..3fe80f7c66 100644 --- a/tools/xenstored/core.h +++ b/tools/xenstored/core.h @@ -301,6 +301,7 @@ const struct node *read_node_const(struct connection *c= onn, const void *ctx, int rm_node(struct connection *conn, const void *ctx, const char *name); =20 void setup_structure(bool live_update); +bool setup_structure_complete(void); struct connection *new_connection(const struct interface_funcs *funcs); struct connection *add_socket_connection(int fd); struct connection *get_connection_by_id(unsigned int conn_id); diff --git a/tools/xenstored/domain.c b/tools/xenstored/domain.c index d2b6fffa62..5443b4e608 100644 --- a/tools/xenstored/domain.c +++ b/tools/xenstored/domain.c @@ -579,9 +579,13 @@ static void domain_tree_remove(struct domain *domain) =20 static void fire_special_watches(const char *name) { - void *ctx =3D talloc_new(NULL); + void *ctx; const struct node *node; =20 + if (!setup_structure_complete()) + return; + + ctx =3D talloc_new(NULL); if (!ctx) return; =20 --=20 2.50.0 From nobody Thu Oct 30 22:53:26 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1752700973; cv=pass; d=zohomail.com; s=zohoarc; b=NJet5GyqWQ6s8fEvVNODLCDoU3bC97nYBt7TBynL+KGTXFEZ2AsxvZSbQcPnw7MvY3vK9Kq5J51eB3bfGpQk15y8IArGsRAqRLdb3GQ74uHYnJkGkA/eKQJhYN/SwqC1lKoPCiui9AoNKYbmvHh0mj7ywc1Zfd8MyyFgwjxb3gg= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752700973; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=jKTqt/XXb9MSRAqj6LYolQnFov3cpGRvILaAGq8Cm1E=; b=CLcW+QpPnc3ZCrPdIB/dH0W+A1RPUZ/3iUDgYNaG7ZA/31nd8konbzmv/ucCeZTOyO0qUftmyypsCjhBJjySWd6nwxw1BLB5r66DNrEuj5r4Ky8ZrnqoDabTRwVuPQTzdU4yL1DUIiBF/h/cYZ7gdEncWaAdyiLKgReHEqVDXrY= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1752700973133173.32118712175713; Wed, 16 Jul 2025 14:22:53 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1045786.1416064 (Exim 4.92) (envelope-from ) id 1uc9aH-00018V-0N; Wed, 16 Jul 2025 21:22:37 +0000 Received: by outflank-mailman (output) from mailman id 1045786.1416064; Wed, 16 Jul 2025 21:22:36 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uc9aG-00014q-3r; Wed, 16 Jul 2025 21:22:36 +0000 Received: by outflank-mailman (input) for mailman id 1045786; Wed, 16 Jul 2025 21:22:34 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uc9aD-0007F2-VB for xen-devel@lists.xenproject.org; Wed, 16 Jul 2025 21:22:33 +0000 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2060a.outbound.protection.outlook.com [2a01:111:f403:2417::60a]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id fa61cd11-628a-11f0-b894-0df219b8e170; Wed, 16 Jul 2025 23:22:30 +0200 (CEST) Received: from BL1PR13CA0306.namprd13.prod.outlook.com (2603:10b6:208:2c1::11) by MN0PR12MB6079.namprd12.prod.outlook.com (2603:10b6:208:3c9::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8922.36; Wed, 16 Jul 2025 21:22:25 +0000 Received: from MN1PEPF0000F0E5.namprd04.prod.outlook.com (2603:10b6:208:2c1:cafe::3e) by BL1PR13CA0306.outlook.office365.com (2603:10b6:208:2c1::11) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8964.12 via Frontend Transport; Wed, 16 Jul 2025 21:22:25 +0000 Received: from SATLEXMB03.amd.com (165.204.84.17) by MN1PEPF0000F0E5.mail.protection.outlook.com (10.167.242.43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8943.21 via Frontend Transport; Wed, 16 Jul 2025 21:22:25 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 16 Jul 2025 16:22:22 -0500 Received: from fedora.mshome.net (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Wed, 16 Jul 2025 16:22:22 -0500 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: fa61cd11-628a-11f0-b894-0df219b8e170 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=WOBLu/ZUfnszltdA6l9fKOGUXV6Pwh9defYDPyfo58Wjy1ifZJ6JN/4LRCjECOTgq2PLW4pgUYgOtMHWI+bVheR1kcvFP3YrBRV61f9tdSiFt/Le8ge+nDvsMj4aLfHUYaLLOadwx453FZOkD8CIfPHv/L1qX6CgvKsP70VFRAk01guCzNtMf84zY+cqENlQJaDdGtpKIvxiB5P2isRnWaRF5H2ge8BD1U3Myx2UR/7OVJB9cXM0Ia6/em/z0FwzKNtypJYvZfnCmhPy6rZdh6gz0QPIVcRkqi/9fTmPJZYowQelRixBa+o80fl/0sOdu4B2kzHWIfpw3L7o5uC01w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=jKTqt/XXb9MSRAqj6LYolQnFov3cpGRvILaAGq8Cm1E=; b=AlL0x/LZurgHbvWXPj1QWfktWyeJhRPA9wVFbuTJAJ/PZIQRh9QXrQJonUeMG419hwUyj9B7u00obvYkjfzIKUEB5natFx4qAm9ePAS9NjQQWrbSesqwoGe6w5txgPAibBHzwymumKegPwHAkYUhkkv0ot7NgQZwxdR6iYceNuMdjy2LEqtUPTRGpo5AKWQZP49JeG+9IV60E6C4vJoMxVTi14JtNXloyn0MS0DCOcvhH0tJOHzqDQ0nh5rAccOJNWpdNUzajqcyJJL4nq8hnLma6bSplVQnjWtFjVP4uX0ftiFUR/pbtrldU+xTgP6pDOAtJgMNVxrlqWiyIkkzng== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jKTqt/XXb9MSRAqj6LYolQnFov3cpGRvILaAGq8Cm1E=; b=2VH9HUvJ7I/BBNYTtFsCROijXLGNH58BpFzfTVPt0DXUanLqJlMdawC8vscIYqLwJR82lbd+LbwB+GgZ6tHRQlxIIYkvSytM2cglsmoLnzFdcDxv7qYGW25HwT7t4/IrkzEinnZEuo8iH3nT6eUP6+f7xoEB4yzBpBiY0fRJ4sM= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C From: Jason Andryuk To: CC: Jason Andryuk , Juergen Gross , Julien Grall , Anthony PERARD Subject: [PATCH v2 14/17] tools/xenstored: Auto-introduce domains Date: Wed, 16 Jul 2025 17:15:01 -0400 Message-ID: <20250716211504.291104-15-jason.andryuk@amd.com> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250716211504.291104-1-jason.andryuk@amd.com> References: <20250716211504.291104-1-jason.andryuk@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: None (SATLEXMB03.amd.com: jason.andryuk@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN1PEPF0000F0E5:EE_|MN0PR12MB6079:EE_ X-MS-Office365-Filtering-Correlation-Id: 33c96407-6c0a-4c4e-92ce-08ddc4aedc7b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|82310400026|1800799024|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?JfF6xpsCt83X4+nI66lj6LDBpm619yQIHgJRN3QFJF5Bp5jEG3KHJjFh0Poi?= =?us-ascii?Q?q46DhRJsB3/OE8h9jpun9F3ZD3Onq3QvrSQhVMZ7FIvFlocG6z70Av9+d+jA?= =?us-ascii?Q?tz+60TV2ThpgvQ92tDPON6o+C35TfW0gpGXuMzABT/x1ke7XxYi0NRYshYOj?= =?us-ascii?Q?1C+h0YaJC4cJePtUpTE7nWLXrTcz3xQx1qKydVB7KP2r0gSE2ACvejYTTZtT?= =?us-ascii?Q?nu+l7BmsSNWDMAIPbAZQDWXI7AbiHriI2xdF2VQcTbQefGzYPYY69kjOlPrb?= =?us-ascii?Q?bknZJuhyxxuOcyph6PXEGi8/Vsevar2Ausc/JwwSn120rLXKqhzVbUQ67PrG?= =?us-ascii?Q?vorgJrPJmSIgEalkSPA12v6LOnaLRTgtM82AHq1dZsQYTM4zx7Jq81POtjBo?= =?us-ascii?Q?Y9Fezz41an/NWplWYKGkfbGoVB39oI7qZjusVJC1ljGqFuqn7CnFreW8OZKd?= =?us-ascii?Q?y8gcrI8MBx7FZIlpn43BiVQyFfHk8iAQPFwkXRRZ9F4p1X8ljoYbSLDLLOLv?= =?us-ascii?Q?WWWWETj8WJWHP7qJgJmzPpVRKaq2tIYKXkNPNUe1sghiwpJvhDCkR9p2leFu?= =?us-ascii?Q?yPQbe6arb+7j/NmcEE/W6o2GKxErlGOMvW4t7fpO39wbNVqV7mUyek3HWr5K?= =?us-ascii?Q?9ArtTOCFxF1OrQPt/0RbVri2mponj1isIzNszf5P2druQsoIUNGOjfwu1Ade?= =?us-ascii?Q?9SOugkcsI4T/S9At4jusOXtjd6RsqjbiRRBdgxStBLUBs1kY0NT+f9mQnINr?= =?us-ascii?Q?7sj33bJ2j5ondYPgiycxKOtH5wi/1l7l7aiQEOfLyt0wFx3BoHxKdTXxnJ9c?= =?us-ascii?Q?JFWxJ/AmUM1GyRWjj1UQJdi76+bEWs/oUnZ7g0kasN2p5ejJDNgZk0hHm/+r?= =?us-ascii?Q?hF+HPgicEt6q95rlZqTzVI7WTHdEKWg+pAY/kMSoganTpyxuIfXf6G3NXTKX?= =?us-ascii?Q?vFlDQcCSEDw+FP8ZPRogtfT8SnIWv/KWFIJtxZqd5TxkGiO1PMIdyniLKKEw?= =?us-ascii?Q?NK1Ix8VvqGkN5wBR1eoO+9YRYDMk+vlk+1uV3hUjNK2ey/xgM/MFUxdsBi02?= =?us-ascii?Q?/2S70MZoI+g3neFZXt9ZbYhICLyJW2D47Z/w8sj+ShrjJ0Jq1HMWFI/623/n?= =?us-ascii?Q?vW4bAcVeTjs3vAFZ53vMUqyNDdjvVyR4gY+T34zW1A52xDxHxd6xE1GwPrK0?= =?us-ascii?Q?r0pUUYyNrerXXtR6Y1dMn0824a8aDx7G4xhTgt3f6WlTyrSNnaitxCv0TOgy?= =?us-ascii?Q?VNQlZsMz4O8i253654N3XvELuoMKx2McLl7L3FyzM75mV+dt3ujWHarOJDBK?= =?us-ascii?Q?j3ovhCC/qUUyCbwvsfO1TtoIkhcCJny0jvkhRtxfM3Ng7xjJ8KnWRtQ4IIYa?= =?us-ascii?Q?pwIOQkpXvpkALKUY7oHGe4TABEF7vPzdx8DupxAfGdRNvX+BiCDWkAcbG4eP?= =?us-ascii?Q?1hYNms/E+J4aJGzR21KuVJ3+xYK8l7KMMUdQlOcj84pLqm32bN1YkDzDysss?= =?us-ascii?Q?L6G+8g552RmCdvdfgszonuhXDLnzDzny2Ll9?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(82310400026)(1800799024)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jul 2025 21:22:25.8383 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 33c96407-6c0a-4c4e-92ce-08ddc4aedc7b X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: MN1PEPF0000F0E5.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB6079 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1752700973998116600 Content-Type: text/plain; charset="utf-8" Replace dom0_init() with init_domains() which uses libxenmanage to iterate through all existing domains and introduce them. dom0_domid is updated with the xenstore domain, since it really indicates the local domain. priv_domid is set to the control domain. This makes it limited to a single domain. These features let xenstore automatically connect any existing domains, which means it doesn't need to be done manually from init-dom0less. For a legacy dom0, the result should be unchanged. For a late xenstore stubdom it should also be the same, but priv_domid would be set automatically to control domain (which default to 0 normally). Always signal the event channel for initial domains. This gets dom0 (a local xenstored domain) to connect. Also always write XENSTORE_CONNECTED since we know we are connected at this point. Signed-off-by: Jason Andryuk --- tools/xenstored/core.c | 2 +- tools/xenstored/domain.c | 45 +++++++++++++++++++++++++++++++--------- tools/xenstored/domain.h | 2 +- 3 files changed, 37 insertions(+), 12 deletions(-) diff --git a/tools/xenstored/core.c b/tools/xenstored/core.c index 550e879a00..835402af81 100644 --- a/tools/xenstored/core.c +++ b/tools/xenstored/core.c @@ -2762,7 +2762,7 @@ int main(int argc, char *argv[]) /* Listen to hypervisor. */ if (!live_update) { domain_init(-1); - dom0_init(); + init_domains(); } =20 /* redirect to /dev/null now we're ready to accept connections */ diff --git a/tools/xenstored/domain.c b/tools/xenstored/domain.c index 5443b4e608..44e997cee4 100644 --- a/tools/xenstored/domain.c +++ b/tools/xenstored/domain.c @@ -1257,20 +1257,45 @@ const char *get_implicit_path(const struct connecti= on *conn) return conn->domain->path; } =20 -void dom0_init(void) +void init_domains(void) { - evtchn_port_t port; - struct domain *dom0; + unsigned int domid; + unsigned int state; + unsigned int caps; + uint64_t unique_id; + + while (!xenmanage_poll_changed_domain(xm_handle, &domid, &state, &caps, + &unique_id)) { + evtchn_port_t port =3D 0; + struct domain *domain; + + if (caps & XENMANAGE_GETDOMSTATE_CAP_XENSTORE) + dom0_domid =3D domid; + + if (caps & XENMANAGE_GETDOMSTATE_CAP_CONTROL) + priv_domid =3D domid; =20 - port =3D get_xenbus_evtchn(); - if (port =3D=3D -1) - barf_perror("Failed to initialize dom0 port"); + if (domid =3D=3D dom0_domid) { + port =3D get_xenbus_evtchn(); + if (port =3D=3D -1) + barf_perror("Failed to initialize dom%u port", + domid); + } + + domain =3D introduce_domain(NULL, domid, port, false); + if (!domain) { + xprintf("Could not initialize dom%u", domid); + continue; + } =20 - dom0 =3D introduce_domain(NULL, xenbus_master_domid(), port, false); - if (!dom0) - barf_perror("Failed to initialize dom0"); + domain_conn_reset(domain); =20 - xenevtchn_notify(xce_handle, dom0->port); + if (domain->interface) + domain->interface->connection =3D XENSTORE_CONNECTED; + + /* Notify the domain that xenstore is available */ + xenevtchn_notify(xce_handle, domain->port); + } } =20 void stubdom_init(void) diff --git a/tools/xenstored/domain.h b/tools/xenstored/domain.h index 844ac11510..6a78f06935 100644 --- a/tools/xenstored/domain.h +++ b/tools/xenstored/domain.h @@ -84,7 +84,7 @@ int do_reset_watches(const void *ctx, struct connection *= conn, =20 void domain_early_init(void); void domain_init(int evtfd); -void dom0_init(void); +void init_domains(void); void stubdom_init(void); void domain_deinit(void); void ignore_connection(struct connection *conn, unsigned int err); --=20 2.50.0 From nobody Thu Oct 30 22:53:26 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1752700980; cv=pass; d=zohomail.com; s=zohoarc; b=BWBwkunTRlMtmPK3RqAZu2BAFgg/8vfgdP9mfMb3Jso1OhCQYptFcx0FAJykKAoowuKgMvNoIw7AsdL6PD7yAUbxxNylG1agshBQBjNM/2VzK7ZM+V6IUBGX7zi/NdOddtJx8lOb/fheq87UgmRIyzcCO2E9oNpHoaBQp8fB2fs= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752700980; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=9COZFGWceoTfc6y3naDMizwa1w65msAR0A5PQbH+Dzs=; b=IQRC9RpWrKa9cAz3iZHuHq06U49/VIZVWMB11S5EUUZ4DUltYjNRwUwa51CdsbVpmTjfxWN6oGotfEG8fY7sT6SV5jHZR/nGqlvVrKMFx+VW7tvEPw+NKodgPxMKxdOHcxYKkdvdIr3MqtsLO/jfLi12ohgkYQB+HnUUXgO6Fl8= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1752700980357384.12918025855765; Wed, 16 Jul 2025 14:23:00 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1045788.1416086 (Exim 4.92) (envelope-from ) id 1uc9aK-0001sz-8t; Wed, 16 Jul 2025 21:22:40 +0000 Received: by outflank-mailman (output) from mailman id 1045788.1416086; Wed, 16 Jul 2025 21:22:39 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uc9aJ-0001qc-CN; Wed, 16 Jul 2025 21:22:39 +0000 Received: by outflank-mailman (input) for mailman id 1045788; Wed, 16 Jul 2025 21:22:35 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uc9aE-0007F2-VB for xen-devel@lists.xenproject.org; Wed, 16 Jul 2025 21:22:34 +0000 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on20627.outbound.protection.outlook.com [2a01:111:f403:2416::627]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id fb4c25b5-628a-11f0-b894-0df219b8e170; Wed, 16 Jul 2025 23:22:31 +0200 (CEST) Received: from CH2PR10CA0004.namprd10.prod.outlook.com (2603:10b6:610:4c::14) by IA0PPF864563BFB.namprd12.prod.outlook.com (2603:10b6:20f:fc04::bd7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8835.27; Wed, 16 Jul 2025 21:22:25 +0000 Received: from DS3PEPF000099D9.namprd04.prod.outlook.com (2603:10b6:610:4c:cafe::29) by CH2PR10CA0004.outlook.office365.com (2603:10b6:610:4c::14) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8943.20 via Frontend Transport; Wed, 16 Jul 2025 21:22:25 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by DS3PEPF000099D9.mail.protection.outlook.com (10.167.17.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8943.21 via Frontend Transport; Wed, 16 Jul 2025 21:22:25 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 16 Jul 2025 16:22:24 -0500 Received: from fedora.mshome.net (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Wed, 16 Jul 2025 16:22:23 -0500 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: fb4c25b5-628a-11f0-b894-0df219b8e170 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=OzSVA8Q/iKphaiWrbuNC6AaqnAxqewFTmySeLSsA8q0rTHzRJsjIqaUWLn/CikT70w/TJXX3mxji8gPJ4EThgvnlbDIMZPozjsYywghXo4geIjeezZg4FA3+K4aFCqUkvRx/8BoaxsFgqnbEPnyakmm79qRhike6uyPZlcbP898VJDKMSVc5XW/9uvmqHs9WB0kuTuiNHzlrTsAkaijpKlCBYjn+vHwJSale+BgmM/XXTb7VIcvdcVro3BEoB9SezsSdXJ6HY2Jt+frVn7OHzSIVXxDyvbCvcLDmOW3SHYoeIoK6iPGeOXPL7l+eQNIanllSf1JTbnetiRCj4Fibfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=9COZFGWceoTfc6y3naDMizwa1w65msAR0A5PQbH+Dzs=; b=DVOeCa0nKVk17A7BN93Ubx2BpMHsBVoTVxmKqBxGKok1GayHf7eNHP3sf3ipeCthK1BHyfc8slIGXEFpJv5597zhwIJJIwm3I0ttCyeKkQmmv3mX4BR6BsBahL5WJKXX1Hij2tJpTfdsTNYeYxaXkldHnsWEFHZHCwzqTj/yX6gUckTnRR7pa0XQiF1m3/qcGkXhKw2OLA+aliD06kHm61P35IZ3UWyi84y4erZ1EfPf7p4Ak/VWS3fR8QVQiXC8aEp91dhz8pL5Uvg02hk/UZwO/1sG6Zb3BKISY3YssOzlcG/4YKfh+8b0rKfZcr0ZlXc1j30oVNBvq9i6vFIF5A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9COZFGWceoTfc6y3naDMizwa1w65msAR0A5PQbH+Dzs=; b=RXEsNtxp1r9c1LamiQPiMw70aSSK89p/JZP0Ewdnup726Jpy/ujnrBQqrloJcM2Wy5/Zlhtu9CrNZG9lWDFjPx42/mzfMkY6e5sjdoOFfjD56wH96wfUaZIPQ06TPFvj49FGwmJytUeyYzlVmZyDaeWVRPW1jbXjxbYQlIYBrwI= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C From: Jason Andryuk To: CC: Jason Andryuk , Anthony PERARD Subject: [PATCH v2 15/17] tools/init-dom0less: Factor out xenstore setup Date: Wed, 16 Jul 2025 17:15:02 -0400 Message-ID: <20250716211504.291104-16-jason.andryuk@amd.com> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250716211504.291104-1-jason.andryuk@amd.com> References: <20250716211504.291104-1-jason.andryuk@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: None (SATLEXMB04.amd.com: jason.andryuk@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS3PEPF000099D9:EE_|IA0PPF864563BFB:EE_ X-MS-Office365-Filtering-Correlation-Id: 0f78cb91-058a-480e-0ce0-08ddc4aedc3f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|1800799024|376014|36860700013; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?1aekVOOjMUPtFhpxPC5K3Fa+WsSuNoaOE4qCeOnclLoBuDyx8gO6J1BQsUJK?= =?us-ascii?Q?ym0kLpMnXQslQvb5LrI9RPIQihJMOcqIhtD3fm0Gz/q+Ucfsm1FxA9R8MVIL?= =?us-ascii?Q?omtQdOi0J0UuPjTcAPmyir0nF5BXbIqWESHkWthDvAdtM0CUKIlpbErNc1Xs?= =?us-ascii?Q?deaSr9dNPWRj0ixdJtIbF4k+xCNE2Fm/WE2YNMoYJFd57mmiyWmd4zIboUQO?= =?us-ascii?Q?QuxeexDevH21W8wD1kVHuPd8c+28qUj2sWEWoRCyfSGrJmRzXGho/UthRSVg?= =?us-ascii?Q?ih2Puh9+YBIRDrWchcCBCCLRn+kijlAIL2fGSgbuPQGWHceRX2rY/Fjjdjqu?= =?us-ascii?Q?A4XGgEenOXM+iB66i4VoKimW5y9PCpyw1lSoqhepayUM7Oe1gNncAY4dklEi?= =?us-ascii?Q?wwOWTXLV4Lfr/JudW9am3Qb7GsJQYZdEthMJje+Mn1Ulo+uH9GPwQpkhcHsC?= =?us-ascii?Q?jf6KKaf8efaGWIIkscHGyTjf1kis4DtaLm+lrveWyroLV3Yt5GxQduNq+Afw?= =?us-ascii?Q?SlwgBzR2LW4Bu2sFqAHILJuFoRmzrjyce1gwByvMbqM5NCmtxCLLcmymR5Sx?= =?us-ascii?Q?UXC1YceuNY0/KCsvtZwN6y3oGWBPENx0GQAapU/7kA9XENkz6jAeWKznZc1C?= =?us-ascii?Q?SC7nwi5YNGFSMb8qqEXW4eRLiHQfDYtMGJZAUG4o+cjOtOpMhQ/r6tjopQLQ?= =?us-ascii?Q?ZQJ+ruukQeaUBDAiU9WldmSEFcYER2MnCxCY4eade0G4CpHPJAhwIjhWejuk?= =?us-ascii?Q?TJ22HGTctsgJq7fM2wEowQRRN9TlB7Vgwvyumz2mx6KNzs6kOfRwvbH5hQu4?= =?us-ascii?Q?VlSXNlqRjspztMnwJ/e5uTEd5G4vi2La3NvXaEHp3KAfbxj60EJ76gbK4qEG?= =?us-ascii?Q?+oOgM7YmwE2uqc3GmFn5dSCJF+rkV6ZZQs+3dSbPv2ykTBm+yMUW/EsrFzc9?= =?us-ascii?Q?TUZYn4sS3gNPi2BY+KKP21dKcPe4ZHUi9AOORT2pye2/VoxBHJ0A0l83Bp94?= =?us-ascii?Q?f0FpOHxsP7v0+mT4d4fXGcqCOYhp8dYB/5XKIFzfgm/LUhCJoAOJkUPpaKDy?= =?us-ascii?Q?G/JcFRPOpjLm+QCWQ2LnuI5DMDVixj8X+5tVyfjbad4KiZYW1KyHdW9H4QsO?= =?us-ascii?Q?WLVKB2EJIi7TTnzAPLX0oQsBuB9WCbPsZn/lEjgcYv6Iqf/C/SHFtX9xoGvl?= =?us-ascii?Q?Fc0x/cjm3rN4LxGi5QWfE4efU3mfrT4NoUj/8i42EOCTQ+nm58NRCbpgAz2I?= =?us-ascii?Q?I++fx5YeGlkEQwgZaztZLKIVCKsFT4NfCsqKzomQRH3VClz9JyNo9N24xNJb?= =?us-ascii?Q?ZlhbQEsw/zs4x0HG+W5fho/GM9C2nXtASHBqDX2WMAtgvKpBS/wh8YWvwYjk?= =?us-ascii?Q?+0W5rPu+czVqdlcqWP8OY4uho/8dg+eXMVKw5gUUj71W0dD7wIAjNZBw4sS0?= =?us-ascii?Q?EpFe6dQCul81fJZSqfsB/y/GvbCkH29PYYedCmcZoqy7byKT795HgIAwme6q?= =?us-ascii?Q?YWi1RLz6MU6nBkj3P/Iy1ingW+wucBz4AkVn?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(1800799024)(376014)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jul 2025 21:22:25.4161 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0f78cb91-058a-480e-0ce0-08ddc4aedc3f X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DS3PEPF000099D9.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PPF864563BFB X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1752700982060116600 Content-Type: text/plain; charset="utf-8" Factor out the xenstore setup code into configure_xenstore(). This is in preparation for handling already-introduced domains. Signed-off-by: Jason Andryuk --- tools/helpers/init-dom0less.c | 51 ++++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 15 deletions(-) diff --git a/tools/helpers/init-dom0less.c b/tools/helpers/init-dom0less.c index a182dce563..6ae7cf2e7e 100644 --- a/tools/helpers/init-dom0less.c +++ b/tools/helpers/init-dom0less.c @@ -235,43 +235,43 @@ err: return rc; } =20 -static int init_domain(struct xs_handle *xsh, - struct xc_interface_core *xch, - xenforeignmemory_handle *xfh, - libxl_dominfo *info) +static int configure_xenstore(struct xs_handle *xsh, + struct xc_interface_core *xch, + xenforeignmemory_handle *xfh, + libxl_dominfo *info, + uint64_t *xenstore_evtchn, + uint64_t *xenstore_pfn) { - libxl_uuid uuid; - uint64_t xenstore_evtchn, xenstore_pfn; int rc; =20 - printf("Init dom0less domain: %u\n", info->domid); + printf("Introduce dom0less domain: %u\n", info->domid); =20 rc =3D xc_hvm_param_get(xch, info->domid, HVM_PARAM_STORE_EVTCHN, - &xenstore_evtchn); + xenstore_evtchn); if (rc !=3D 0) { printf("Failed to get HVM_PARAM_STORE_EVTCHN\n"); return 1; } =20 /* no xen,enhanced; nothing to do */ - if (!xenstore_evtchn) + if (!*xenstore_evtchn) return 0; =20 /* Get xenstore page */ - if (get_xs_page(xch, info, &xenstore_pfn) !=3D 0) + if (get_xs_page(xch, info, xenstore_pfn) !=3D 0) return 1; =20 - if (xenstore_pfn =3D=3D ~0ULL) { + if (*xenstore_pfn =3D=3D ~0ULL) { struct xenstore_domain_interface *intf; =20 - rc =3D alloc_xs_page(xch, info, &xenstore_pfn); + rc =3D alloc_xs_page(xch, info, xenstore_pfn); if (rc !=3D 0) { printf("Error on getting xenstore page\n"); return 1; } =20 intf =3D xenforeignmemory_map(xfh, info->domid, PROT_READ | PROT_W= RITE, 1, - &xenstore_pfn, NULL); + xenstore_pfn, NULL); if (!intf) { printf("Error mapping xenstore page\n"); return 1; @@ -282,16 +282,37 @@ static int init_domain(struct xs_handle *xsh, =20 /* Now everything is ready: set HVM_PARAM_STORE_PFN */ rc =3D xc_hvm_param_set(xch, info->domid, HVM_PARAM_STORE_PFN, - xenstore_pfn); + *xenstore_pfn); if (rc < 0) return rc; =20 rc =3D xc_dom_gnttab_seed(xch, info->domid, true, - (xen_pfn_t)-1, xenstore_pfn, 0, 0); + (xen_pfn_t)-1, *xenstore_pfn, 0, 0); if (rc) err(1, "xc_dom_gnttab_seed"); } =20 + return 0; +} + +static int init_domain(struct xs_handle *xsh, + struct xc_interface_core *xch, + xenforeignmemory_handle *xfh, + libxl_dominfo *info) +{ + uint64_t xenstore_evtchn, xenstore_pfn =3D 0; + libxl_uuid uuid; + int rc; + + rc =3D configure_xenstore(xsh, xch, xfh, info, &xenstore_evtchn, + &xenstore_pfn); + if (rc) + return rc; + + if (xenstore_evtchn =3D=3D 0) { + return 0; + } + libxl_uuid_generate(&uuid); xc_domain_sethandle(xch, info->domid, libxl_uuid_bytearray(&uuid)); =20 --=20 2.50.0 From nobody Thu Oct 30 22:53:26 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1752700974; cv=pass; d=zohomail.com; s=zohoarc; b=WUGG5HAlI2dyuiP81MK6ROnSFIY/IIK0aEYJcf9isMvPuqytV/tF2FIduNP+sytFp1GiyTAk8YQOwi9Ytxju8iL9o0px2yRQnY7svphK+lQ/FV/x5ES9sM3mnY/+/L4Emi2HS25DFRsLCg2SzQO7OMIDA8z1w/8wTw3WMk/LFlo= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752700974; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ilFL7snKWKGO1xBaFJIr9eFBC74prAtQEcljgArVvrU=; b=ftVkeO5e0BohyQAoxQe7MoIjV4bzG1C5aNvsgQmuUKihVAk9BT84v9y7iFMLo8OxZSyMfTCAA9C+l+Nf23j/Pc5HE456grxhzdTDjVR3GjTIp9gpt0nCfwZ8cXA6TLbH4jEX1627HAXiTQAljgOJ1P24nY1PEzurtpLamrJ0iy4= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1752700974151671.9550412226519; Wed, 16 Jul 2025 14:22:54 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1045779.1416017 (Exim 4.92) (envelope-from ) id 1uc9aC-00006H-LL; Wed, 16 Jul 2025 21:22:32 +0000 Received: by outflank-mailman (output) from mailman id 1045779.1416017; Wed, 16 Jul 2025 21:22:32 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uc9aC-0008VY-DZ; Wed, 16 Jul 2025 21:22:32 +0000 Received: by outflank-mailman (input) for mailman id 1045779; Wed, 16 Jul 2025 21:22:30 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uc9aA-0007F7-TJ for xen-devel@lists.xenproject.org; Wed, 16 Jul 2025 21:22:30 +0000 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on20601.outbound.protection.outlook.com [2a01:111:f403:2009::601]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id f9ce9101-628a-11f0-a319-13f23c93f187; Wed, 16 Jul 2025 23:22:29 +0200 (CEST) Received: from DM6PR03CA0099.namprd03.prod.outlook.com (2603:10b6:5:333::32) by CYXPR12MB9277.namprd12.prod.outlook.com (2603:10b6:930:d8::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8922.32; Wed, 16 Jul 2025 21:22:26 +0000 Received: from DS3PEPF000099D6.namprd04.prod.outlook.com (2603:10b6:5:333:cafe::ba) by DM6PR03CA0099.outlook.office365.com (2603:10b6:5:333::32) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8943.20 via Frontend Transport; Wed, 16 Jul 2025 21:22:25 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by DS3PEPF000099D6.mail.protection.outlook.com (10.167.17.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8943.21 via Frontend Transport; Wed, 16 Jul 2025 21:22:25 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 16 Jul 2025 16:22:25 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 16 Jul 2025 16:22:25 -0500 Received: from fedora.mshome.net (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Wed, 16 Jul 2025 16:22:25 -0500 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: f9ce9101-628a-11f0-a319-13f23c93f187 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=uW2OKmxr/FpDa2PedIdD7mEA1FWwN7A/u7It7+4thaIiamVHpVDR9GTX8mEx5FWtrZFHABgurI4s79JkIASnwqMHs+S0gcIKvLcSNxgPRwFPSK4swe4Ba9wTZMsClSsOFn1m/5siqngQMuSwPtC1KhwuowQJLHaWZMUtFcQnC2baq2R3vYeTT+pBzwDhnpLOJSbKe8Tv5ugiHZhLuLcEx44EOvVh0tt+4Y/Pq3RZxfsf33XmkwEKiRRw+/7NYRptUbaRujsHEGZ13CL3WiVAKavxplNjFKqM+wBW1r9G3ZDVY0YQ4d03b+uHv498V99f8on3VRGxs9RBLTubqydbBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=ilFL7snKWKGO1xBaFJIr9eFBC74prAtQEcljgArVvrU=; b=wA6OUT7qqz/hsgSPLAiD/MQIySY6rEyPnn+mklcGXo1xiBW9DdHz3ZjiaSJVaCFT0jYExP19eXCbnc/gNETxAL7LbJ4Jin1pqnib5en9tYwzyJWDaVSk0hgidO0zeAqSxP3EZ/5wc7Fz96LlzLTq2nC9obi3OlZGUonSJMCKS0GW8IqBws9iprbTRll8nOw3vcBZOQ4K+FArIntP55x2LZc4q4jh23TlTPV0JaWCJtscsmcBoNRF2wsgy4pOO1ug4NAkys7y8/NOktNWe6ZXe50LigZF+UMxP8tNV8BGGKv/5HdDqjGimKNjE3G2VZIox85nFqQvZi46LLy8AAsjZQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ilFL7snKWKGO1xBaFJIr9eFBC74prAtQEcljgArVvrU=; b=Dt+cZ+aJH12gE9BeO8AesB20erCZ12FgPhtmY64x5knRx36Ogg3kDzJZaAdoM/qkeJ0j2EqzzohQ+hf4X+LqMpno56uPUrdIbeq2DVT25Rj2ZroqB5YH94d6vay30o8E3uASARjJtpNUi0IvpL7p5Uq6BF9SSQQH8nK3EkvHLbQ= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C From: Jason Andryuk To: CC: Jason Andryuk , Anthony PERARD Subject: [PATCH v2 16/17] tools/init-dom0less: Configure already-introduced domains Date: Wed, 16 Jul 2025 17:15:03 -0400 Message-ID: <20250716211504.291104-17-jason.andryuk@amd.com> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250716211504.291104-1-jason.andryuk@amd.com> References: <20250716211504.291104-1-jason.andryuk@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS3PEPF000099D6:EE_|CYXPR12MB9277:EE_ X-MS-Office365-Filtering-Correlation-Id: f6857c0d-9afa-471b-bb5a-08ddc4aedc7f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|376014|36860700013|1800799024; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?GuS1fr5tBMq7rn/1S7+8Ap5rjdcfcjq6+RE4lKOTxWV2NpjpPq1Vj71G42US?= =?us-ascii?Q?o9AoW6WQ3vDSRgjeu4Pk/QblvSDRnwZA30te7Ke05306iR7FtHLAavYcXPVH?= =?us-ascii?Q?tjnZMJWgonOmmsj3L4OMCkVAtlLgiVAU6hAuPZZ2kv37D3gDYEYbH8SIXXAS?= =?us-ascii?Q?3TL+Y694PoOlBExsBhDVisdgk2LAI+6rtzblTb/Ap3UNHBev4VipB3uy0Uiu?= =?us-ascii?Q?M5kZxs7WUb/SyBFyv7pGP2zGmTtUyVIfdZjQLGux8AGx9u17Iu1mI7lLclfm?= =?us-ascii?Q?rKFDd0F07QtaeWq/32tadxQN+qJG2luYm4D2YaMUTp0zmejHTqi8lkRu1Ag+?= =?us-ascii?Q?kMlyr4KRttNxX7nUb6EEW2iLFG/jTTa5VBj3zaclpD3/Pmc6zTS3Xy+PoJDh?= =?us-ascii?Q?Vs5k3orM0z4jaEjCTwvDeMRKsJBRKB+CM3w4HQRgEVXY3g+fvvJLcLiNmLyX?= =?us-ascii?Q?pVi0P31HslL/6pBFY8dN0UtAGBP52HtW8oF2pnaXjEXlonT9V5tFbmDVjIPg?= =?us-ascii?Q?Pzg9HFPu52f43ADrCHmHq6p9KjDIfpFRiL35Dqb725syY0JaNju7zCV2Qcmy?= =?us-ascii?Q?uDnUa80Yyu3DTV5gVXVVN5h5kmapyHB1SEDZsMcD9RQXIRZh0dOBOeES0RKi?= =?us-ascii?Q?DWjPSJw+FXRa7I57X+EtlyfIIIV/ApW6NeBTSNWg0kvmX4F/h3w13Iq89Hr0?= =?us-ascii?Q?6dxP+MShTNQ84lL3h1Wj+Y9r/+jCfdIqZ8zm3Vs3JcIOoJLCEz1UY6iVdVLC?= =?us-ascii?Q?QLVjlWFfBEdjGLAXVQ5rc3erHpelMWYipau8YoDNY5Zuvj2tMfPYN7oyBRWf?= =?us-ascii?Q?UzFAWRglK6MXw4K8mfJoTJiPnO138ZcOQmxxtbZl8Sqqe+XtbU1aOBxBYIsX?= =?us-ascii?Q?n2P9zVaN/+fmrh6wsoiz4cmV2bOjvbp58VLpp74UIk632RWIQX6CmhnMDRlN?= =?us-ascii?Q?f3nmwcpFkDGWQrBdpVuLp663nw8yaL6sKippACiqYuag+mhS/qsnmLTC2VfT?= =?us-ascii?Q?Pt6PMN1Sk+mQHe9F5vQdfIo5699NirxDhnuISsrkqWP5W8M5KVrXfxrddhpn?= =?us-ascii?Q?ifxJaA6EcCajvt2O9rR9dt3qATWMu9CJTUI8jWT2babFl4JzZCrCydRPwnG4?= =?us-ascii?Q?KszuiJAFi7k+VfDuFZY3Sd7VeUiYmASpMS/uGElj05DZTIdHHFOF1YamzNIM?= =?us-ascii?Q?CgAeZPg78bKxA61EkihW7buQnUbs0OyfwAn0TuNWVLK01QSBWzPjHj7lyaq8?= =?us-ascii?Q?xo3bPL9pdTvI718E0efjtq1qBuxTWLTp+dKlWKIsCRO9vc036/F3UDKlD/6t?= =?us-ascii?Q?Cvj7svG5UT/TjPzc/QcD62EVdxgfsVYkIbPNKn2srL/684UOq69xH4KrFZl1?= =?us-ascii?Q?q4S0N/G/yFrQyxWerdnJAijKauuxOxvev6UPEvJLsUJzy25h/kptZr133dj6?= =?us-ascii?Q?YhP0zszr5rq6LDAP5iBDk3PPXK28lrY8N3SnebwJWGiQo32alB3idHUJUBfj?= =?us-ascii?Q?F1mxovgIQ/4qTJoSyos1mkD3Cl6GTNesWTFJ?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(376014)(36860700013)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jul 2025 21:22:25.8405 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f6857c0d-9afa-471b-bb5a-08ddc4aedc7f X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DS3PEPF000099D6.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYXPR12MB9277 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1752700976000116600 Content-Type: text/plain; charset="utf-8" With xenstore automatically introducing domains at startup, the xs_is_domain_introduced() check is no longer accurate. Instead, process all domains and introduce non-introduced domains. This writes the xenstore entries and xl configuration for xenstore-enhanced domains as those entries are still useful with an already-introduced domain. Non-xenstore domains are still skipped. While at it, remove domain_exists() which is just a simple wrapper. Signed-off-by: Jason Andryuk --- tools/helpers/init-dom0less.c | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/tools/helpers/init-dom0less.c b/tools/helpers/init-dom0less.c index 6ae7cf2e7e..4336e0f418 100644 --- a/tools/helpers/init-dom0less.c +++ b/tools/helpers/init-dom0less.c @@ -324,16 +324,14 @@ static int init_domain(struct xs_handle *xsh, if (rc) err(1, "writing to xenstore"); =20 - rc =3D xs_introduce_domain(xsh, info->domid, xenstore_pfn, xenstore_ev= tchn); - if (!rc) - err(1, "xs_introduce_domain"); - return 0; -} + if (!xs_is_domain_introduced(xsh, info->domid)) { + rc =3D xs_introduce_domain(xsh, info->domid, xenstore_pfn, + xenstore_evtchn); + if (!rc) + err(1, "xs_introduce_domain"); + } =20 -/* Check if domain has been configured in XS */ -static bool domain_exists(struct xs_handle *xsh, int domid) -{ - return xs_is_domain_introduced(xsh, domid); + return 0; } =20 int main(int argc, char **argv) @@ -376,14 +374,10 @@ int main(int argc, char **argv) continue; =20 printf("Checking domid: %u\n", domid); - if (!domain_exists(xsh, domid)) { - rc =3D init_domain(xsh, xch, xfh, &info[i]); - if (rc < 0) { - fprintf(stderr, "init_domain failed.\n"); - goto out; - } - } else { - printf("Domain %u has already been initialized\n", domid); + rc =3D init_domain(xsh, xch, xfh, &info[i]); + if (rc < 0) { + fprintf(stderr, "init_domain failed.\n"); + goto out; } } out: --=20 2.50.0 From nobody Thu Oct 30 22:53:26 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1752700974; cv=pass; d=zohomail.com; s=zohoarc; b=FoFWgWajPRos5agpW2U1P5cHBNcdQVf/ZjWpJniOmC36Kag3STPTCof/TCmKa8wHZpFrTcvkEi3JBi/OROpIt932G/3QwqcuA1KzgHwprmFf+6SkFSCA9pirVDiyeA4ETF3COKJzKsuh+Q5I8ACkCMDIftSjD9uvYtTLVdx2QAo= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752700974; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ntmVC9IWFJ5GNC3GzC1iMcc39AzLXNBTd/6KxHvgHN0=; b=KmoncAujQNCdW/Sip5IAQgPeh1AFOtmshRUKJLSckIVfOkG/k3UF2juq8ZlsIPWDoMVMZml1OxiLnMZzG96WvLylozB27wq+lZuUAosD7SSyLdkTVtWlRRyRtofSCakuoM8uwclUTpCE2Ul823zc+z6YgnJ2oP5wrJrUc9zspgw= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 175270097415948.55551878260269; Wed, 16 Jul 2025 14:22:54 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1045787.1416077 (Exim 4.92) (envelope-from ) id 1uc9aJ-0001g9-4Q; Wed, 16 Jul 2025 21:22:39 +0000 Received: by outflank-mailman (output) from mailman id 1045787.1416077; Wed, 16 Jul 2025 21:22:38 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uc9aI-0001bl-Dc; Wed, 16 Jul 2025 21:22:38 +0000 Received: by outflank-mailman (input) for mailman id 1045787; Wed, 16 Jul 2025 21:22:35 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uc9aE-0007F7-U3 for xen-devel@lists.xenproject.org; Wed, 16 Jul 2025 21:22:34 +0000 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on20613.outbound.protection.outlook.com [2a01:111:f403:200a::613]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id fae5e158-628a-11f0-a319-13f23c93f187; Wed, 16 Jul 2025 23:22:31 +0200 (CEST) Received: from CH2PR10CA0023.namprd10.prod.outlook.com (2603:10b6:610:4c::33) by DM6PR12MB4354.namprd12.prod.outlook.com (2603:10b6:5:28f::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8922.39; Wed, 16 Jul 2025 21:22:27 +0000 Received: from DS3PEPF000099D9.namprd04.prod.outlook.com (2603:10b6:610:4c:cafe::aa) by CH2PR10CA0023.outlook.office365.com (2603:10b6:610:4c::33) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8943.20 via Frontend Transport; Wed, 16 Jul 2025 21:22:27 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by DS3PEPF000099D9.mail.protection.outlook.com (10.167.17.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8943.21 via Frontend Transport; Wed, 16 Jul 2025 21:22:27 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 16 Jul 2025 16:22:26 -0500 Received: from fedora.mshome.net (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Wed, 16 Jul 2025 16:22:26 -0500 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: fae5e158-628a-11f0-a319-13f23c93f187 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=JYpy9owhui4bKpBqu/0rhQrjZSYZ62xLiTeN1Lc/fpTLFQpMmPcTeYZJTW7RGTkY57YeQv6lBf+07GwY6Q4/G/vRCMDKhgwfFEM7dkHhTR/SNDDKbWwf+KmGZ3NSGjYe6omiVM1hJJoAD3GPSkhZqxc1rQtSiGkFjjmHaaLUHW6pjPLoiuCHG2iIhuygU2K/bolBhpg7/1A7N3VhQEWZAfWt8fEXLh1+MGCgv8sDDTMVBCeINNSRctjW5xutwoHpM5O4btAwJgQqmSccgkRT0GOAqGh083xk2x9CpL7JttRNcYWP+TZMnA6RAXYvpTdHSiSwYNnKtqXVbAENiWC71A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=ntmVC9IWFJ5GNC3GzC1iMcc39AzLXNBTd/6KxHvgHN0=; b=d9DtBpXOBtRT8uJO41lYx/T0reUR9U/ZeRLV9xBwzw6a/FQRxQPGkmTimLCbGEfDuJAudk0t/gNdgnvc6E19bLzs8igHxRnyNeBBPvWCANfA05fBMq7tNPJ2xD1gNcyWQdSCKhCxFzS30Ux/5TxgzJnpkN1rCaLJ6S+KqLZkhBR3s4pO9tvFlBwMQy6TClBigAlCcnDReQc8IAuOQxED+u4aXsVLwmnRG7LGe4ymbQKSbB+cjMJhhyDop86F90/UuZldL2+xbM+CeXxOs4KFdauYzrtPxIf8v4mLo9yT16gze28VBU0aUVfkOTLt5PnWVp7GhNhLBMJEclaLXpsamg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ntmVC9IWFJ5GNC3GzC1iMcc39AzLXNBTd/6KxHvgHN0=; b=aFITiXfGnsjYXnHGEdCvSoJqQUh++edsfnweakCREzPhn6FH2zE6PNj6SKuyOurvOhXNTAbXfjUElWii6Ds5Ic1Ybp+brg+aAO+MC1l6mNxjjaI633Sr4nk5RBFATiar7NVlLYuheoNvI/hU2yXLD6O1aO1Qfq4K2gShaiUqECI= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C From: Jason Andryuk To: CC: Jason Andryuk , Anthony PERARD Subject: [PATCH v2 17/17] tools/init-dom0less: Continue on error Date: Wed, 16 Jul 2025 17:15:04 -0400 Message-ID: <20250716211504.291104-18-jason.andryuk@amd.com> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250716211504.291104-1-jason.andryuk@amd.com> References: <20250716211504.291104-1-jason.andryuk@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: None (SATLEXMB04.amd.com: jason.andryuk@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS3PEPF000099D9:EE_|DM6PR12MB4354:EE_ X-MS-Office365-Filtering-Correlation-Id: 09a37be6-1664-4cae-a45a-08ddc4aedd58 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|82310400026|36860700013|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?43KGu63Hvfxn20CVQjxu6D0/lW9JrJH2d9NjZb/QzAIDhjOZLQrHF2Sldlrv?= =?us-ascii?Q?W+mdxiBAo4s/zvAlK7JKSeiI3gI/SLN4Re4OsErWxh/4i68ExYckwcF0eTNR?= =?us-ascii?Q?obiQ6IlYq9CwEgB3310kVxIE5T8PKjwUz3CzsC1ONUwfVoC6GVJeNTzA8yuv?= =?us-ascii?Q?2G97kQ1qq9lF5kz4in530ImV1juPKQgjKEG2BRthQ1ZLP4o9MhmapHkpGdEC?= =?us-ascii?Q?0DpDD+BhbEyXYAS8kjuXo2yZmHEv9At42QX46hGGS9g8NUobEKkf5EIHrd5u?= =?us-ascii?Q?wGUz+BXLE8siC2ylDPFWzu3Bsl3A4v1YMsRL0wiU3SgwhO3GPHq9ACOZIeD8?= =?us-ascii?Q?vIm7Ztl/BP/cK5smbh+OcD3N91uR2xW7D+0pmfnv8iZgtDgL1DCsphFEbN0H?= =?us-ascii?Q?Gq8BaGRHssQ3ouDVh+VyqVyHtxYoHRqr2qK9xsukHSOihkQXRn10s+QxwqkI?= =?us-ascii?Q?H+kbKVhavhI9Rr7CNIO9cTkydN0pObBsDIk1gSWLs0t4edKRGuPO/R6CJXZ8?= =?us-ascii?Q?n68Glgh/9y8yJbcXS5Th5ncVzxnRlhMZ1KJM9McsoK90H8doWBXvtNaSCCNe?= =?us-ascii?Q?yA0evKRdxp7UcNp2W0sivIvRQdRmEdKMpnRDlmr0lObxLxe4gbWdEXjvtaPN?= =?us-ascii?Q?Dw6CIhuV7F3XqX6mMQlMzkWDWWnR83DTnRwWenYmhLHfxEKOEi8odQC7blEy?= =?us-ascii?Q?VqROIGK7DGtq/50qKL3+ly5Nnx9MmhFCmkBAYgo3nJJx8h8kDhEliuykg5Xk?= =?us-ascii?Q?RKJR7Md3x8jKDHm0BQj82D9gl5tXEhgeft4UwR8MfUF/stCPB9mY+RCf6HGE?= =?us-ascii?Q?CsgZo/ArbhNNw+yF6Armm2uZHLrfDc/EaKeoTJfDMEZzLa5F2VlIOZwxOG4x?= =?us-ascii?Q?oTFbptQ6r2MbEbs1fpQTrDLWEjxWPOUFqdPrXCw2cTKyrmEjO5bG8mbahMCQ?= =?us-ascii?Q?sasauMJ7Vc8PG0WvSxAV0q3iK1y66FV5pTGPVOgRvB6ajovO7WP6oo2eB5w2?= =?us-ascii?Q?StLK7GvYNBAm2pEE8k8JI6cLahvTSnRS+edA4TZLMLCfspqIH0lGQd7C8hGA?= =?us-ascii?Q?2mFRcVofajkySJS2TCGNUhFUVunZzScZFlmIZgAoZUM8rhTDpcVdnGzuKHxR?= =?us-ascii?Q?1z0Xl9wDdvyHGo9vl/FdNWb8Uh0SCEnKjYXpmJCZToT8rmCwRDkAVbu8rEPZ?= =?us-ascii?Q?SX/Xf6kqULQUGW9HfmUDT7oLUbJ7sAj+aRcJtznq6awXyrxWJNfSYdMAN2Zr?= =?us-ascii?Q?9oS9tFZhrzxkGMiHjHFUh2A+Z5bXpQkqMiWrX0aa2lV0HCICbRSCzB1qkmCY?= =?us-ascii?Q?Mk2kjCmUbNLYEvwA711wGq61EuE3qRNde+2PjDesqHk96e9m5cSwXGPPOYkB?= =?us-ascii?Q?cK/Hha4aFPjkHTB7EeLRItNGfAJY4f9EsU3Rc02W4Pm7mD9FgAHI4ocme7Up?= =?us-ascii?Q?GvpicsI01BDh6hUT6QmVY6r8vDgKnmJuuI6kuBnBl6sfEvDHXCGhJq0Zb4W9?= =?us-ascii?Q?G8HSc4/bSZQHF/WhHhvnZzx2bMZFuXaBM36P?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(82310400026)(36860700013)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jul 2025 21:22:27.2610 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 09a37be6-1664-4cae-a45a-08ddc4aedd58 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DS3PEPF000099D9.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4354 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1752700975948116600 Content-Type: text/plain; charset="utf-8" An error on one domain doesn't apply to others. Continue the loop over all domains if init_domain() fails. Signed-off-by: Jason Andryuk Reviewed-by: Stefano Stabellini --- tools/helpers/init-dom0less.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/helpers/init-dom0less.c b/tools/helpers/init-dom0less.c index 4336e0f418..bd213c5ccd 100644 --- a/tools/helpers/init-dom0less.c +++ b/tools/helpers/init-dom0less.c @@ -377,7 +377,6 @@ int main(int argc, char **argv) rc =3D init_domain(xsh, xch, xfh, &info[i]); if (rc < 0) { fprintf(stderr, "init_domain failed.\n"); - goto out; } } out: --=20 2.50.0