From nobody Thu Oct 30 19:02:29 2025 Delivered-To: importer@patchew.org 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; 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=epam.com); dmarc=pass(p=quarantine dis=none) header.from=epam.com ARC-Seal: i=2; a=rsa-sha256; t=1753279538; cv=pass; d=zohomail.com; s=zohoarc; b=MxeCJmq0B6mHrt7c5URM7Y9T2GSl1JggVnrt/1ve68EduCTj9BjwEJf3L0qmzhKX8S7rGC9BxYenK4ZWb+Ij4gx0FJ4zzXajqNJQIrHd3s0YwGqRcirvUq6oIWlt5i6kBX0XXIb2qRyLlPGz7M1VZ595aLDN3OlUcsjaqAJs1cU= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1753279538; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=f25BCZqkQ9KD/wLSPZn0jCltSm3NlTccOVs+VBiyTvE=; b=eeRDcRDz1kix2T/YpmOJvm0b4gV28jhDUjQVG6uMYUm+gMcGXXuXAIvRsRe3DsRE1VbJCkalyUtGyf4OshOs8NLNb5idkjtNBTz9brHRBVcy9qapvm5UsvzpgeT2BRlBPW94waXBqYY75rWBrLyXjYwDY+hfVyCCYcKPGk8lD/Q= 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=epam.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 1753279538144699.3901847714468; Wed, 23 Jul 2025 07:05:38 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1054173.1422909 (Exim 4.92) (envelope-from ) id 1uea5r-0002Va-Um; Wed, 23 Jul 2025 14:05:15 +0000 Received: by outflank-mailman (output) from mailman id 1054173.1422909; Wed, 23 Jul 2025 14:05: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 1uea5r-0002VT-QW; Wed, 23 Jul 2025 14:05:15 +0000 Received: by outflank-mailman (input) for mailman id 1054173; Wed, 23 Jul 2025 14:05:15 +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 1uea5q-0002VN-VB for xen-devel@lists.xenproject.org; Wed, 23 Jul 2025 14:05:15 +0000 Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazlp170110003.outbound.protection.outlook.com [2a01:111:f403:c201::3]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 0d930695-67ce-11f0-a31d-13f23c93f187; Wed, 23 Jul 2025 16:05:13 +0200 (CEST) Received: from PAVPR03MB8946.eurprd03.prod.outlook.com (2603:10a6:102:32e::21) by AS1PR03MB8173.eurprd03.prod.outlook.com (2603:10a6:20b:4c7::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8964.21; Wed, 23 Jul 2025 14:05:10 +0000 Received: from PAVPR03MB8946.eurprd03.prod.outlook.com ([fe80::f12d:7394:bbe3:dfc]) by PAVPR03MB8946.eurprd03.prod.outlook.com ([fe80::f12d:7394:bbe3:dfc%6]) with mapi id 15.20.8943.025; Wed, 23 Jul 2025 14:05:10 +0000 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: 0d930695-67ce-11f0-a31d-13f23c93f187 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=YIlrDd4XSJP41Nkw2/KY/LiCQM8VDp8wHEVXeFb5WuP14eKdPqk4hV1k/Y8YYbOsPPQ6ZSGU0SIgd5ldmay3+MPoR6TOnT6Qk4tjVFfeKtbgUqUWVvp+QEBurvLuVhLfSAEXoD1zYhqYMI3r/R0y6inK8+WkeUKrQNApbbmwct1fJj/ZPAa+sdpuNbvmfeWvRjGAF46FLUEnuGO63osq3/+l4j1vGT3taZOoXg3rkCs/fe1XCsYqHq55oy4S0br9a+jpQc//0PEdS7E3jAGA4qTRqtnyKqXljCfGb1rJnHxdvU+zkC3eX5AlxQzcW3wO79ehH7CM9Vfk7xE5cQe7cQ== 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=f25BCZqkQ9KD/wLSPZn0jCltSm3NlTccOVs+VBiyTvE=; b=tsrMZ2mxd6d8GrDevB5Q3kW0df7k19fdR/O9AQpeaU5z1IC+8cQt1cJu0ZztYDKm6W226BBGAtOGdJIbIEpI6ffOtv8+sewqVj9Mw1IpzV/VDbi7aBbTeu5t1RgwWzo5+YnyqgAUNVt/3OSnDm3Tr+al/WTNf0n45mFGx5QeBa8WrE4gnMNGSxvmkgDkHL+dQZ7qJS32guyK7F/UwWt3mcXtXnn1tWVxlDb2iLRHwWbSSb6VSSKeJzkJkBL+RI66u3MkwambQ1LpLoOd9INMbw6OQTPcilo388MVhvemClsgH4twNlNAnmEPQWaYjmJ5za0dZ5hvYon6hAdxbTkgUg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=f25BCZqkQ9KD/wLSPZn0jCltSm3NlTccOVs+VBiyTvE=; b=QqmWjUb489yhe4LUV7sc9y8aRta1dajNVOjqo8owLhDpxE4kAjwJLgeJVTrEEuqbmCCzpAVvfJ4qgIlLulJxCi5Zm1vAf7VC8knFT0CA8ZZpvB6rWjL04hi3L/9QzDsYJCrJFUzaClUHqXh7zSCeaT4NMpYDYduPHiQvAV57dEueKCJ+07QF6vcBsSeQYBgsmNR39nLYk/4Uy6UyRTxj+MnXvQ2pICmck0rMNZO+7wTRZLgBrsg8+4g20QnFUJNTQ5qWsb6D/napC0AWBwfSP9Srui9b0wo+ckkyLeptFgzSAjaIWqZkLzocvwyngUKKIhA6JbFBtjJ6LKb+GKpSyQ== From: Oleksii Moisieiev To: "amd-xen-safety@groups.io" CC: Andrew Cooper , Anthony PERARD , Bertrand Marquis , Jan Beulich , Julien Grall , Michal Orzel , =?iso-8859-1?Q?Roger_Pau_Monn=E9?= , Stefano Stabellini , Volodymyr Babchuk , "xen-devel@lists.xenproject.org" , Oleksandr Tyshchenko , Oleksii Moisieiev Subject: [PATCH] xen/arm, xen/common: Add Kconfig option to control Dom0 boot Thread-Topic: [PATCH] xen/arm, xen/common: Add Kconfig option to control Dom0 boot Thread-Index: AQHb+9rNCD0pdC1VhE+OyU7cYZL/lw== Date: Wed, 23 Jul 2025 14:05:10 +0000 Message-ID: <9c1169345d916cb542bf3f28ddf854f6308a402a.1753279365.git.oleksii_moisieiev@epam.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PAVPR03MB8946:EE_|AS1PR03MB8173:EE_ x-ms-office365-filtering-correlation-id: 86b47b7d-d03e-41c3-4eb0-08ddc9f1efb4 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|7416014|1800799024|376014|366016|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?Q?UP3j2TLAAQwQmc3Y6jXCp7DeyAPT4T+xOigi/I+hkmnM1vsTTFC+VQExi4?= =?iso-8859-1?Q?tyvB1AXUUlPEEgKH65aHVQe7BY/FR4JcLuTws/jb274INGIGjr9Ldj11MY?= =?iso-8859-1?Q?hBsIZrHo0WGnqXCvrgGcK0Hl0bs6X0q1ZjaaJ99x7Mw10aCwF+vXrxSSxm?= =?iso-8859-1?Q?6QpCHkEeDOsRfK3EYLsHEjG2NVG04uDjBlV9Jh/tag3JUL+XMxhISzvsAH?= =?iso-8859-1?Q?aYZDH1OkE7bg1onnPxrGqkY61NhyeAEeSIHPnp8+3kj9brVIAQH/mQ2ELN?= =?iso-8859-1?Q?K/OcB8rc4u/8EHrS9dS3jWIqhrNP0YsIsk5W2Qelh9P3ICaUjlDXI90+n+?= =?iso-8859-1?Q?EqDJvl/uEOxc78mjwaB9b83wyEuqeIS+ga3RE1MoA/3umggV/hPy4fZ94a?= =?iso-8859-1?Q?UQiWJnsGSCv8QKD+mdKZxXzL1MkGNSnO+cG+hOUYAhlv5ky80GBkz6K1zZ?= =?iso-8859-1?Q?y8tPCufH/TeuOnk+Aphk++0FHrqsD/ccjk2IXmKz556qZFYWEI+jWPIu8h?= =?iso-8859-1?Q?Tz5qL4vuHppvaGzQKSuW1hyuYR0I8NTR2SEsymGVQoHYAOjkrSus9+CLkL?= =?iso-8859-1?Q?b3Y0LR13UN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FzOsZGPo/n9?= =?iso-8859-1?Q?JQQ5I8jHagonYFqIc5dYi1CWrBFukfqxxtt7N/UwrXfQ=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAVPR03MB8946.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(1800799024)(376014)(366016)(38070700018);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?Dofx72Bh+3PCiTevFpd+/un3pqzpEVzEwpa4LdlENycK324kXS3WtxrH96?= =?iso-8859-1?Q?o9fYB/gAj1/LJBYUA1XsiJmIzmMPhaeGpPWsMUcYEr7yoHhPGDocxGxW1k?= =?iso-8859-1?Q?bEPSW3YqaAQ73oMuDCZBHTSiT1sMUqjcDO3liL+e/dcl2+Ef8hBDuyRw/I?= =?iso-8859-1?Q?Rnap1ox99tCRT5J2W7AHE06c7xLCRP9flsOeBVDeieNR8ItMedwExegRo8?= =?iso-8859-1?Q?xAprRldN8PfTjhoNxe0lUtRfSmdIzxtaIWEdQdBxX95vJtA2o3Q6UplfIl?= =?iso-8859-1?Q?BGTrWnABUj3NnGiqXddDjDt5Ze5SN9ebsfduJlCkztYvwoOdZ3tK1hxXd/?= =?iso-8859-1?Q?ZD/rhInD0rt0rGlG4leGgUhIWuf8tCQmU+Rdcm0JVNeeY+0y90ClbGoqRq?= =?iso-8859-1?Q?PKBcJ8Lqrc2MkhJqW5dWrs84KcCujYUKI1QRpKStpHT+gt3YF2n7ziArzG?= =?iso-8859-1?Q?fRjEyAwPmxqGLIqKWYl6R0Oy0hgHXA/veqD5oDHH6u3KY9NxNExSWpXIkW?= =?iso-8859-1?Q?UsgSZfi5xh3qaQU4uKWXvbAuqqNfzYlU/mQ3ZmksWtRlN3U59nOXkKF4AJ?= =?iso-8859-1?Q?nbBiviZvKky2iCYw3VIs6/TV99juIs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Pv5Cah19DGEVnlRs8+BSHWBB1yNwK5zSvMHn8K1fRmYOKplCUcfHz4w5?= =?iso-8859-1?Q?FdpVISW7N8+h1ea9yQAZe7o3OqMIVgF0U28VZE2cS9bIGSscM2ZnZgitBs?= =?iso-8859-1?Q?C5pKCuZrySrXx+xXm2u/Qa2SiqXAkY53pP2hLon29j9AMCEGjqfraDMw?= =?iso-8859-1?Q?=3D=3D?= Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: epam.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PAVPR03MB8946.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 86b47b7d-d03e-41c3-4eb0-08ddc9f1efb4 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Jul 2025 14:05:10.1840 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: oznU9kls5/UM0xWIbg9SrRXEGiz5hIUVxcenV2Gm3pFgNFe1qtT4kZToDmbPws9l/iehGPlV7r2EICqvOvSPm19KbhOFeuek2dJfzf/T3+Y= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1PR03MB8173 X-ZohoMail-DKIM: pass (identity @epam.com) X-ZM-MESSAGEID: 1753279539498116600 Content-Type: text/plain; charset="utf-8" This commit introduces a new Kconfig option, `CONFIG_DOM0_BOOT`, to allow for building Xen without support for booting a regular domain (Dom0). This functionality is primarily intended for the ARM architecture. A new Kconfig symbol, `HAS_DOM0`, has been added and is selected by default for ARM architecture. This symbol signifies that an architecture has the capability to support a Dom0. The `DOM0_BOOT` option depends on `HAS_DOM0` and defaults to 'y'. For expert users, this option can be disabled (`CONFIG_EXPERT=3Dy` and no `CONFIG_DOM0_BOOT` in the config), which will compile out the Dom0 creation code on ARM. This is useful for embedded or dom0less-only scenarios to reduce binary size and complexity. The ARM boot path has been updated to panic if it detects a non-dom0less configuration while `CONFIG_DOM0_BOOT` is disabled, preventing an invalid boot. Signed-off-by: Oleksii Moisieiev --- CONFIG_DOM0_BOOT Kconfig option was introduced to make the Dom0 regular (legacy) domain an optional feature that can be compiled out from the Xen hypervisor build. The primary motivation for this change is to enhance modularity and produce a cleaner, more specialized hypervisor binary when a control domain is not needed. In many embedded or dedicated systems, Xen is used in a "dom0less" configuration where guests are pre-configured and launched directly by the hypervisor. In these scenarios, the entire subsystem for booting and managing Dom0 is unnecessary. This approach aligns with software quality standards like MISRA C, which advocate for the removal of unreachable or unnecessary code to improve safety and maintainability. Specifically, this change helps adhere = to: MISRA C:2012, Rule 2.2: "There shall be no dead code" In a build configured for a dom0less environment, the code responsible for creating Dom0 would be considered "dead code" as it would never be executed. By using the preprocessor to remove it before compilation, we ensure that the final executable is free from this unreachable code. This simplifies static analysis, reduces the attack surface, and makes the codebase easier to verify, which is critical for systems requiring high levels of safety and security. --- xen/arch/arm/Kconfig | 1 + xen/arch/arm/domain_build.c | 8 ++++++++ xen/arch/arm/setup.c | 14 ++++++++++---- xen/common/Kconfig | 11 +++++++++++ 4 files changed, 30 insertions(+), 4 deletions(-) diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig index bf6d1cf88e..29399183e8 100644 --- a/xen/arch/arm/Kconfig +++ b/xen/arch/arm/Kconfig @@ -19,6 +19,7 @@ config ARM select HAS_ALTERNATIVE if HAS_VMAP select HAS_DEVICE_TREE select HAS_DOM0LESS + select HAS_DOM0 select HAS_GRANT_CACHE_FLUSH if GRANT_TABLE select HAS_STACK_PROTECTOR select HAS_UBSAN diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index ed668bd61c..9b8993df80 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -40,8 +40,10 @@ #include #include =20 +#ifdef CONFIG_DOM0_BOOT static unsigned int __initdata opt_dom0_max_vcpus; integer_param("dom0_max_vcpus", opt_dom0_max_vcpus); +#endif =20 /* * If true, the extended regions support is enabled for dom0 and @@ -102,6 +104,7 @@ int __init parse_arch_dom0_param(const char *s, const c= har *e) */ #define DOM0_FDT_EXTRA_SIZE (128 + sizeof(struct fdt_reserve_entry)) =20 +#ifdef CONFIG_DOM0_BOOT unsigned int __init dom0_max_vcpus(void) { if ( opt_dom0_max_vcpus =3D=3D 0 ) @@ -114,6 +117,7 @@ unsigned int __init dom0_max_vcpus(void) =20 return opt_dom0_max_vcpus; } +#endif =20 /* * Insert the given pages into a memory bank, banks are ordered by address. @@ -1953,6 +1957,7 @@ int __init construct_domain(struct domain *d, struct = kernel_info *kinfo) return 0; } =20 +#ifdef CONFIG_DOM0_BOOT static int __init construct_dom0(struct domain *d) { struct kernel_info kinfo =3D KERNEL_INFO_INIT; @@ -1984,6 +1989,7 @@ static int __init construct_dom0(struct domain *d) =20 return construct_hwdom(&kinfo, NULL); } +#endif =20 int __init construct_hwdom(struct kernel_info *kinfo, const struct dt_device_node *node) @@ -2037,6 +2043,7 @@ int __init construct_hwdom(struct kernel_info *kinfo, return construct_domain(d, kinfo); } =20 +#ifdef CONFIG_DOM0_BOOT void __init create_dom0(void) { struct domain *dom0; @@ -2089,6 +2096,7 @@ void __init create_dom0(void) =20 set_xs_domain(dom0); } +#endif /* CONFIG_DOM0_BOOT */ =20 /* * Local variables: diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c index 12b76a0a98..c1463d647a 100644 --- a/xen/arch/arm/setup.c +++ b/xen/arch/arm/setup.c @@ -480,12 +480,18 @@ void asmlinkage __init start_xen(unsigned long fdt_pa= ddr) enable_errata_workarounds(); enable_cpu_features(); =20 - /* Create initial domain 0. */ - if ( !is_dom0less_mode() ) + if ( IS_ENABLED(CONFIG_DOM0_BOOT) && !is_dom0less_mode() ) + { + /* Create initial domain 0. */ create_dom0(); + } else - printk(XENLOG_INFO "Xen dom0less mode detected\n"); - + { + if ( is_dom0less_mode()) + printk(XENLOG_INFO "Xen dom0less mode detected\n"); + else + panic("Xen dom0less mode not detected, aborting boot\n"); + } if ( acpi_disabled ) { create_domUs(); diff --git a/xen/common/Kconfig b/xen/common/Kconfig index 64865112a1..75039138b0 100644 --- a/xen/common/Kconfig +++ b/xen/common/Kconfig @@ -21,6 +21,14 @@ config DOM0LESS_BOOT Xen boot without the need of a control domain (Dom0), which could be present anyway. =20 +config DOM0_BOOT + bool "Dom0 boot support" if EXPERT + depends on HAS_DOM0 && HAS_DEVICE_TREE && DOMAIN_BUILD_HELPERS + default y + help + Dom0 boot support enables Xen to boot to the control domain (Dom0) and + manage domU guests using the Xen toolstack with provided configurations. + config DOMAIN_BUILD_HELPERS bool =20 @@ -92,6 +100,9 @@ config HAS_DEVICE_TREE config HAS_DOM0LESS bool =20 +config HAS_DOM0 + bool + config HAS_DIT # Data Independent Timing bool =20 --=20 2.34.1