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=1750444241; cv=pass; d=zohomail.com; s=zohoarc; b=muTYVTFKlwS9mlvUl7bu+I/p2V/xwtNK0VoYlOXtG15QvJKeL9aIRCTOKMeQwugAVG9jsWSsU09lcCiAMTG3St/UYL8SM32kfayQiosMSfaZ5FsC/oE3lhjxm2SFGiLxe74IRaVCgjoeBXK0thC8cVvXKotoqimF45KeuZvygWY= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1750444241; 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=p9ZiP25AT0NUU0OB8svKEcTwDIsiPq7Hv28Amb3Kek8=; b=ZNmWfbzNPhnrMWwH9MALemgF7NAnARmVky6l4g61eRpxg7HHAmZB+iK86tYlQDzTGOkiY44gFXn6xwoPHSkqEaN8mx08aX4gJbtCM1hju9LdNcQlqexV62wv7U84feLwNMP90c1OedDoCL+vB8l6R0I/WwD0n0uHA8ZRtMhsJws= 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 1750444241887477.67323066476547; Fri, 20 Jun 2025 11:30:41 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1021098.1397163 (Exim 4.92) (envelope-from ) id 1uSgVP-0007yB-0G; Fri, 20 Jun 2025 18:30:27 +0000 Received: by outflank-mailman (output) from mailman id 1021098.1397163; Fri, 20 Jun 2025 18:30:26 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uSgVO-0007y2-TM; Fri, 20 Jun 2025 18:30:26 +0000 Received: by outflank-mailman (input) for mailman id 1021098; Fri, 20 Jun 2025 18:30:25 +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 1uSgVN-000575-Mp for xen-devel@lists.xenproject.org; Fri, 20 Jun 2025 18:30:25 +0000 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on20600.outbound.protection.outlook.com [2a01:111:f403:240a::600]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id a049c974-4e04-11f0-b894-0df219b8e170; Fri, 20 Jun 2025 20:30:24 +0200 (CEST) Received: from BL6PEPF0001641E.NAMP222.PROD.OUTLOOK.COM (2603:10b6:22e:400:0:1004:0:e) by SJ0PR12MB6965.namprd12.prod.outlook.com (2603:10b6:a03:448::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8835.28; Fri, 20 Jun 2025 18:30:18 +0000 Received: from BN1PEPF00005FFD.namprd05.prod.outlook.com (2a01:111:f403:c803::2) by BL6PEPF0001641E.outlook.office365.com (2603:1036:903:4::a) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8857.25 via Frontend Transport; Fri, 20 Jun 2025 18:30:18 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by BN1PEPF00005FFD.mail.protection.outlook.com (10.167.243.229) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8857.21 via Frontend Transport; Fri, 20 Jun 2025 18:30:18 +0000 Received: from xcbagarciav01.amd.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; Fri, 20 Jun 2025 13:30: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: a049c974-4e04-11f0-b894-0df219b8e170 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ZZcgzibemFh2EUQ3ui18kppj2ztf349xn7nNTryhtQxnBl0EnhU2Cv4+4iYhjPVK9OyG6lIZLCk8f4VFb6d3QKXcOIPKh+TP/W4GsIYYBfm3isgzfv28nbugdYT/R1EVFRuD0x7Pi3GzhFK5oV2Hv2iiZcF5AVLd6DQbZYsaqWcSPqeDmvg1gC9yhF2fXImrJXhuJpd+lRUzV1Ds8dgwAiTFnOya+r1beTqbSp7sDauxDRMOBRIpLfO5X/UN2cHhpLJ+Avfg2NU7QY3epWQlYJCVcmbshH1JOZe3TjKUTriKYIHwb8TG8jfHZIYYLrN83hq52X4XJX3Ijq6nlghWLA== 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=p9ZiP25AT0NUU0OB8svKEcTwDIsiPq7Hv28Amb3Kek8=; b=d4Hdp5WSEMXRJ8nKngItZ6USAn1TneqoDMB0EA1DFPMKVc+RAX/e8OMCy5BDC9CSGwEdz9RPiZOaO0BBEkf+3YLBLpbc/jln3yKQZCyCCojIf3yd3pHfWsYplTB1fZl4r3Ir/KEsaIyDeiFGlECGU149KElVrYRFEAFOZG/wAzsJHz9y/vu4B7xuyvcHErItD/AAqFCArKq/OmwIs1xq9+gnlzJYs2JLBqWJS7bAzIP6ilGpTAcgvi4Adi9XbMC36mLkL6xcgYC3Tg0pKfSQsjZZcY/MDvVk8J3tAMjWGh3uSVFMK5Dr2VF6zvm8fjW3feh0EjSsKE7ppnmrSsKmZg== 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=p9ZiP25AT0NUU0OB8svKEcTwDIsiPq7Hv28Amb3Kek8=; b=lA0Hpj77mOMmqte2e2olZQWORDHxS90q1YN9HOIu6J3Kjld19QY/WeOtcaDe0EmR8jAgpLfs+OtMGThU1aJLIxTS6bQ+2Gq+11/K4x17jemez3Lk7DKxvfyLkcBB9bN6OpEdR/YaGnxJtkPCLY7m3MD06OCWqvJmm1y+ES3CE+0= 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 Subject: [PATCH v4 05/12] x86: Replace arch-specific boot_domain with the common one Date: Fri, 20 Jun 2025 20:28:51 +0200 Message-ID: <20250620182859.23378-6-agarciav@amd.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250620182859.23378-1-agarciav@amd.com> References: <20250620182859.23378-1-agarciav@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: BN1PEPF00005FFD:EE_|SJ0PR12MB6965:EE_ X-MS-Office365-Filtering-Correlation-Id: 9d58d30b-e508-4837-f066-08ddb02881ed X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|36860700013|82310400026|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?FZIIrzxyJfAEmfyHoJLMD53c0t0uG8/svPD/Ji/rlDdFBcWDTXc2SiGiUGOX?= =?us-ascii?Q?qPxzHePxVi42Ccl1hFoUpTIxlOW7dKasHLnU/HFqvGHlvWanWQ6I4Qn2fhbL?= =?us-ascii?Q?bOuEdUvA8qKI8BOcKVCYkIGIv622mPbrm/6QxB0w+XMmuw9kFNX11uMmdILt?= =?us-ascii?Q?2EndQ1hdwO9idmlkze4PKrWOeNGPOJ22yBzdOPEIayUYvS4T0UCCHPRoAUO2?= =?us-ascii?Q?8cVYvPQwPr2xJi9E+y+O0IDi8i3UxDthmSQ3Ef1WwqgJ93LLbIrxsMxRpdoJ?= =?us-ascii?Q?tDDuaW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hbJ1tsEN10lbY?= =?us-ascii?Q?wQZLUhce03Y+BHZRzwCPrBfF/B23bphKEWOGX2qWb0cO9lAiLRHJyfs3KXNU?= =?us-ascii?Q?jf5sK8oW9UJrm3mhS5kHbtmd38TxiyfNMqyij08CLxQ4xz8XY/rvwWMNfeaP?= =?us-ascii?Q?C7tHP4LSYN6dDHUu2wVYqyQTaNzFJAFnYj6qzne6lJPPFJ1bwJBVDuX6TOJ2?= =?us-ascii?Q?XQcQ+Js+hP3fnffCJlz4Y6hli+qCTEhO/BP8fhmclknPSg5qTt2xNuiW+c3t?= =?us-ascii?Q?Ly3wUGp3sTyMovyR/GpXgonw0n2HywKG4qUZ/tc/hgPqwfyLzOwX/IJ19aG0?= =?us-ascii?Q?aIyl4FmZm/O8au1Q02ev+ZbQubJbBrxAz1vu?= 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)(36860700013)(82310400026)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jun 2025 18:30:18.1106 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9d58d30b-e508-4837-f066-08ddb02881ed 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: BN1PEPF00005FFD.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB6965 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1750444243479116600 Content-Type: text/plain; charset="utf-8" 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 4f34bbe688..a9560ac619 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. * @@ -1045,11 +1047,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 @@ -2168,7 +2170,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 be0abe30ef..8ea52290b7 100644 --- a/xen/include/xen/bootfdt.h +++ b/xen/include/xen/bootfdt.h @@ -108,6 +108,10 @@ struct boot_domain { struct boot_module *initrd; =20 const char* cmdline; + +#if __has_include() + struct arch_boot_domain arch; +#endif }; =20 /* --=20 2.43.0