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

[PATCH v6 02/44] x86/boot: move boot loader name to boot info


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Date: Thu, 17 Oct 2024 13:02:42 -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=1729184619; 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=ioXQiGftZuaa2y3+MlFiiL8tR31atQ3yfwKB0el8GZ8=; b=VaJcEyEJjFdnj/N4MA3zPIYriY3qvUdSJQRZxarLxrJx4T1H5Uroq8obavFfiXf5maVkuwqQQ7IsVEogrxsB3zFwfZfMuV1VeTackddCBjmxxcbmOi4tyVzV12kBR+caetQJ5i7YxuBRZm47HenEJ4iio1AZ7Ng2vbIDRZ8k44Q=
  • Arc-seal: i=1; a=rsa-sha256; t=1729184619; cv=none; d=zohomail.com; s=zohoarc; b=Gmtj6AN39W5taH+ZtDAgTM9cSAB3DsnuX0gmnoywqsFxdXHlLJ5cJsU3GtKhgZ3rc3wK+WFzOblQXuIHhbGRJnCQEIKhvTV49Nareno5T4bncVyOiOS67dDZX66glaBvQ3/pcTgT2FRFRr4XvRH4Smo61hPApzcAG5jE4V9jIs8=
  • Cc: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, jason.andryuk@xxxxxxx, christopher.w.clark@xxxxxxxxx, stefano.stabellini@xxxxxxx, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Thu, 17 Oct 2024 17:03:59 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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>
---
Changes since v5:
- reorder struct boot_module fields
- code style changes
---
 xen/arch/x86/include/asm/bootinfo.h |  2 ++
 xen/arch/x86/setup.c                | 16 ++++++++--------
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/include/asm/bootinfo.h 
b/xen/arch/x86/include/asm/bootinfo.h
index a649500ee3a2..bec35e7c2f23 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 6201ca0fad19..eac0954f42b8 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -285,6 +285,9 @@ static struct boot_info *__init 
multiboot_fill_boot_info(unsigned long mbi_p)
 
     bi->nr_modules = (mbi->flags & MBI_MODULES) ? mbi->mods_count : 0;
 
+    bi->loader = (mbi->flags & MBI_LOADERNAME) ? __va(mbi->boot_loader_name)
+                                               : "unknown";
+
     return bi;
 }
 
@@ -978,7 +981,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;
@@ -1032,12 +1035,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 )
     {
@@ -1078,7 +1078,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);
 
@@ -1171,7 +1171,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";
@@ -2039,7 +2039,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");
 
-- 
2.30.2




 


Rackspace

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