]> xenbits.xensource.com Git - xen.git/commitdiff
x86/boot: move cmdline to boot info
authorDaniel P. Smith <dpsmith@apertussolutions.com>
Thu, 17 Oct 2024 17:02:43 +0000 (13:02 -0400)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 17 Oct 2024 22:42:51 +0000 (23:42 +0100)
Transition Xen's command line to being held in struct boot_info.

No functional change intended.

Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/include/asm/bootinfo.h
xen/arch/x86/setup.c

index f066110f4b57c07523b6848a340603ad27f2f22c..c980f0bdb74b8078f3de3a4032f7202184acc237 100644 (file)
@@ -14,6 +14,7 @@
  */
 struct boot_info {
     const char *loader;
+    const char *cmdline;
 
     unsigned int nr_modules;
 };
index 9e22528f4b3b85952f5b7957dde4fe2223021eef..01e35b965956330c01cffa5deb67018de3520cd1 100644 (file)
@@ -274,10 +274,13 @@ 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 = {
     .loader = "unknown",
+    .cmdline = "",
 };
 
 static struct boot_info *__init multiboot_fill_boot_info(unsigned long mbi_p)
@@ -291,6 +294,9 @@ static struct boot_info *__init multiboot_fill_boot_info(unsigned long mbi_p)
     if ( mbi->flags & MBI_LOADERNAME )
         bi->loader = __va(mbi->boot_loader_name);
 
+    if ( mbi->flags & MBI_CMDLINE )
+        bi->cmdline = cmdline_cook(__va(mbi->cmdline), bi->loader);
+
     return bi;
 }
 
@@ -984,7 +990,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;
@@ -1039,10 +1045,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.
@@ -1053,7 +1056,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. */
@@ -1083,7 +1086,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 )