[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAE9FiQWXjMLmhL40A7j4nWpTxY86XegGpXy-9uqYBbqq4Tz3zA@mail.gmail.com>
Date: Mon, 14 Jan 2013 15:06:28 -0800
From: Yinghai Lu <yinghai@...nel.org>
To: Borislav Petkov <bp@...e.de>, Yinghai Lu <yinghai@...nel.org>,
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, Rob Landley <rob@...dley.net>,
Matt Fleming <matt.fleming@...el.com>,
Gokul Caushik <caushik1@...il.com>,
Josh Triplett <josh@...htriplett.org>,
Joe Millenbach <jmillenbach@...il.com>
Subject: Re: [PATCH v7u1 22/31] x86, boot: add fields to support load bzImage
and ramdisk above 4G
On Mon, Jan 14, 2013 at 1:43 AM, Borislav Petkov <bp@...e.de> wrote:
>> >> --- a/arch/x86/boot/compressed/cmdline.c
>> >> +++ b/arch/x86/boot/compressed/cmdline.c
>> >> @@ -17,6 +17,8 @@ static unsigned long get_cmd_line_ptr(void)
>> >> {
>> >> unsigned long cmd_line_ptr = real_mode->hdr.cmd_line_ptr;
>> >>
>> >> + cmd_line_ptr |= (u64)real_mode->ext_cmd_line_ptr << 32;
>> >> +
>> >> return cmd_line_ptr;
>> >> }
>> >
>> > On 32-bit, this unsigned long cmd_line_ptr is 4 bytes and the OR doesn't
>> > have any effect on the final result. You probably want to do:
>>
>> yes, that is what we want to keep 32bit and 64bit unified.
>>
>> >
>> > #ifdef CONFIG_64BIT
>> > cmd_line_ptr |= (u64)real_mode->ext_cmd_line_ptr << 32;
>> > #endif
>> >
>> > right?
>> >
>> > Or instead look at ->sentinel to know whether the ext_* fields are valid
>> > or not, and save yourself the OR if not.
>>
>> no.
>>
>> that is whole point of sentinel, we don't need to check sentinel everywhere
>> because ext_* are valid.
>
> Dude, do you even read my comments? This line:
>
> cmd_line_ptr |= (u64)real_mode->ext_cmd_line_ptr << 32;
>
> doesn't do a whit on 32-bit. So execute it *only* on 32-bit!
Following should work on 32bit, and keep them same code on
32bit and 64bit.
because ext_cmd_line_ptr is always 0 on 32bit.
Index: linux-2.6/arch/x86/boot/compressed/cmdline.c
===================================================================
--- linux-2.6.orig/arch/x86/boot/compressed/cmdline.c
+++ linux-2.6/arch/x86/boot/compressed/cmdline.c
@@ -17,6 +17,9 @@ static unsigned long get_cmd_line_ptr(vo
{
unsigned long cmd_line_ptr = real_mode->hdr.cmd_line_ptr;
+ if (real_mode->ext_cmd_line_ptr)
+ cmd_line_ptr |= (u64)real_mode->ext_cmd_line_ptr << 32;
+
return cmd_line_ptr;
}
int cmdline_find_option(const char *option, char *buffer, int bufsize)
--
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