Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DEB67C369CB for ; Wed, 23 Apr 2025 11:53:33 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.964500.1355275 (Exim 4.92) (envelope-from ) id 1u7YfH-0007Hu-9r; Wed, 23 Apr 2025 11:53:19 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 964500.1355275; Wed, 23 Apr 2025 11:53:19 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1u7YfH-0007Hn-6G; Wed, 23 Apr 2025 11:53:19 +0000 Received: by outflank-mailman (input) for mailman id 964500; Wed, 23 Apr 2025 11:53:17 +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 1u7YfF-0007Hf-FT for xen-devel@lists.xenproject.org; Wed, 23 Apr 2025 11:53:17 +0000 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2061b.outbound.protection.outlook.com [2a01:111:f403:2009::61b]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 87acaca2-2039-11f0-9ffb-bf95429c2676; Wed, 23 Apr 2025 13:53:12 +0200 (CEST) Received: from BN9PR03CA0416.namprd03.prod.outlook.com (2603:10b6:408:111::31) by DM4PR12MB5842.namprd12.prod.outlook.com (2603:10b6:8:65::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8678.23; Wed, 23 Apr 2025 11:53:06 +0000 Received: from BL6PEPF0001AB76.namprd02.prod.outlook.com (2603:10b6:408:111:cafe::b8) by BN9PR03CA0416.outlook.office365.com (2603:10b6:408:111::31) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8655.37 via Frontend Transport; Wed, 23 Apr 2025 11:53:06 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by BL6PEPF0001AB76.mail.protection.outlook.com (10.167.242.169) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8655.12 via Frontend Transport; Wed, 23 Apr 2025 11:53:06 +0000 Received: from localhost (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; Wed, 23 Apr 2025 06:53:00 -0500 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: 87acaca2-2039-11f0-9ffb-bf95429c2676 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=rC7SrDasos7dCQvz3JYtdey2DQMTMBT/wIKMUSLmgE3ZrB8xwEzwYXUQqkuu3Nmxx+P2RnA0m0gVpy/0AIsoqBJqjUAIYNHvQVftv2foVDiYuDsKcHJLPKabfeglj19Mc1oBfjWJ4Q7nL1byE8lA+jbcU39h8GxT2mWLiROxUfkI4pjUDiKMBrggZjprm3mTSSl2LjhpEd8mehsbzsYMMzk7u1Gm83jCtYONg68WWZ7Mf5joUYWorsvqyKBijao7lHir+m0en5wJBw2Z1xtlK15xlmmw7NeWUYBg673S5ucLaG7plly99RflxtnPfssShOe9PrUcmBCUYhT6ZVIm1w== 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=+LMLm7VJCnH2nKyG/FQ8tX9hwWfCZI6ToONo/A6Zfp8=; b=zLj2VyT5JTJXwnfWOWEWsv14w+4EYPJ3Pgb+CyzfTQ41chOjx16nJTrzWbW+fsPZdnbB8SY35RaqzrZObG14dLcrcSvEqT0qVvcFHwFbv9F5Z+fENGmmOAzVgxut2Y3M5fb7Cd7Av6llB3yg9RFY3LOraDZFz0VP8nH8fWy6dXgzf6Xq6udDnbpyfUEplUTktH2Tlr00hrHPyAB4rb8//RqGg/JnYsnnlTzEg+HSsb1hw9C/t1tgrBDlPVjLRSQlU8iBHll8fho7pMv0PUHmq5WEf0qVCWViWNTteX3Xbg9mslwoIFwW7HSWe2BmNRwlH25Zu4hrPVpXLTgSgLlF0A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=proton.me 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=+LMLm7VJCnH2nKyG/FQ8tX9hwWfCZI6ToONo/A6Zfp8=; b=lPPSiqdDj/wyxbRWc8R2cNo2nVCzpamGZzIRdtK/XxBJFyW4bU2C3TzkpbplhSmn6dZ4jApUql0H+Vc8cYUaDSuOuuX5VUkiZunO4ZS9sW+xP/t7zNO/NPG4oPMt4gTX22WBHE9cvonnyng+znDEe6q+W69a0QuaV1Im/svAM94= 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 (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 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" Date: Wed, 23 Apr 2025 12:52:58 +0100 Message-ID: CC: , "Daniel P. Smith" , Jan Beulich , "Andrew Cooper" , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Anthony PERARD , "Michal Orzel" , Julien Grall , "Stefano Stabellini" , Jason Andryuk Subject: Re: [PATCH v4 03/13] common/hyperlaunch: introduce the domain builder From: Alejandro Vallejo To: X-Mailer: aerc 0.20.1 References: <20250417124844.11143-1-agarciav@amd.com> <20250417124844.11143-4-agarciav@amd.com> In-Reply-To: X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB76:EE_|DM4PR12MB5842:EE_ X-MS-Office365-Filtering-Correlation-Id: f7c365ea-5491-46ae-a9ac-08dd825d6912 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|1800799024|82310400026|376014; X-Microsoft-Antispam-Message-Info: =?utf-8?B?VU1WaGlnVjk0a0I3RVl1NVlWdk1Td1djQmNWZWZZMXpIU2dyblNxTnJ2T0Iz?= =?utf-8?B?SUppQkdhNzZYQVJFUm9jVk16dHh4RzBiV1lWNUVNa0QxMmdvRXM2d3F6UGhj?= =?utf-8?B?YmtnbUNvQVJ3OGdOZXNsMXdha2d6TXFvL0xCTFBkbnM3UzhWR2twdXpFSHNW?= =?utf-8?B?cW5MZXB0OGdQUUhvVnVkbEppSjdzdm02cW9CSnM3cTgwcFZwbUhyaXBLbzdK?= =?utf-8?B?QnI2ZDlEa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dHU5d01PMkFv?= =?utf-8?Q?nvWwvD?= 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)(1800799024)(82310400026)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Apr 2025 11:53:06.2443 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f7c365ea-5491-46ae-a9ac-08dd825d6912 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: BL6PEPF0001AB76.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5842 On Fri Apr 18, 2025 at 10:55 PM BST, dmkhn wrote: > On Thu, Apr 17, 2025 at 01:48:25PM +0100, Alejandro Vallejo wrote: >> From: "Daniel P. Smith" >>=20 >> Introduce the domain builder which is capable of consuming a device tree= as the >> first boot module. If it finds a device tree as the first boot module, i= t will >> set its type to BOOTMOD_FDT. This change only detects the boot module an= d >> continues to boot with slight change to the boot convention that the dom= 0 >> kernel is no longer first boot module but is the second. >>=20 >> No functional change intended. >>=20 >> Signed-off-by: Daniel P. Smith >> Signed-off-by: Jason Andryuk >> Signed-off-by: Alejandro Vallejo >> --- >> v4: >> * Moved from arch/x86/ to common/ >> * gated all of domain-builder/ on CONFIG_BOOT_INFO >> * Hide the domain builder submenu for !X86 >> * Factor out the "hyperlaunch_enabled =3D false" toggle core.c >> * Removed stub inline, as DCE makes it unnecessary >> * Adjusted printks. >> --- >> xen/arch/x86/include/asm/bootinfo.h | 3 ++ >> xen/arch/x86/setup.c | 17 +++++---- >> xen/common/Makefile | 1 + >> xen/common/domain-builder/Makefile | 2 ++ >> xen/common/domain-builder/core.c | 56 +++++++++++++++++++++++++++++ >> xen/common/domain-builder/fdt.c | 37 +++++++++++++++++++ >> xen/common/domain-builder/fdt.h | 12 +++++++ >> xen/include/xen/domain-builder.h | 9 +++++ >> 8 files changed, 131 insertions(+), 6 deletions(-) >> create mode 100644 xen/common/domain-builder/Makefile >> create mode 100644 xen/common/domain-builder/core.c >> create mode 100644 xen/common/domain-builder/fdt.c >> create mode 100644 xen/common/domain-builder/fdt.h >> create mode 100644 xen/include/xen/domain-builder.h >>=20 >> diff --git a/xen/arch/x86/include/asm/bootinfo.h b/xen/arch/x86/include/= asm/bootinfo.h >> index 3afc214c17..82c2650fcf 100644 >> --- a/xen/arch/x86/include/asm/bootinfo.h >> +++ b/xen/arch/x86/include/asm/bootinfo.h >> @@ -27,6 +27,7 @@ enum bootmod_type { >> BOOTMOD_RAMDISK, >> BOOTMOD_MICROCODE, >> BOOTMOD_XSM_POLICY, >> + BOOTMOD_FDT, >> }; >>=20 >> struct boot_module { >> @@ -80,6 +81,8 @@ struct boot_info { >> paddr_t memmap_addr; >> size_t memmap_length; >>=20 >> + bool hyperlaunch_enabled; >> + >> unsigned int nr_modules; >> struct boot_module mods[MAX_NR_BOOTMODS + 1]; >> struct boot_domain domains[MAX_NR_BOOTDOMS]; >> diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c >> index 4df012460d..ccc57cc70a 100644 >> --- a/xen/arch/x86/setup.c >> +++ b/xen/arch/x86/setup.c >> @@ -5,6 +5,7 @@ >> #include >> #include >> #include >> +#include >> #include >> #include >> #include >> @@ -1282,9 +1283,12 @@ void asmlinkage __init noreturn __start_xen(void) >> bi->nr_modules); >> } >>=20 >> - /* Dom0 kernel is always first */ >> - bi->mods[0].type =3D BOOTMOD_KERNEL; >> - bi->domains[0].kernel =3D &bi->mods[0]; >> + builder_init(bi); >> + >> + /* Find first unknown boot module to use as dom0 kernel */ >> + i =3D first_boot_module_index(bi, BOOTMOD_UNKNOWN); >> + bi->mods[i].type =3D BOOTMOD_KERNEL; >> + bi->domains[0].kernel =3D &bi->mods[i]; > > Nit: perhaps add convenience aliases for bi->domains[0] (e.g. dom0) and= =20 > for bi->mods[0] (e.g. mod)? Inside the boot_info? As in separate aliasing pointers into the arrays? I'd rather not. It'd be dangerous on systems without an actual dom0. The PV shim comes to mind, but other configurations might arise in the future where no domain holds the id of 0. > >>=20 >> if ( pvh_boot ) >> { >> @@ -1467,8 +1471,9 @@ void asmlinkage __init noreturn __start_xen(void) >> xen->size =3D __2M_rwdata_end - _stext; >> } >>=20 >> - bi->mods[0].headroom =3D >> - bzimage_headroom(bootstrap_map_bm(&bi->mods[0]), bi->mods[0].si= ze); >> + bi->domains[0].kernel->headroom =3D >> + bzimage_headroom(bootstrap_map_bm(bi->domains[0].kernel), >> + bi->domains[0].kernel->size); >> bootstrap_unmap(); >>=20 >> #ifndef highmem_start >> @@ -1592,7 +1597,7 @@ void asmlinkage __init noreturn __start_xen(void) >> #endif >> } >>=20 >> - if ( bi->mods[0].headroom && !bi->mods[0].relocated ) >> + if ( bi->domains[0].kernel->headroom && !bi->domains[0].kernel->rel= ocated ) >> panic("Not enough memory to relocate the dom0 kernel image\n"); >> for ( i =3D 0; i < bi->nr_modules; ++i ) >> { >> diff --git a/xen/common/Makefile b/xen/common/Makefile >> index 98f0873056..565837bc71 100644 >> --- a/xen/common/Makefile >> +++ b/xen/common/Makefile >> @@ -11,6 +11,7 @@ obj-$(filter-out $(CONFIG_X86),$(CONFIG_ACPI)) +=3D de= vice.o >> obj-$(CONFIG_HAS_DEVICE_TREE) +=3D device-tree/ >> obj-$(CONFIG_IOREQ_SERVER) +=3D dm.o >> obj-y +=3D domain.o >> +obj-$(CONFIG_HAS_BOOT_INFO) +=3D domain-builder/ >> obj-y +=3D event_2l.o >> obj-y +=3D event_channel.o >> obj-$(CONFIG_EVTCHN_FIFO) +=3D event_fifo.o >> diff --git a/xen/common/domain-builder/Makefile b/xen/common/domain-buil= der/Makefile >> new file mode 100644 >> index 0000000000..b10cd56b28 >> --- /dev/null >> +++ b/xen/common/domain-builder/Makefile >> @@ -0,0 +1,2 @@ >> +obj-$(CONFIG_DOMAIN_BUILDER) +=3D fdt.init.o >> +obj-y +=3D core.init.o >> diff --git a/xen/common/domain-builder/core.c b/xen/common/domain-builde= r/core.c >> new file mode 100644 >> index 0000000000..a5b21fc179 >> --- /dev/null >> +++ b/xen/common/domain-builder/core.c >> @@ -0,0 +1,56 @@ >> +/* SPDX-License-Identifier: GPL-2.0-only */ >> +/* >> + * Copyright (C) 2024, Apertus Solutions, LLC >> + */ >> +#include >> +#include >> +#include >> +#include >> + >> +#include >> + >> +#include "fdt.h" >> + >> +void __init builder_init(struct boot_info *bi) >> +{ >> + bi->hyperlaunch_enabled =3D false; >> + >> + if ( IS_ENABLED(CONFIG_DOMAIN_BUILDER) ) > > I would re-organize the code to remove one level of indentation, e.g.: > > if ( !IS_ENABLED(CONFIG_DOMAIN_BUILDER) ) > return; > > switch ( ret =3D has_hyperlaunch_fdt(bi) ) > ... > > or even add #ifdef CONFIG_DOMAIN_BUILDER for builder_init() in the header= file. > > What do you think? In this patch it sounds good, but a later patch adds more stuff at the tail of the function that must not be skipped, so it wouldn't work as-is. Another matter is whether this function could be skipped in the "no-fdt" case, and it probably could. But I do know the longer series (big RFC from Daniel) adds more common logic present when !CONFIG_DOMAIN_BUILDER, so I'm reticent to deviate too much from it to avoid rebasing headaches. > >> + { >> + int ret; >> + >> + switch ( ret =3D has_hyperlaunch_fdt(bi) ) >> + { >> + case 0: >> + printk(XENLOG_DEBUG "DT found: hyperlaunch\n"); >> + bi->hyperlaunch_enabled =3D true; >> + bi->mods[0].type =3D BOOTMOD_FDT; >> + break; >> + >> + case -EINVAL: >> + /* No DT found */ >> + break; >> + >> + case -ENOENT: >> + case -ENODATA: > > Looks like this code accounts for the follow on change: current implement= ation > only returns -EINVAL or 0. > > Is it possible to convert has_hyperlaunch_fdt() to a simple predicate? The function is a misnomer and it ought to change to return an enumerated type instead where it returns FDT_HYPERLAUNCH, FDT_DOM0LESS, FDT_UNKNOWN or NO_FDT. Using error codes for identification is a tad too hacky. Cheers, Alejandro