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

[xen staging] x86/boot: move boot loader name to boot info



commit b438c5fbf4c02145f6ecc8642290d46bf1957388
Author:     Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>
AuthorDate: Thu Oct 17 13:02:42 2024 -0400
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Thu Oct 17 23:42:51 2024 +0100

    x86/boot: move boot loader name to boot info
    
    Transition the incoming boot loader name to be held in struct boot_info.
    
    No functional change intended.
    
    Signed-off-by: Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>
    Reviewed-by: Jason Andryuk <jason.andryuk@xxxxxxx>
    Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 xen/arch/x86/include/asm/bootinfo.h |  2 ++
 xen/arch/x86/setup.c                | 17 +++++++++--------
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/include/asm/bootinfo.h 
b/xen/arch/x86/include/asm/bootinfo.h
index 385579e2b5..f066110f4b 100644
--- a/xen/arch/x86/include/asm/bootinfo.h
+++ b/xen/arch/x86/include/asm/bootinfo.h
@@ -13,6 +13,8 @@
  * bootloader/environment, or derived from the information.
  */
 struct boot_info {
+    const char *loader;
+
     unsigned int nr_modules;
 };
 
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 7464c3d49b..9e22528f4b 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -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");
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

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