lkml.org 
[lkml]   [2015]   [May]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] x86: tell the world boot_params is 16-byte aligned
From
Date
NAK.  This could break in the case of careless bootloaders...

On May 8, 2015 9:23:52 AM PDT, Rasmus Villemoes <linux@rasmusvillemoes.dk> wrote:
>On Fri, May 08 2015, Borislav Petkov <bp@alien8.de> wrote:
>
>> On Fri, May 08, 2015 at 03:42:33PM +0200, Rasmus Villemoes wrote:
>>> It doesn't matter much, but this disassembly makes me cry a little
>bit:
>>>
>>> ffffffff81f21223 <copy_bootdata>:
>>> ffffffff81f21223: 55 push %rbp
>>> ffffffff81f21224: 48 c7 c0 40 c2 02 82 mov
>$0xffffffff8202c240,%rax
>>> ffffffff81f2122b: 48 89 fe mov %rdi,%rsi
>>> ffffffff81f2122e: a8 01 test $0x1,%al
>>>
>>> The reason is that boot_params is defined with
>>> __attribute__((aligned(16))) in boot/main.c, but other translation
>>> units only see the packed attribute on the definition of struct
>>> boot_params, so assume the worst. Making the de facto alignment
>public
>>
>> Wouldn't it be better if we put both attributes together, i.e.:
>
>Sure, putting it on the type works as well. Either way is fine with me.
>
>Rasmus

--
Sent from my mobile phone. Please pardon brevity and lack of formatting.


\
 
 \ /
  Last update: 2015-05-08 19:01    [W:0.057 / U:3.808 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site