[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130107155617.GF29449@x1.alien8.de>
Date: Mon, 7 Jan 2013 16:56:17 +0100
From: Borislav Petkov <bp@...en8.de>
To: Yinghai Lu <yinghai@...nel.org>
Cc: Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...e.hu>,
"H. Peter Anvin" <hpa@...or.com>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Jan Kiszka <jan.kiszka@....de>,
Jason Wessel <jason.wessel@...driver.com>,
linux-kernel@...r.kernel.org, Gokul Caushik <caushik1@...il.com>,
Josh Triplett <josh@...htriplett.org>,
Joe Millenbach <jmillenbach@...il.com>,
Alexander Duyck <alexander.h.duyck@...el.com>
Subject: Re: [PATCH v7u1 13/31] x86, boot: add get_cmd_line_ptr()
On Thu, Jan 03, 2013 at 04:48:33PM -0800, Yinghai Lu wrote:
> later will check ext_cmd_line_ptr at the same time.
>
> Signed-off-by: Yinghai Lu <yinghai@...nel.org>
> Cc: Gokul Caushik <caushik1@...il.com>
> Cc: Josh Triplett <josh@...htriplett.org>
> Cc: Joe Millenbach <jmillenbach@...il.com>
> Cc: Alexander Duyck <alexander.h.duyck@...el.com>
> ---
> arch/x86/boot/compressed/cmdline.c | 10 ++++++++--
> arch/x86/kernel/head64.c | 13 +++++++++++--
> 2 files changed, 19 insertions(+), 4 deletions(-)
>
> diff --git a/arch/x86/boot/compressed/cmdline.c b/arch/x86/boot/compressed/cmdline.c
> index 10f6b11..b4c913c 100644
> --- a/arch/x86/boot/compressed/cmdline.c
> +++ b/arch/x86/boot/compressed/cmdline.c
> @@ -13,13 +13,19 @@ static inline char rdfs8(addr_t addr)
> return *((char *)(fs + addr));
> }
> #include "../cmdline.c"
> +static unsigned long get_cmd_line_ptr(void)
> +{
> + unsigned long cmd_line_ptr = real_mode->hdr.cmd_line_ptr;
> +
> + return cmd_line_ptr;
return (unsigned long)real_mode->hdr.cmd_line_ptr;
should suffice.
> +}
> int cmdline_find_option(const char *option, char *buffer, int bufsize)
> {
> - return __cmdline_find_option(real_mode->hdr.cmd_line_ptr, option, buffer, bufsize);
> + return __cmdline_find_option(get_cmd_line_ptr(), option, buffer, bufsize);
> }
> int cmdline_find_option_bool(const char *option)
> {
> - return __cmdline_find_option_bool(real_mode->hdr.cmd_line_ptr, option);
> + return __cmdline_find_option_bool(get_cmd_line_ptr(), option);
> }
>
> #endif
> diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c
> index c463725..316e7b2 100644
> --- a/arch/x86/kernel/head64.c
> +++ b/arch/x86/kernel/head64.c
> @@ -111,13 +111,22 @@ static void __init clear_bss(void)
> (unsigned long) __bss_stop - (unsigned long) __bss_start);
> }
>
> +static unsigned long get_cmd_line_ptr(void)
> +{
> + unsigned long cmd_line_ptr = boot_params.hdr.cmd_line_ptr;
> +
> + return cmd_line_ptr;
ditto.
> +}
> +
> static void __init copy_bootdata(char *real_mode_data)
> {
> char * command_line;
> + unsigned long cmd_line_ptr;
>
> memcpy(&boot_params, real_mode_data, sizeof boot_params);
> - if (boot_params.hdr.cmd_line_ptr) {
> - command_line = __va(boot_params.hdr.cmd_line_ptr);
> + cmd_line_ptr = get_cmd_line_ptr();
> + if (cmd_line_ptr) {
> + command_line = __va(cmd_line_ptr);
> memcpy(boot_command_line, command_line, COMMAND_LINE_SIZE);
> }
> }
> --
> 1.7.10.4
>
>
--
Regards/Gruss,
Boris.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists