From nobody Wed Dec 4 19:50:59 2024 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=1725054508; cv=pass; d=zohomail.com; s=zohoarc; b=mitTNRCiQeikkuli8ipCGkFafJS3CkulZ/XU58maSxa4lICG4HyUKLQPN3nxT1Ev5aOUwJF1WBlQ+4Sc29P4718hm5aDIJSR/Mv4+ZEpIEiYP0/9yjUFGK0R6ftsoRcGJ7Ky8wKYHNg67p9+54a1gX11xulrWeOjsE0v7215VUQ= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1725054508; 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=Qexd3Ieo0x5aB7CkcPEqhzSRdIxc4KHzWNUKGdjfDMk=; b=MKvfEZX8hQCxOE1cWAiI9IADVmHUn20TzMBaIOCuEd/jpPWduVgXqJ7pReo8lCgj9mMW6m+EshBEPs/KNhAXRRfhKFw9xMjywbLYk6MXwT+s/KBHK58d+jF+5a4IvoJaGmnC1qMyBjCNoPy6+Qv9uPOEAfM/FoQ7Fj2hausfF/U= 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 1725054508787516.7323194929277; Fri, 30 Aug 2024 14:48:28 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.786653.1196274 (Exim 4.92) (envelope-from ) id 1sk9TV-00056r-T1; Fri, 30 Aug 2024 21:48:09 +0000 Received: by outflank-mailman (output) from mailman id 786653.1196274; Fri, 30 Aug 2024 21:48:09 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sk9TV-00056i-PW; Fri, 30 Aug 2024 21:48:09 +0000 Received: by outflank-mailman (input) for mailman id 786653; Fri, 30 Aug 2024 21:48:08 +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 1sk9TU-0004BO-Qk for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 21:48:08 +0000 Received: from sender4-of-o51.zoho.com (sender4-of-o51.zoho.com [136.143.188.51]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 89e4a070-6719-11ef-99a1-01e77a169b0f; Fri, 30 Aug 2024 23:48:07 +0200 (CEST) Received: by mx.zohomail.com with SMTPS id 1725054463025557.548854351013; Fri, 30 Aug 2024 14:47:43 -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: 89e4a070-6719-11ef-99a1-01e77a169b0f ARC-Seal: i=1; a=rsa-sha256; t=1725054465; cv=none; d=zohomail.com; s=zohoarc; b=kZfzSBiAOcWM1nNWw8G6aWDYpPkIo63VSHznsMdZ2tqCKj39rJ5gHMuBO18irh/KNd7mnxlzwXRgiMzhsOOTs/FPMtu497XfFgODVZAmSVjeCYoNseK5XEWWbfM0FinWWFw+vvzBmdhXaNeUAvjiF+CePNUbqszKR0tCF4sblEY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1725054465; 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=Qexd3Ieo0x5aB7CkcPEqhzSRdIxc4KHzWNUKGdjfDMk=; b=L8nQ3JmrkA4ybkEhwkoZFrMqtzpmqd8nXSww2zkjd2cp3Wi9cCR8ny91f6MqwV1v/7+lkj+2DUCgLXYEjVmBsh9RkbHQIY0WZ/yiK1apwAiDkTyuNvQrVaVB9VUH1fnPS6ltTzCQhWfdSWXA/egn1z7/HY2P95RKHv6Vvyp3Uk4= 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=1725054465; 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=Qexd3Ieo0x5aB7CkcPEqhzSRdIxc4KHzWNUKGdjfDMk=; b=kKDzBb+ZDpO2+u840lmHk+yzp84/29Qyboj/exo/kudo2h9Ieg65aP9GRtqhDxzJ 07MU7U9q62rJim9GQL4XzZ91lUKyL8HpU799r2HDgAa8e18oHwI3EjZTddjgDofF6IO TrmJmuTTm6OuTZkg0VhLOg1bE2qVgI7i+I7Pgi+A= From: "Daniel P. Smith" To: xen-devel@lists.xenproject.org Cc: "Daniel P. Smith" , jason.andryuk@amd.com, christopher.w.clark@gmail.com, Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [PATCH v4 03/44] x86/boot: move cmdline to boot info Date: Fri, 30 Aug 2024 17:46:48 -0400 Message-Id: <20240830214730.1621-4-dpsmith@apertussolutions.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20240830214730.1621-1-dpsmith@apertussolutions.com> References: <20240830214730.1621-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: 1725054510599116600 Content-Type: text/plain; charset="utf-8" Transition Xen's command line to being held in struct boot_info. No functional change intended. Signed-off-by: Daniel P. Smith Acked-by: Andrew Cooper --- xen/arch/x86/include/asm/bootinfo.h | 1 + xen/arch/x86/setup.c | 21 +++++++++++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/xen/arch/x86/include/asm/bootinfo.h b/xen/arch/x86/include/asm= /bootinfo.h index e69feb1bb8be..d2ca077d2356 100644 --- a/xen/arch/x86/include/asm/bootinfo.h +++ b/xen/arch/x86/include/asm/bootinfo.h @@ -12,6 +12,7 @@ struct boot_info { unsigned int nr_mods; =20 const char *boot_loader_name; + const char *cmdline; }; =20 #endif diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index 432b7d1701e4..a945fa10555f 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -276,6 +276,8 @@ static int __init cf_check parse_acpi_param(const char = *s) } custom_param("acpi", parse_acpi_param); =20 +static const char *cmdline_cook(const char *p, const char *loader_name); + static const module_t *__initdata initial_images; static struct boot_info __initdata *boot_info; =20 @@ -288,6 +290,13 @@ static void __init multiboot_to_bootinfo(multiboot_inf= o_t *mbi) info.boot_loader_name =3D (mbi->flags & MBI_LOADERNAME) ? __va(mbi->boot_loader_name) : "unknown"; =20 + /* Parse the command-line options. */ + if ( mbi->flags & MBI_CMDLINE ) + info.cmdline =3D cmdline_cook(__va(mbi->cmdline), + info.boot_loader_name); + else + info.cmdline =3D ""; + boot_info =3D &info; } =20 @@ -996,7 +1005,7 @@ static struct domain *__init create_dom0(const module_= t *image, =20 void asmlinkage __init noreturn __start_xen(unsigned long mbi_p) { - const char *memmap_type =3D NULL, *cmdline =3D ""; + const char *memmap_type =3D NULL; char *kextra; void *bsp_stack; struct cpu_info *info =3D get_cpu_info(), *bsp_info; @@ -1049,11 +1058,7 @@ void asmlinkage __init noreturn __start_xen(unsigned= long mbi_p) =20 multiboot_to_bootinfo(mbi); =20 - /* Parse the command-line options. */ - if ( mbi->flags & MBI_CMDLINE ) - cmdline =3D cmdline_cook(__va(mbi->cmdline), boot_info->boot_loade= r_name); - - if ( (kextra =3D strstr(cmdline, " -- ")) !=3D NULL ) + if ( (kextra =3D strstr(boot_info->cmdline, " -- ")) !=3D NULL ) { /* * Options after ' -- ' separator belong to dom0. @@ -1064,7 +1069,7 @@ void asmlinkage __init noreturn __start_xen(unsigned = long mbi_p) kextra +=3D 3; while ( kextra[1] =3D=3D ' ' ) kextra++; } - cmdline_parse(cmdline); + cmdline_parse(boot_info->cmdline); =20 /* Must be after command line argument parsing and before * allocing any xenheap structures wanted in lower memory. */ @@ -1094,7 +1099,7 @@ void asmlinkage __init noreturn __start_xen(unsigned = long mbi_p) =20 printk("Bootloader: %s\n", boot_info->boot_loader_name); =20 - printk("Command line: %s\n", cmdline); + printk("Command line: %s\n", boot_info->cmdline); =20 printk("Xen image load base address: %#lx\n", xen_phys_start); if ( hypervisor_name ) --=20 2.30.2