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

Re: [Xen-devel] [PATCH for-xen-4.5 v4 10/18] x86: move cmdline from mbi to boot_info



On 17/10/2014 15:12, Daniel Kiper wrote:
Signed-off-by: Daniel Kiper <daniel.kiper@xxxxxxxxxx>

After adjusting for relevant review given in previous patches,

Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

---
  xen/arch/x86/boot_info.c        |   10 ++++------
  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(+), 14 deletions(-)

diff --git a/xen/arch/x86/boot_info.c b/xen/arch/x86/boot_info.c
index a81e98b..7d8b0e5 100644
--- a/xen/arch/x86/boot_info.c
+++ b/xen/arch/x86/boot_info.c
@@ -30,6 +30,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,12 +41,6 @@ unsigned long __init __init_mbi(u32 mbd_pa)
enable_bsp_exception_support(); - if ( mbd->cmdline )
-    {
-        mbi.flags |= MBI_CMDLINE;
-        mbi.cmdline = mbd->cmdline;
-    }
-
      if ( mbd->mem_lower || mbd->mem_upper )
      {
          mbi.flags |= MBI_MEMLIMITS;
@@ -77,5 +72,8 @@ boot_info_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 &boot_info_mb;
  }
diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/efi/efi-boot.h
index 19be165..f02e604 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 a9dbc05..8f83969 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -578,9 +578,7 @@ void __init noreturn __start_xen(unsigned long mbi_p, 
boot_info_t *boot_info_ptr
      }
/* 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 9e68447..44d1674 100644
--- a/xen/include/asm-x86/boot_info.h
+++ b/xen/include/asm-x86/boot_info.h
@@ -33,6 +33,9 @@ typedef struct {
      /* Boot loader name. */
      const char *boot_loader_name;
+ /* Xen command line. */
+    char *cmdline;
+
      /*
       * Info about warning occurred during boot_info initialization.
       * NULL if everything went OK.


_______________________________________________
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®.