[lkml]   [2015]   [Jul]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] x86/fpu: Fix boot crash in the early FPU code
On Sat, 4 Jul 2015, Ingo Molnar wrote:

> Btw., is it a GCC bug or a known GCC property that a structure with a 16-byte
> alignment attribute does not get properly aligned on the stack?

What's the stack alignment mandated by the x86 psABI? Is that anything
beyond what the PUSH instructions imply (i.e. 4 bytes for 32-bit and 8
bytes for 64-bit targets)? Otherwise GCC might not be smart enough to
apply the right subtract and mask operations to the stack/frame pointer.
This might even have been documented with the alignment attribute.

> So fix this bug by making the variable static again, but also mark it
> __initdata this time, because fpu__init_system_mxcsr() is now an
> __init function.

You could have used `alloca' and manually aligned the structure within
the area obtained too (to avoid static storage if desired).



 \ /
  Last update: 2015-07-05 12:21    [W:0.068 / U:0.900 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site