From nobody Mon Nov 3 18:14:06 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 header.i=dpsmith@apertussolutions.com; 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=apertussolutions.com) ARC-Seal: i=2; a=rsa-sha256; t=1728251858; cv=pass; d=zohomail.com; s=zohoarc; b=R4IrDuGArVHWiI9pBcEDXBxJg9bx4FlqTiG+6u0L5QPG9QgJzVKo3VHuxgcNbrGyFk09FxYy5R5+aYAX5Qe14TDdr6LrUFRj4tSlYX0Aa2KpAKeKOXquW61N2LHO7F7RByuAnonICcPuR8VZjeDZk9WHrvqjwHum2qKQBum4/hI= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728251858; h=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=x/0pbSRKvsD7gGf1XEw1gxRP4YoiCChfwLPAVJ7btAM=; b=j+vIZd5CngNT8ib971Nbs9m9ukGd04ZtUzSaYBO44T1OgMFM2jR4riSS8cRBqH3zh8M5hu4T2hIN/BVg3Vm2PWc3gbaGwu5jarLWC6SjNQgPdpQrEIKwaDD9PjqB9q4Tx69RIbiaZ4Xi5Ydcmhrvg7N8MlRlD1WbYoI/QtIewlY= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass header.i=dpsmith@apertussolutions.com; 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=apertussolutions.com) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1728251858424943.8741687281731; Sun, 6 Oct 2024 14:57:38 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.811403.1224177 (Exim 4.92) (envelope-from ) id 1sxZFU-0002uz-Rc; Sun, 06 Oct 2024 21:57:08 +0000 Received: by outflank-mailman (output) from mailman id 811403.1224177; Sun, 06 Oct 2024 21:57:08 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sxZFU-0002ud-M5; Sun, 06 Oct 2024 21:57:08 +0000 Received: by outflank-mailman (input) for mailman id 811403; Sun, 06 Oct 2024 21:57:07 +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 1sxZ9U-0006RM-VL for xen-devel@lists.xenproject.org; Sun, 06 Oct 2024 21:50:56 +0000 Received: from sender4-of-o51.zoho.com (sender4-of-o51.zoho.com [136.143.188.51]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 0e969338-842d-11ef-a0bb-8be0dac302b0; Sun, 06 Oct 2024 23:50:54 +0200 (CEST) Received: by mx.zohomail.com with SMTPS id 1728251410008152.1502674267898; Sun, 6 Oct 2024 14:50:10 -0700 (PDT) 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: 0e969338-842d-11ef-a0bb-8be0dac302b0 ARC-Seal: i=1; a=rsa-sha256; t=1728251412; cv=none; d=zohomail.com; s=zohoarc; b=VTL42CyW2Td8CIuc8CEiCsM7s42uJYyrxQuZwcET4dOSm2LMiogBUUrD/mYhwRTPSHdD9ew9s0MigvGLbLu8+rMSinr578ZaiWjjJRR60yHcnpy9GP8UxuUpg4eQEWKvnzBOrVvsxMOiSjd3JaF/Jrmd3YfKWFHFE16GJYv5EmI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728251412; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=x/0pbSRKvsD7gGf1XEw1gxRP4YoiCChfwLPAVJ7btAM=; b=K29Tpnma1Y/rrhq2MO2DDBPuSBvMxy+s18+q9EFUD8UCqxJlEhg4Z3ZQUH4WdQF8DIeOGtzSHKYTrGbkzoK36IM5KB98KfMe30/P14pUgbXozOpi3Xv6ZqKeDCy9ZYUU50u4Kt2y4aTA97ipRCP+ZrJ+vRvgrGujdpReo/dxFqU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=apertussolutions.com; spf=pass smtp.mailfrom=dpsmith@apertussolutions.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1728251412; s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To; bh=x/0pbSRKvsD7gGf1XEw1gxRP4YoiCChfwLPAVJ7btAM=; b=srtDDtbUkOrvDVA12dRaCHk/xDFPGWM4XYGwGQKn4yQY84azTqhzog5sOGUhT9SU ShyNKLmxyCyliVtn2WYt73Q7xcS4/lqjcNUjOGLWjv8VA83cB2qu4w3vuL77y0s12cH QDDhnUyjkZMcxj9aChka9jB0sDOEJcyOKANgFv6U= From: "Daniel P. Smith" To: xen-devel@lists.xenproject.org Cc: "Daniel P. Smith" , jason.andryuk@amd.com, christopher.w.clark@gmail.com, stefano.stabellini@amd.com, Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [PATCH v5 05/44] x86/boot: introduce struct boot_module Date: Sun, 6 Oct 2024 17:49:16 -0400 Message-Id: <20241006214956.24339-6-dpsmith@apertussolutions.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20241006214956.24339-1-dpsmith@apertussolutions.com> References: <20241006214956.24339-1-dpsmith@apertussolutions.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External X-ZohoMail-DKIM: pass (identity dpsmith@apertussolutions.com) X-ZM-MESSAGEID: 1728251859999116600 Content-Type: text/plain; charset="utf-8" This will introduce a new struct boot_module to provide a rich state representation around modules provided by the boot loader. Support is for 64 boot modules, one held in reserve for Xen, and up to 63 can be provided by = the boot loader. The array of struct boot_modules will be accessible via a reference held in struct boot_info. A temporary `mod` parameter is included in struct boot_module to ease the transition from using Multiboot v1 structures over to struct boot_module. O= nce the transition is complete, the parameter will be dropped from the structur= e. Signed-off-by: Daniel P. Smith Reviewed-by: Jason Andryuk --- xen/arch/x86/include/asm/bootinfo.h | 14 ++++++++++++-- xen/arch/x86/setup.c | 9 +++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/include/asm/bootinfo.h b/xen/arch/x86/include/asm= /bootinfo.h index 87d311ac1399..d19473d8941e 100644 --- a/xen/arch/x86/include/asm/bootinfo.h +++ b/xen/arch/x86/include/asm/bootinfo.h @@ -8,20 +8,30 @@ #ifndef __XEN_X86_BOOTINFO_H__ #define __XEN_X86_BOOTINFO_H__ =20 +#include #include =20 +/* Max number of boot modules a bootloader can provide in addition to Xen = */ +#define MAX_NR_BOOTMODS 63 + +struct boot_module { + /* Transitionary only */ + module_t *mod; +}; + /* * Xen internal representation of information provided by the * bootloader/environment, or derived from the information. */ struct boot_info { - unsigned int nr_modules; - const char *loader; const char *cmdline; =20 paddr_t memmap_addr; size_t memmap_length; + + unsigned int nr_modules; + struct boot_module mods[MAX_NR_BOOTMODS + 1]; }; =20 #endif /* __XEN_X86_BOOTINFO_H__ */ diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index f0482ca8cc55..68eb4c848ae8 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -284,6 +284,8 @@ static struct boot_info __init *multiboot_fill_boot_inf= o(unsigned long mbi_p) { struct boot_info *bi =3D &xen_boot_info; const multiboot_info_t *mbi =3D __va(mbi_p); + module_t *mods =3D __va(mbi->mods_addr); + unsigned int i; =20 bi->nr_modules =3D (mbi->flags & MBI_MODULES) ? mbi->mods_count : 0; =20 @@ -302,6 +304,13 @@ static struct boot_info __init *multiboot_fill_boot_in= fo(unsigned long mbi_p) bi->memmap_length =3D mbi->mmap_length; } =20 + /* + * This will iterate over all modules to include an extra mb module, w= hich + * should have been reserved to hold an entry for Xen. + */ + for ( i =3D 0; i <=3D bi->nr_modules; i++ ) + bi->mods[i].mod =3D &mods[i]; + return bi; } =20 --=20 2.30.2