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

[Xen-devel] [PATCH for-xen-4.5 v3 08/16] x86: Move cmdline from mbi to boot_info



Signed-off-by: Daniel Kiper <daniel.kiper@xxxxxxxxxx>
---
 xen/arch/x86/boot_info.c        |    9 ++++-----
 xen/arch/x86/efi/efi-boot.h     |    8 +++-----
 xen/arch/x86/setup.c            |    4 +---
 xen/common/efi/runtime.c        |    1 +
 xen/include/asm-x86/boot_info.h |    3 +++
 5 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/xen/arch/x86/boot_info.c b/xen/arch/x86/boot_info.c
index 5851123..7101f6c 100644
--- a/xen/arch/x86/boot_info.c
+++ b/xen/arch/x86/boot_info.c
@@ -28,6 +28,7 @@ static multiboot_info_t __read_mostly mbi;
 
 static boot_info_t __read_mostly boot_info_mb = {
     .boot_loader_name = "UNKNOWN",
+    .cmdline = NULL,
     .warn_msg = NULL,
     .err_msg = NULL
 };
@@ -40,11 +41,6 @@ unsigned long __init __init_mbi(u32 mbd_pa)
 
     enable_exception_support();
 
-    if ( mbd->cmdline ) {
-        mbi.flags |= MBI_CMDLINE;
-        mbi.cmdline = mbd->cmdline;
-    }
-
     mbi.flags |= MBI_MEMLIMITS;
     mbi.mem_lower = mbd->mem_lower;
     mbi.mem_upper = mbd->mem_upper;
@@ -67,5 +63,8 @@ paddr_t __init __init_boot_info(u32 mbd_pa)
     if ( mbd->boot_loader_name )
         boot_info_mb.boot_loader_name = __va(mbd->boot_loader_name);
 
+    if ( mbd->cmdline )
+        boot_info_mb.cmdline = __va(mbd->cmdline);
+
     return __pa(&boot_info_mb);
 }
diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/efi/efi-boot.h
index 29504e9..3b5628a 100644
--- a/xen/arch/x86/efi/efi-boot.h
+++ b/xen/arch/x86/efi/efi-boot.h
@@ -290,10 +290,10 @@ static void __init efi_arch_handle_cmdline(CHAR16 
*image_name,
     {
         name.w = cmdline_options;
         w2s(&name);
-        place_string_u32(&mbi.cmdline, name.s);
+        place_string_char(&boot_info_efi.cmdline, name.s);
     }
     if ( cfgfile_options )
-        place_string_u32(&mbi.cmdline, cfgfile_options);
+        place_string_char(&boot_info_efi.cmdline, cfgfile_options);
     /* Insert image name last, as it gets prefixed to the other options. */
     if ( image_name )
     {
@@ -302,10 +302,8 @@ static void __init efi_arch_handle_cmdline(CHAR16 
*image_name,
     }
     else
         name.s = "xen";
-    place_string_u32(&mbi.cmdline, name.s);
+    place_string_char(&boot_info_efi.cmdline, name.s);
 
-    if ( mbi.cmdline )
-        mbi.flags |= MBI_CMDLINE;
     /*
      * These must not be initialized statically, since the value must
      * not get relocated when processing base relocations later.
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index c4642f3..d7416d3 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -579,9 +579,7 @@ void __init noreturn __start_xen(unsigned long mbi_p, 
paddr_t boot_info_pa)
     }
 
     /* Parse the command-line options. */
-    cmdline = cmdline_cook((mbi->flags & MBI_CMDLINE) ?
-                           __va(mbi->cmdline) : NULL,
-                           boot_info->boot_loader_name);
+    cmdline = cmdline_cook(boot_info->cmdline, boot_info->boot_loader_name);
     if ( (kextra = strstr(cmdline, " -- ")) != NULL )
     {
         /*
diff --git a/xen/common/efi/runtime.c b/xen/common/efi/runtime.c
index 7846b2b..ee2ee2d 100644
--- a/xen/common/efi/runtime.c
+++ b/xen/common/efi/runtime.c
@@ -55,6 +55,7 @@ const struct efi_pci_rom *__read_mostly efi_pci_roms;
 #ifndef CONFIG_ARM /* TODO - disabled until implemented on ARM */
 boot_info_t __read_mostly boot_info_efi = {
     .boot_loader_name = "EFI",
+    .cmdline = NULL,
     .warn_msg = NULL,
     .err_msg = NULL
 };
diff --git a/xen/include/asm-x86/boot_info.h b/xen/include/asm-x86/boot_info.h
index 58a4cb6..d74ed67 100644
--- a/xen/include/asm-x86/boot_info.h
+++ b/xen/include/asm-x86/boot_info.h
@@ -32,6 +32,9 @@ typedef struct {
     /* Boot loader name. */
     char *boot_loader_name;
 
+    /* Xen command line. */
+    char *cmdline;
+
     /*
      * Info about warning occurred during boot_info initialization.
      * NULL if everything went OK.
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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