From nobody Fri Oct 31 09:50:36 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=1756242580; cv=pass; d=zohomail.com; s=zohoarc; b=U6K/bbrl9zvX4ZHM5cKc56XTJXnE8NYDxKJY25La2clckAhmvS5JuBSaX0R6ngQm1XHNvvJKyrgBf2Zs+3zBkQK/YyHFPbzP4EsCtqArS9xeq1cVwDQ22iLirHUw28mCG6WgFXvA8XWH6nh/YCCA0/3xJh04i40Z/RDBcS7KUqY= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756242580; 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=kx6d34oYfnXViK0Sv04HljBO4lYFdDa8TSdzHSfLUho=; b=HA3sJDo7hJOpdePF9q8qHT7CVYboQVfTeYzqimscE0BQeJvf2kjGHCSyW+LD0kdl11aw8vPWutfGhBhI1z+kA4/fiiq58yALI9oN16M0vaUt/tDErYhdo+rkvQ3kAA71NwutNlwMRGAu8NM2TOhUaqeg20ZhJqa6OyWojN5fILk= 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 1756242580167645.996967070298; Tue, 26 Aug 2025 14:09:40 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1095132.1450275 (Exim 4.92) (envelope-from ) id 1ur0uq-0007F8-0O; Tue, 26 Aug 2025 21:09:16 +0000 Received: by outflank-mailman (output) from mailman id 1095132.1450275; Tue, 26 Aug 2025 21:09:15 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ur0up-0007Ex-Rl; Tue, 26 Aug 2025 21:09:15 +0000 Received: by outflank-mailman (input) for mailman id 1095132; Tue, 26 Aug 2025 21:09:14 +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 1ur0uo-0006z4-Qg for xen-devel@lists.xenproject.org; Tue, 26 Aug 2025 21:09:14 +0000 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on20621.outbound.protection.outlook.com [2a01:111:f403:2415::621]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id e9e779fd-82c0-11f0-b898-0df219b8e170; Tue, 26 Aug 2025 23:09:12 +0200 (CEST) Received: from MW4PR03CA0244.namprd03.prod.outlook.com (2603:10b6:303:b4::9) by SA1PR12MB7272.namprd12.prod.outlook.com (2603:10b6:806:2b6::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9052.21; Tue, 26 Aug 2025 21:09:08 +0000 Received: from MWH0EPF000989EA.namprd02.prod.outlook.com (2603:10b6:303:b4:cafe::52) by MW4PR03CA0244.outlook.office365.com (2603:10b6:303:b4::9) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9073.13 via Frontend Transport; Tue, 26 Aug 2025 21:09:08 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by MWH0EPF000989EA.mail.protection.outlook.com (10.167.241.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.9052.8 via Frontend Transport; Tue, 26 Aug 2025 21:09:07 +0000 Received: from Satlexmb09.amd.com (10.181.42.218) 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; Tue, 26 Aug 2025 16:09:07 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by satlexmb09.amd.com (10.181.42.218) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.2.1748.10; Tue, 26 Aug 2025 14:09:06 -0700 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; Tue, 26 Aug 2025 16:09: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: e9e779fd-82c0-11f0-b898-0df219b8e170 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Mtnb+36F+PKJCuv41WOE5CV/4oQCwPSayAGOZ8oI5Yh1OlQudsn0olfTU4QcjxXYS+cNlm58CUJ2b7HM1o9vCGceOb/AlDIQQKYHgerjfqA+dyEztwp56ood7wZq0qUaLvTa8VfuZ7yWWuMoPYp73Yi1Y6huZByLpCurvshBD0g4e8hzxEDXsym/67zoz5gJGHYiKsmhb3fSIPPpWZ0myPMDo0RtsCBEJ5oC1VEXFQX7U9Te+p1udnVmxn52dcdJ+j5vcvrczJgwkRYOfagvAizJeICStMwi1Wx4JDpC1keQqo1++6zRF+eG07ns6x4inO9gwfD5DWwAu+PJKicllQ== 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=kx6d34oYfnXViK0Sv04HljBO4lYFdDa8TSdzHSfLUho=; b=Cb/LMQ0jEpvfn86xykziFoXXjU2d1AL95lv/uzrgXYo8/cj04bwPAgaFzjK76LEuw8byc6lFYDVvqWwD81QezrVAc74USoc6WNg7Zp9KCSZjyKOo0GAkFIJKvnB3VMCIRCBTQyntvzmbL10sn7S6D/yFPui6nvSHXH4dx1sZgNPQTMKuACkg8lq/v+La5Z07HkIXP8hP6awHaMCGlQ9/5aHqhB2dmx8oXrX3wLmB3sXriqf5oit1JukF/Rzwvxw0NsGMCjsl8mNiAk/zeACjnt9yW3zvdXvy9m+S06LfPm/BlRRjezZuHWDUoGCFVCHaR5dANuxIvktujmzzqtFoPA== 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=kx6d34oYfnXViK0Sv04HljBO4lYFdDa8TSdzHSfLUho=; b=CnxE2YWXq/dvxv0uXd0wRjXzhElL2Olbh7mECBQtoEne2E/StuUwuopfUijWe9ebh24n3dKiieokfEcQUaHwCfbFQhq74chNLaocnLaKU9Xsd2Xhw7S/SmZ1QrhmgtYJ6k0hhl48FMSoZxiW4o8viBqfVjeYXLgQpZeHnK5cadM= 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 v3 5/8] tools/init-dom0less: Use introduced to determine no-enhanced Date: Tue, 26 Aug 2025 17:08:44 -0400 Message-ID: <20250826210847.126015-6-jason.andryuk@amd.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250826210847.126015-1-jason.andryuk@amd.com> References: <20250826210847.126015-1-jason.andryuk@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000989EA:EE_|SA1PR12MB7272:EE_ X-MS-Office365-Filtering-Correlation-Id: 2c153865-c21f-4867-01f1-08dde4e4cbea 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?DevOs+34sWBhz5ldjCTN7HZvZ+G1EeQE/xeAtdylv54kotTyIeNV1cOFAt8m?= =?us-ascii?Q?4lyTro8mkN1r4Df9v3v38gJuqlVeMkqjawUnlasE+AyiAk3aXpyGn8fEf4TL?= =?us-ascii?Q?AbkdB7XHOUDySWeR82ccmQ1AQGnmaQpNdbhlr9L3Y1rx2LzvT5UQj+Rj4bdP?= =?us-ascii?Q?VykLPM2359czOK1zz+ZaHJUMEA/tW1GnvTdpLdDEDbHcW3rC0ev1HoZGsCfp?= =?us-ascii?Q?Xk+XoEQs1zZNoOHlE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ITJ2R6?= =?us-ascii?Q?+kptYHq+zXV8hPY6UjpLswyCUBvsOvxfkagRGeeKFMqNS2D5+B0idwHRQsPu?= =?us-ascii?Q?FTKWMZrWWNw2KnRb0Xd9TQS8qOyqw1ILoiBrDy7dh+ddGomZlJNookkgQ12x?= =?us-ascii?Q?D8etVd5aV+qblQbtXBQaZZasJ7areUtR2+U5vFdDgOkKRCO0Ru83NXiBBw85?= =?us-ascii?Q?+lFLAoSDypOYFXI7BRp2KrPWLQS2xVbDRaPnjbbfUseCdL9Wq9DmZr4ad/ZU?= =?us-ascii?Q?+vSD5KqDoeCMdMCAW2meChkqiUsu6hTuB9uIn4D8tFYQtiJPZeg5ATtps7cY?= =?us-ascii?Q?aFDGTdBtoUUcsoirVcWmhGL9rKC3XVdynncznSjd9KKpRoKS7qdlvAR/0hs1?= =?us-ascii?Q?Qm9c7LeVey8ifLtMXwWpiDpxXogwtfLQZKzU?= 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)(82310400026)(1800799024)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2025 21:09:07.9925 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2c153865-c21f-4867-01f1-08dde4e4cbea 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: MWH0EPF000989EA.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB7272 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1756242582422124101 Content-Type: text/plain; charset="utf-8" A hardware+xenstore domain will not be able to read HVM params, and init-dom0less reads HVM_PARAM_STORE_EVTCHN to determine whether or not a domain has xenstore. xenstored had a similar issue, and it just tries to map a domain's reserved grant, GNTTAB_RESERVED_XENSTORE, to see if it is accessible. If successful, xenstored introduces the domain. Use the existing introduced state to determine if init-dom0less should try and read the param. If already introduced, initialization (and reading the HVM_PARAM) is skipped. This allows for running init-dom0less from a xenstored+hardware domain. It relies on the local socket xenstore connections being considered privileged. oxenstored has not been updated, so the exist code remains for backwards compatibility. Signed-off-by: Jason Andryuk --- v3: New --- tools/helpers/init-dom0less.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/tools/helpers/init-dom0less.c b/tools/helpers/init-dom0less.c index eb793c7aab..a4de40aeac 100644 --- a/tools/helpers/init-dom0less.c +++ b/tools/helpers/init-dom0less.c @@ -309,16 +309,20 @@ static int configure_xenstore(libxl_dominfo *info, =20 static int init_domain(libxl_dominfo *info) { - uint64_t xenstore_evtchn, xenstore_pfn =3D 0; + uint64_t xenstore_evtchn =3D 0, xenstore_pfn =3D 0; + bool introduced; libxl_uuid uuid; int rc; =20 - rc =3D configure_xenstore(info, &xenstore_evtchn, &xenstore_pfn); - if (rc) - return rc; + introduced =3D xs_is_domain_introduced(xsh, info->domid); + if (!introduced) { + rc =3D configure_xenstore(info, &xenstore_evtchn, &xenstore_pfn); + if (rc) + return rc; =20 - if (xenstore_evtchn =3D=3D 0) { - return 0; + if (xenstore_evtchn =3D=3D 0) { + return 0; + } } =20 libxl_uuid_generate(&uuid); @@ -332,7 +336,7 @@ static int init_domain(libxl_dominfo *info) if (rc) err(1, "writing to xenstore"); =20 - if (!xs_is_domain_introduced(xsh, info->domid)) { + if (!introduced) { rc =3D xs_introduce_domain(xsh, info->domid, xenstore_pfn, xenstore_evtchn); if (!rc) --=20 2.50.1