From nobody Fri Oct 31 04:06:27 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=1751998097; cv=pass; d=zohomail.com; s=zohoarc; b=WF/UBnnkBgsUr/7rXzLuPLDMXQOsWAg5tnFUWitR7ymyNjMC5veys/ITL8CZnOaKLUh7fs9zvWZNtP857yJIIBbkD9pXMmr9Cy+L7UlEJqg19Rsc/jmMfpre3Tp5dVDticJAwr2JlyGqMYTGd7O4nEBOObHd/X5GMMY78PslxaY= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751998097; 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=Vso2EYruuleOBrbwx7nFpqmFdGG3+p6tqYAmzJo08dY=; b=K9rT4Cn4AnT13CM9PJS/qbJ1rjWY6ajMqWsmA2EAbsZGY725ch4PUQMFF+WlRDi7wac3Xr+XWc2wYcgwhYo49mJahlqngSPOEy6PYNdrrjy7y6kq+r7uXocVM0d32KMNZNwPJv3VZtqntvtyRpqDwpHuWuR2WHmhy3orhnXsEnw= 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 1751998097942924.7695778650825; Tue, 8 Jul 2025 11:08:17 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1037028.1409712 (Exim 4.92) (envelope-from ) id 1uZCjW-0006NH-0T; Tue, 08 Jul 2025 18:07:58 +0000 Received: by outflank-mailman (output) from mailman id 1037028.1409712; Tue, 08 Jul 2025 18:07:57 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uZCjV-0006Mm-Qg; Tue, 08 Jul 2025 18:07:57 +0000 Received: by outflank-mailman (input) for mailman id 1037028; Tue, 08 Jul 2025 18:07:57 +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 1uZCjV-0005Uq-1x for xen-devel@lists.xenproject.org; Tue, 08 Jul 2025 18:07:57 +0000 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2062c.outbound.protection.outlook.com [2a01:111:f403:2412::62c]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 77881dcd-5c26-11f0-b894-0df219b8e170; Tue, 08 Jul 2025 20:07:54 +0200 (CEST) Received: from DM6PR07CA0084.namprd07.prod.outlook.com (2603:10b6:5:337::17) by BL4PR12MB9482.namprd12.prod.outlook.com (2603:10b6:208:58d::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8901.25; Tue, 8 Jul 2025 18:07:50 +0000 Received: from CY4PEPF0000FCC1.namprd03.prod.outlook.com (2603:10b6:5:337:cafe::44) by DM6PR07CA0084.outlook.office365.com (2603:10b6:5:337::17) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8901.27 via Frontend Transport; Tue, 8 Jul 2025 18:07:50 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by CY4PEPF0000FCC1.mail.protection.outlook.com (10.167.242.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8901.15 via Frontend Transport; Tue, 8 Jul 2025 18:07:49 +0000 Received: from xcbagarciav01.xilinx.com (10.180.168.240) 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, 8 Jul 2025 13:07:47 -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: 77881dcd-5c26-11f0-b894-0df219b8e170 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Q2tBYc9rLdAKfz9+hbtVRBbFMTepAKsnXr1w9qxfHTZjPbYchM8coviNmlS1TnOfFEm8bNHeWkkCIePjMEMcL3XwetNR8fySio5j+apZHMx3HEIRe1hxWWkJcKATGOCUUvFdCaFmZ755Js6GMXSxz9+2KthO2GTDwIyo3112hnYq465vyX01499e9yv0/f1Msor1heW0rklc1PPuAiuGY6mhJuTZ3zEYrNVgjNc+34OMoQeKXptd97pCQ0CTcv6zeMLuFMOoBDPTEQN4hiKgwwZTOFBiTF7u52k+cDVzlDEtE0RQzt0rOXExVJQMQrkVv8szMjahALZSFBgg1TLxPw== 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=Vso2EYruuleOBrbwx7nFpqmFdGG3+p6tqYAmzJo08dY=; b=PiJIGTKXgOEsFAYJ1M0TQl7e4GcF5SigORMGgXlsCj/xcQereDa0jn3aaCM4gWO4ZDdxCoctMkehKU1CtMZ8jH59zah4B8t+fF/vxEZoUtWs1kGbvh9vgLG3FPBDQO9nOW+3RoT2TNeHdNx3LLuD18mWyubNhdsH+ZU+fGScICjE1rucX5iIYacomBpICsq9C53u3FIJuxZPTGLR3ZEiXRML9bfxr8nHyXuQBdNJRH6j4Ug7XNDg90KyaYWvy53MTIZapUsogfwUy7fdbX4AuNVQnTmx8UX9XJJJ1RhmFRgW2zIScZTofZ3WW3028nHcDjPfU9fS5oxwevY4mJ/4NQ== 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=Vso2EYruuleOBrbwx7nFpqmFdGG3+p6tqYAmzJo08dY=; b=4RWo+r9fll7j57YY8hHC3gX6uZ0lNJuWuvGYgbW9bses2hBUdT6Mtn9DD6FDEjgvOV/MsAA7z2UiquKDzOZlU2WqpRq2Dlqt2DKf/pXPVK/8R+AnFU6qYXMHdFoCPXEiFTEvz5Yc69DS0hTN5CacvOq0qHfNbmwLbt8xFxPFbr0= 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: Alejandro Vallejo To: CC: Alejandro Vallejo , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , "Stefano Stabellini" , Julien Grall , "Bertrand Marquis" , Michal Orzel , "Daniel P. Smith" Subject: [PATCH v6 04/11] x86: Replace arch-specific boot_domain with the common one Date: Tue, 8 Jul 2025 20:07:13 +0200 Message-ID: <20250708180721.2338036-5-alejandro.garciavallejo@amd.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250708180721.2338036-1-alejandro.garciavallejo@amd.com> References: <20250708180721.2338036-1-alejandro.garciavallejo@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000FCC1:EE_|BL4PR12MB9482:EE_ X-MS-Office365-Filtering-Correlation-Id: 6b735f83-c687-4a2e-4f7b-08ddbe4a59da 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?tJX/cO6RTznN794ihfxPfMycWSt6iNNa+6GZBnaRkXXeuj05Ffl9HeHjP4s8?= =?us-ascii?Q?4tfFx9AOFWeCOqivVydJKvZKN5FykL7i8s7KdpAMrTOgjrFlA0EenpqeXlh5?= =?us-ascii?Q?jAt+LQC/+YSVAtP0V9mLlWO06btVoGYOsdqOQRlVTV8899OcXa6MGJ2DlyfE?= =?us-ascii?Q?KQazd5Hex7jMNm8EO1bCKHoh+F+a5103rArm7FWsLjGZz6XkRv1h5HXo36iC?= =?us-ascii?Q?47SD2jX29yBcVLfHDllRdXLX25IcvJeKfRo9+4ieUFJ5FwjHmMMkun1nKjmf?= =?us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47zjOqEw9TwFr/JqohXKyACHiMXpuOYjBwKl?= =?us-ascii?Q?SraN4u6HJ5AzSmlYAuFe10Cl5gdSycOMNs6PHukwA7Y0ujqjuQsZuvWC2ate?= =?us-ascii?Q?qXjwcDxR+/wKjIQoIe0Ksebr0vdz+7wshWi8YxdP1sNcS4c+PjICljlVxnHU?= =?us-ascii?Q?/rhm3Gj91utXJJw88xP+NqmUte2GsVHaASr69KCjV/gMjCML/70DqBf007eK?= =?us-ascii?Q?0FWjXXpX54cS8OLUEWgXbbJvPDFRSOYPwe+p9eykUlOIRI2cW9zMGUKcScUO?= =?us-ascii?Q?aA3NeFYyPWP9bqhHwoH890tnFbydEheNkNrfLlKkCDZfOCjoWdLE2FUEfo5n?= =?us-ascii?Q?yHY5bGMi52TnGOWukyk7yEc4BSxVNTieLD6L?= 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)(36860700013)(1800799024)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2025 18:07:49.9918 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6b735f83-c687-4a2e-4f7b-08ddbe4a59da 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: CY4PEPF0000FCC1.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL4PR12MB9482 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1751998099246116600 Content-Type: text/plain; charset="utf-8" From: Alejandro Vallejo Add the single arch-specific field in an "arch" subfield defined in asm/bootfdt.h. No functional change intended. Signed-off-by: Alejandro Vallejo Reviewed-by: Stefano Stabellini --- xen/arch/x86/hvm/dom0_build.c | 2 +- xen/arch/x86/include/asm/boot-domain.h | 33 -------------------------- xen/arch/x86/include/asm/bootfdt.h | 6 +++++ xen/arch/x86/include/asm/bootinfo.h | 1 - xen/arch/x86/pv/dom0_build.c | 2 +- xen/arch/x86/setup.c | 12 ++++++---- xen/include/xen/bootfdt.h | 4 ++++ 7 files changed, 19 insertions(+), 41 deletions(-) delete mode 100644 xen/arch/x86/include/asm/boot-domain.h diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c index 2bb8ef355c..8d2734f2b5 100644 --- a/xen/arch/x86/hvm/dom0_build.c +++ b/xen/arch/x86/hvm/dom0_build.c @@ -648,7 +648,7 @@ static int __init pvh_load_kernel( { struct domain *d =3D bd->d; struct boot_module *image =3D bd->kernel; - struct boot_module *initrd =3D bd->module; + struct boot_module *initrd =3D bd->initrd; void *image_base =3D bootstrap_map_bm(image); void *image_start =3D image_base + image->arch.headroom; unsigned long image_len =3D image->size; diff --git a/xen/arch/x86/include/asm/boot-domain.h b/xen/arch/x86/include/= asm/boot-domain.h deleted file mode 100644 index d7c6042e25..0000000000 --- a/xen/arch/x86/include/asm/boot-domain.h +++ /dev/null @@ -1,33 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ -/* - * Copyright (c) 2024 Apertus Solutions, LLC - * Author: Daniel P. Smith - * Copyright (c) 2024 Christopher Clark - */ - -#ifndef __XEN_X86_BOOTDOMAIN_H__ -#define __XEN_X86_BOOTDOMAIN_H__ - -#include - -struct boot_domain { - domid_t domid; - - struct boot_module *kernel; - struct boot_module *module; - const char *cmdline; - - struct domain *d; -}; - -#endif - -/* - * Local variables: - * mode: C - * c-file-style: "BSD" - * c-basic-offset: 4 - * tab-width: 4 - * indent-tabs-mode: nil - * End: - */ diff --git a/xen/arch/x86/include/asm/bootfdt.h b/xen/arch/x86/include/asm/= bootfdt.h index a4c4bf30b9..c21dbe961b 100644 --- a/xen/arch/x86/include/asm/bootfdt.h +++ b/xen/arch/x86/include/asm/bootfdt.h @@ -3,6 +3,12 @@ #define X86_BOOTFDT_H =20 #include +#include + +struct arch_boot_domain +{ + domid_t domid; +}; =20 struct arch_boot_module { diff --git a/xen/arch/x86/include/asm/bootinfo.h b/xen/arch/x86/include/asm= /bootinfo.h index d33b100e04..4f2cc5906e 100644 --- a/xen/arch/x86/include/asm/bootinfo.h +++ b/xen/arch/x86/include/asm/bootinfo.h @@ -12,7 +12,6 @@ #include #include #include -#include =20 /* Max number of boot modules a bootloader can provide in addition to Xen = */ #define MAX_NR_BOOTMODS 63 diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c index a4b5362357..c37bea9454 100644 --- a/xen/arch/x86/pv/dom0_build.c +++ b/xen/arch/x86/pv/dom0_build.c @@ -375,7 +375,7 @@ static int __init dom0_construct(const struct boot_doma= in *bd) struct vcpu *v =3D d->vcpu[0]; =20 struct boot_module *image =3D bd->kernel; - struct boot_module *initrd =3D bd->module; + struct boot_module *initrd =3D bd->initrd; void *image_base; unsigned long image_len; void *image_start; diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index 7e70b46332..5adb7af930 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -297,7 +297,9 @@ static const char *cmdline_cook(const char *p, const ch= ar *loader_name); struct boot_info __initdata xen_boot_info =3D { .loader =3D "unknown", .cmdline =3D "", - .domains =3D { [0 ... MAX_NR_BOOTDOMS - 1] =3D { .domid =3D DOMID_INVA= LID } }, + .domains =3D { [0 ... MAX_NR_BOOTDOMS - 1] =3D { + .arch.domid =3D DOMID_INVALID + }}, /* * There's a MAX_NR_BOOTMODS-th entry in the array. It's not off by on= e. * @@ -1048,11 +1050,11 @@ static struct domain *__init create_dom0(struct boo= t_info *bi) dom0_cfg.flags |=3D XEN_DOMCTL_CDF_iommu; =20 /* Create initial domain. Not d0 for pvshim. */ - bd->domid =3D get_initial_domain_id(); - d =3D domain_create(bd->domid, &dom0_cfg, + bd->arch.domid =3D get_initial_domain_id(); + d =3D domain_create(bd->arch.domid, &dom0_cfg, pv_shim ? 0 : CDF_privileged | CDF_hardware); if ( IS_ERR(d) ) - panic("Error creating d%u: %ld\n", bd->domid, PTR_ERR(d)); + panic("Error creating d%u: %ld\n", bd->arch.domid, PTR_ERR(d)); =20 init_dom0_cpuid_policy(d); =20 @@ -2171,7 +2173,7 @@ void asmlinkage __init noreturn __start_xen(void) if ( initrdidx < MAX_NR_BOOTMODS ) { bi->mods[initrdidx].kind =3D BOOTMOD_RAMDISK; - bi->domains[0].module =3D &bi->mods[initrdidx]; + bi->domains[0].initrd =3D &bi->mods[initrdidx]; if ( first_boot_module_index(bi, BOOTMOD_UNKNOWN) < MAX_NR_BOOTMOD= S ) printk(XENLOG_WARNING "Multiple initrd candidates, picking module #%u\n", diff --git a/xen/include/xen/bootfdt.h b/xen/include/xen/bootfdt.h index 28f7d18262..65ba818e1a 100644 --- a/xen/include/xen/bootfdt.h +++ b/xen/include/xen/bootfdt.h @@ -107,6 +107,10 @@ struct boot_domain { struct boot_module *initrd; =20 const char *cmdline; + +#if __has_include() + struct arch_boot_domain arch; +#endif }; =20 #define BOOTMOD_MAX_CMDLINE 1024 --=20 2.43.0