]> xenbits.xensource.com Git - people/andrewcoop/xen.git/commitdiff
x86/boot: move boot loader name to boot info
authorDaniel P. Smith <dpsmith@apertussolutions.com>
Thu, 17 Oct 2024 17:02:42 +0000 (13:02 -0400)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 17 Oct 2024 22:42:51 +0000 (23:42 +0100)
Transition the incoming boot loader name to be held in struct boot_info.

No functional change intended.

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

index 385579e2b502ecbcf4fd886b4d34647e98dd854b..f066110f4b57c07523b6848a340603ad27f2f22c 100644 (file)
@@ -13,6 +13,8 @@
  * bootloader/environment, or derived from the information.
  */
 struct boot_info {
+    const char *loader;
+
     unsigned int nr_modules;
 };
 
index 7464c3d49bd2e7dfb0b4e499990ff77a5d9541af..9e22528f4b3b85952f5b7957dde4fe2223021eef 100644 (file)
@@ -277,6 +277,7 @@ custom_param("acpi", parse_acpi_param);
 static const module_t *__initdata initial_images;
 
 struct boot_info __initdata xen_boot_info = {
+    .loader = "unknown",
 };
 
 static struct boot_info *__init multiboot_fill_boot_info(unsigned long mbi_p)
@@ -287,6 +288,9 @@ static struct boot_info *__init multiboot_fill_boot_info(unsigned long mbi_p)
     if ( mbi->flags & MBI_MODULES )
         bi->nr_modules = mbi->mods_count;
 
+    if ( mbi->flags & MBI_LOADERNAME )
+        bi->loader = __va(mbi->boot_loader_name);
+
     return bi;
 }
 
@@ -980,7 +984,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, *loader, *cmdline = "";
+    const char *memmap_type = NULL, *cmdline = "";
     char *kextra;
     void *bsp_stack;
     struct cpu_info *info = get_cpu_info(), *bsp_info;
@@ -1034,12 +1038,9 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
 
     bi = multiboot_fill_boot_info(mbi_p);
 
-    loader = (mbi->flags & MBI_LOADERNAME) ? __va(mbi->boot_loader_name)
-                                           : "unknown";
-
     /* Parse the command-line options. */
     if ( mbi->flags & MBI_CMDLINE )
-        cmdline = cmdline_cook(__va(mbi->cmdline), loader);
+        cmdline = cmdline_cook(__va(mbi->cmdline), bi->loader);
 
     if ( (kextra = strstr(cmdline, " -- ")) != NULL )
     {
@@ -1080,7 +1081,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
     if ( pvh_boot )
         pvh_print_info();
 
-    printk("Bootloader: %s\n", loader);
+    printk("Bootloader: %s\n", bi->loader);
 
     printk("Command line: %s\n", cmdline);
 
@@ -1173,7 +1174,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
         l3_bootmap[l3_table_offset(BOOTSTRAP_MAP_BASE)] =
             l3e_from_paddr(__pa(l2_bootmap), __PAGE_HYPERVISOR);
 
-        memmap_type = loader;
+        memmap_type = bi->loader;
     }
     else if ( efi_enabled(EFI_BOOT) )
         memmap_type = "EFI";
@@ -2041,7 +2042,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
      */
     dom0 = create_dom0(mod, modules_headroom,
                        initrdidx < bi->nr_modules ? mod + initrdidx : NULL,
-                       kextra, loader);
+                       kextra, bi->loader);
     if ( !dom0 )
         panic("Could not set up DOM0 guest OS\n");