From nobody Thu Oct 30 22:43:23 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=1753488011; cv=pass; d=zohomail.com; s=zohoarc; b=NJrHJOuPcPr6xpJoul0qyJq5jh3Hazlmfz0g0DU4oqvNRBn2tJY/jiy8J+f+xCi2djNHlosusCuAD+qyVx8up7IEYnbdGTT3N/K/xmW8wGDN9RUlwc8fBey+d90wud6jnUn/XR2pqg2ukWHhPlrcqdCVh1uWeeSXFdatFtygISU= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1753488011; 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=6qWkiKC5suZIzWW4U7EhVfJcFngSvVnzgyONjQcceXA=; b=h0FQHPHCnyDLj21A1OHkMh+Qe7srtyiEYkkLGqDPHO/ZzJCeEls/ZMiWea4fpHawrgayZPrtupYhcfsuAgGdCGH94YnrQVR9ANS1NeYqU8ffHPEqMpLsIxq0Zi6Y8BxLsXxQ1JILhxIygKMRMTrBPQmWswsunAIwJNXYcigzgk4= 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 1753488011000917.4021387550634; Fri, 25 Jul 2025 17:00:11 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1058727.1426286 (Exim 4.92) (envelope-from ) id 1ufSKJ-00011G-2Q; Fri, 25 Jul 2025 23:59:47 +0000 Received: by outflank-mailman (output) from mailman id 1058727.1426286; Fri, 25 Jul 2025 23:59:47 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ufSKI-00010K-SG; Fri, 25 Jul 2025 23:59:46 +0000 Received: by outflank-mailman (input) for mailman id 1058727; Fri, 25 Jul 2025 23:59:45 +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 1ufSKH-0007YZ-6d for xen-devel@lists.xenproject.org; Fri, 25 Jul 2025 23:59:45 +0000 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2062e.outbound.protection.outlook.com [2a01:111:f403:2009::62e]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 6ec65af6-69b3-11f0-b895-0df219b8e170; Sat, 26 Jul 2025 01:59:43 +0200 (CEST) Received: from BY5PR17CA0070.namprd17.prod.outlook.com (2603:10b6:a03:167::47) by MW3PR12MB4347.namprd12.prod.outlook.com (2603:10b6:303:2e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8964.22; Fri, 25 Jul 2025 23:59:38 +0000 Received: from SJ5PEPF00000206.namprd05.prod.outlook.com (2603:10b6:a03:167:cafe::e3) by BY5PR17CA0070.outlook.office365.com (2603:10b6:a03:167::47) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8964.22 via Frontend Transport; Fri, 25 Jul 2025 23:59:38 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by SJ5PEPF00000206.mail.protection.outlook.com (10.167.244.39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8964.20 via Frontend Transport; Fri, 25 Jul 2025 23:59:37 +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; Fri, 25 Jul 2025 18:59:36 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) 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; Fri, 25 Jul 2025 18:59:36 -0500 Received: from fedora.mshome.net (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Fri, 25 Jul 2025 18:59:36 -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: 6ec65af6-69b3-11f0-b895-0df219b8e170 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=lXFBJlqFEQEC+sjEBt6TKIi0UKO4Zu7k0gearcymzO3GwNmT8oBxHwNPis3xitWQylAkMzYUVPL32l/Z9aJVSGWmpqlVO+SHuKV1OHuwc1MjRIQPTgjlBzFrAWqEYc1TWYQxYxq4W0mk+mqBtGTsbTIWX4nq3s8jSrg+Ttmd8Sm+hQXVz5cR1IG+kIzCetpEpxP7TMD0euF9j4rmPP4pOIX83WjLG1tHutqdhAatbF2gWeyA1BihXrZE2amwD5LAhTgCLPHlq3UyoGmlPIGBpSYA5CznP73RM1lzMmFdpZXtqwDrJrlE7cgZJESvh15PwEzXnfQ1I5UbLB5cBT97TQ== 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=6qWkiKC5suZIzWW4U7EhVfJcFngSvVnzgyONjQcceXA=; b=EF10HaPuVoO73IbBqk5ygDDZq7rSOk/jNYkLpH80iCKqGfe7dXBnfhZ9DjgVqWDlwl3ee9O0MTkeXAXJG8/NwpOvaGzfQ2u2pfmqplgYmCdvw6k8RBeS/GllPX2+Itx6GckMr3Zz/XjHMVmBEh+aZSlFKhDGrtCFHeCDf7KBXGhqzK4OELzsXXeky4YH9QYL+5DCHck+6DeguGARINwRyGbPGjD/7jqu40+JXpYIvDn7Orx4IycGsCs3QNLqy1hxBj+bB4Gp07F3xoS1DNX45sGg1n+KbZLkLeI5QbVntoz4XlhZCWCkr3Bs8pPlTwswPqApIhcEQRH77wOKGXr9ow== 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=6qWkiKC5suZIzWW4U7EhVfJcFngSvVnzgyONjQcceXA=; b=Lqk+14reOcndAalIIcfWW5bYU5WIZ+/HiHOUDhdGZ9uQqBokd+VGBnJHd6p5mDzz3C8bIBTEKvUDV2cu/0PC9VxpM8A6dqLO/6R33d92PWzieqoyKQVEtWgKzLY3LCFckx+kjS/oPDbRsJdGM1AKLgp29WFW0tqQMQnf5PAdEds= 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 v5 08/11] tools/xenstored: Use priv_domid for manual nodes and permission Date: Fri, 25 Jul 2025 19:58:55 -0400 Message-ID: <20250725235858.666813-9-jason.andryuk@amd.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250725235858.666813-1-jason.andryuk@amd.com> References: <20250725235858.666813-1-jason.andryuk@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ5PEPF00000206:EE_|MW3PR12MB4347:EE_ X-MS-Office365-Filtering-Correlation-Id: d9b60338-4d52-4487-3821-08ddcbd75006 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|82310400026|36860700013; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?3Y8DBQu1QtYKePLvC3l5VvMSaLPaUa/7WaEDHT3fbvHMSLQDZSoWR1pj90+Z?= =?us-ascii?Q?SJgzdzAYJyL/uR6CPXRkd+efahBVUbE26Zlc3dRrPvlr5aIYpNVqE+3qI3f0?= =?us-ascii?Q?BW3WbXmbacxIQ7TcotZHUQTKXiTmst1ImC11nDWnkfOu3Z54uDqEk2wD7olO?= =?us-ascii?Q?RKY0NKuHW7C7iVxKE/DvJenhK8xWAf6qEgeR8msMWoxyIi18NSj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6+bFFEXoJbB3MYNgnP7LzeL2G8eS?= =?us-ascii?Q?uaoi5ALXAtGXv0SE/Uags6Na9nzqyRElOJwh6pBPKxi2wsM3div0ncIOUZaH?= =?us-ascii?Q?EKMQQtwdy/zhsgxgLRCjTdoO+D96U4AFF/0duJzvHKGvD14c8AIPXLsIoJWi?= =?us-ascii?Q?Ud8zUUsCryhKGQ37eIO1ZmV1CQnwbciXzt890qndHBMM+rqvoepky4KCFL90?= =?us-ascii?Q?phaVf6XAR7FWKA9cE4c7iMn6Da0ZIxozRjmJBlUS82ehZKUh4XfKRY7x8yAF?= =?us-ascii?Q?hj36pElHonzd3IG23qh9jR1aTOzzY9XUSeVc32mMIfLQZ0jxLTnTKxvlJEbg?= =?us-ascii?Q?3WJRT4WXT3xT4+7Yb+bTLbG9Fo3S7qYZqN4if8WjD+aSbeQSnn2fMhaE5an1?= =?us-ascii?Q?yPfwXxuU9klYxAQdGrGZe6Smas2C5rL5XA18?= 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)(376014)(1800799024)(82310400026)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2025 23:59:37.6127 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d9b60338-4d52-4487-3821-08ddcbd75006 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: SJ5PEPF00000206.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4347 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1753488012311116600 Content-Type: text/plain; charset="utf-8" Usually, priv_domid =3D=3D dom0_domid =3D=3D 0, and that is what is expecte= d. If we rename s/dom0_domid/store_domid/, it seems more likely we want to actually have the priv_domid as the owner. That leads to follow on changes to ensure that the priv_domid is created first. If priv_domid is unset, set to dom0_domid to have a functional xenstored. Signed-off-by: Jason Andryuk Reviewed-by: Juergen Gross --- Held off R-b Juergen because of priv_domid setting v5: Add unset priv_domid setting Additional change for continue check inside the loop --- tools/xenstored/core.c | 4 ++-- tools/xenstored/domain.c | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tools/xenstored/core.c b/tools/xenstored/core.c index dbf3548a8e..098958f611 100644 --- a/tools/xenstored/core.c +++ b/tools/xenstored/core.c @@ -2266,7 +2266,7 @@ struct connection *get_connection_by_id(unsigned int = conn_id) static void manual_node(const char *name, const char *child) { struct node *node; - struct xs_permissions perms =3D { .id =3D dom0_domid, + struct xs_permissions perms =3D { .id =3D priv_domid, .perms =3D XS_PERM_NONE }; =20 node =3D talloc_zero(NULL, struct node); @@ -2317,7 +2317,7 @@ void setup_structure(bool live_update) manual_node("/tool/xenstored", NULL); manual_node("@releaseDomain", NULL); manual_node("@introduceDomain", NULL); - domain_nbentry_fix(dom0_domid, 5, true); + domain_nbentry_fix(priv_domid, 5, true); } } =20 diff --git a/tools/xenstored/domain.c b/tools/xenstored/domain.c index 5e53fe8736..94cbe81ca5 100644 --- a/tools/xenstored/domain.c +++ b/tools/xenstored/domain.c @@ -1014,7 +1014,7 @@ static struct domain *introduce_domain(const void *ct= x, struct domain *domain; int rc; struct xenstore_domain_interface *interface; - bool is_master_domain =3D (domid =3D=3D xenbus_master_domid()); + bool is_priv_domain =3D (domid =3D=3D priv_domid); =20 domain =3D find_or_alloc_domain(ctx, domid); if (!domain) @@ -1037,13 +1037,13 @@ static struct domain *introduce_domain(const void *= ctx, } domain->interface =3D interface; =20 - if (is_master_domain) + if (is_priv_domain) setup_structure(restore); =20 /* Now domain belongs to its connection. */ talloc_steal(domain->conn, domain); =20 - if (!is_master_domain && !restore) + if (!is_priv_domain && !restore) fire_special_watches("@introduceDomain"); } else { /* Use XS_INTRODUCE for recreating the xenbus event-channel. */ @@ -1311,22 +1311,22 @@ void init_domains(void) } } =20 - if (dom0_domid =3D=3D DOMID_INVALID) - dom0_domid =3D priv_domid; + if (priv_domid =3D=3D DOMID_INVALID) + priv_domid =3D dom0_domid; =20 - if (dom0_domid =3D=3D DOMID_INVALID) + if (priv_domid =3D=3D DOMID_INVALID) barf("Could not determine xenstore domid\n"); =20 /* * Local domid must be first to setup structures for firing the special * watches. */ - if (init_domain(dom0_domid)) + if (init_domain(priv_domid)) introduce_count++; =20 for (unsigned int i =3D 0; i < nr_domids; i++) { domid =3D domids[i]; - if (domid =3D=3D dom0_domid) + if (domid =3D=3D priv_domid) continue; =20 if (init_domain(domid)) --=20 2.50.1