Re: [PATCH v7u1 22/31] x86, boot: add fields to support load bzImageand ramdisk above 4G

From: H. Peter Anvin
Date: Mon Jan 14 2013 - 18:10:59 EST


On 01/13/2013 01:41 PM, Borislav Petkov wrote:
>> diff --git a/arch/x86/boot/compressed/cmdline.c b/arch/x86/boot/compressed/cmdline.c
>> index b4c913c..bffd73b 100644
>> --- 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:
>
> #ifdef CONFIG_64BIT
> cmd_line_ptr |= (u64)real_mode->ext_cmd_line_ptr << 32;
> #endif
>
> right?
>

Actually, on 32 bits the compiler will simply drop the statement on the
floor, no #ifdef required. If gcc outputs a warning we should do
something about it, otherwise we can just plain ignore it.

-hpa


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/