[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v6 03/44] x86/boot: move cmdline to boot info


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Date: Thu, 17 Oct 2024 13:02:43 -0400
  • Arc-authentication-results: i=1; mx.zohomail.com; dkim=pass header.i=apertussolutions.com; spf=pass smtp.mailfrom=dpsmith@xxxxxxxxxxxxxxxxxxxx; dmarc=pass header.from=<dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1729184621; 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=Dr1jKzgUHAaiQbYekBVD6PQo4dQeZnEBKNdNITplfLE=; b=TZkx8ohR4MO2a4uoshPcehr5lwl0XBEyWwM/xabNwAFb84nam0gObY5GPqStjoLYH/j9lxq21KdeAFDSCWsL2OkbdbuVDCwMf9E39nDkKiGpS93UmXu+6tblwaS4WhuSZg939o5wxD4Xv8W6y/hdsLAQuOfbocr2asoZ4AlAdRU=
  • Arc-seal: i=1; a=rsa-sha256; t=1729184621; cv=none; d=zohomail.com; s=zohoarc; b=Jj69mog7FESSW+fvVP3+RCzMBMmqWmc3v0uPKmHRi8b263x7K6eX/88EhvivAybvDSZJa+Kwk8WgtHtneYbmvzcvenJNbaglQ/syLwxfUkCi3W2iddyWxMHn1+sEsDXlWJUSk0SoyD4hhDJzR/HlBk+1feG0SIXWvd/XQGZDPUE=
  • Cc: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, jason.andryuk@xxxxxxx, christopher.w.clark@xxxxxxxxx, stefano.stabellini@xxxxxxx, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Thu, 17 Oct 2024 17:08:22 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Transition Xen's command line to being held in struct boot_info.

No functional change intended.

Signed-off-by: Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>
Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

---

Changes since v5:
- reorder struct boot_module fields
---
 xen/arch/x86/include/asm/bootinfo.h |  1 +
 xen/arch/x86/setup.c                | 20 ++++++++++++--------
 2 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/include/asm/bootinfo.h 
b/xen/arch/x86/include/asm/bootinfo.h
index bec35e7c2f23..efbbd30cc514 100644
--- a/xen/arch/x86/include/asm/bootinfo.h
+++ b/xen/arch/x86/include/asm/bootinfo.h
@@ -14,6 +14,7 @@
  */
 struct boot_info {
     const char *loader;
+    const char *cmdline;
 
     unsigned int nr_modules;
 };
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index eac0954f42b8..037cdd17386c 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -274,6 +274,8 @@ static int __init cf_check parse_acpi_param(const char *s)
 }
 custom_param("acpi", parse_acpi_param);
 
+static const char *cmdline_cook(const char *p, const char *loader_name);
+
 static const module_t *__initdata initial_images;
 
 struct boot_info __initdata xen_boot_info;
@@ -288,6 +290,12 @@ static struct boot_info *__init 
multiboot_fill_boot_info(unsigned long mbi_p)
     bi->loader = (mbi->flags & MBI_LOADERNAME) ? __va(mbi->boot_loader_name)
                                                : "unknown";
 
+    /* Parse the command-line options. */
+    if ( mbi->flags & MBI_CMDLINE )
+        bi->cmdline = cmdline_cook(__va(mbi->cmdline), bi->loader);
+    else
+        bi->cmdline = "";
+
     return bi;
 }
 
@@ -981,7 +989,7 @@ static struct domain *__init create_dom0(const module_t 
*image,
 
 void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
 {
-    const char *memmap_type = NULL, *cmdline = "";
+    const char *memmap_type = NULL;
     char *kextra;
     void *bsp_stack;
     struct cpu_info *info = get_cpu_info(), *bsp_info;
@@ -1035,11 +1043,7 @@ void asmlinkage __init noreturn __start_xen(unsigned 
long mbi_p)
 
     bi = multiboot_fill_boot_info(mbi_p);
 
-    /* Parse the command-line options. */
-    if ( mbi->flags & MBI_CMDLINE )
-        cmdline = cmdline_cook(__va(mbi->cmdline), bi->loader);
-
-    if ( (kextra = strstr(cmdline, " -- ")) != NULL )
+    if ( (kextra = strstr(bi->cmdline, " -- ")) != NULL )
     {
         /*
          * Options after ' -- ' separator belong to dom0.
@@ -1050,7 +1054,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long 
mbi_p)
         kextra += 3;
         while ( kextra[1] == ' ' ) kextra++;
     }
-    cmdline_parse(cmdline);
+    cmdline_parse(bi->cmdline);
 
     /* Must be after command line argument parsing and before
      * allocing any xenheap structures wanted in lower memory. */
@@ -1080,7 +1084,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long 
mbi_p)
 
     printk("Bootloader: %s\n", bi->loader);
 
-    printk("Command line: %s\n", cmdline);
+    printk("Command line: %s\n", bi->cmdline);
 
     printk("Xen image load base address: %#lx\n", xen_phys_start);
     if ( hypervisor_name )
-- 
2.30.2




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.