From: Daniel Kiper Subject: [PATCH for-xen-4.5 v4 10/18] x86: move cmdline from mbi to boot_info Date: Fri, 17 Oct 2014 16:12:03 +0200 Message-ID: <1413555132-22138-11-git-send-email-daniel.kiper@oracle.com> References: <1413555132-22138-1-git-send-email-daniel.kiper@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Xf8HU-0003eY-2N for xen-devel@lists.xenproject.org; Fri, 17 Oct 2014 14:13:24 +0000 In-Reply-To: <1413555132-22138-1-git-send-email-daniel.kiper@oracle.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: jgross@suse.com, keir@xen.org, ian.campbell@citrix.com, andrew.cooper3@citrix.com, stefano.stabellini@eu.citrix.com, ross.philipson@citrix.com, roy.franz@linaro.org, ning.sun@intel.com, jbeulich@suse.com, qiaowei.ren@intel.com, richard.l.maliszewski@intel.com, gang.wei@intel.com, fu.wei@linaro.org List-Id: xen-devel@lists.xenproject.org Signed-off-by: Daniel Kiper --- 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. -- 1.7.10.4