Re: Non-booting current Linus' tree

Linus Torvalds
2015-07-03T21:40:30Z

On Fri, Jul 3, 2015 at 8:23 AM, Jan Kara <jack@suse.cz> wrote:
>
> Because the address isn't 32-byte aligned (which I assume is the
> requirement from looking into the code). So clearly my gcc messed up and
> miscompiled the thing by ignoring the alignment attribute.

Well, it's probably a mistake to begin with to expect gcc to get stack
alignment right. Especially since we tell gcc to not align the stack
as much as it usually wants to with -mpreferred-stack-boundary=2.

The code is broken in other ways too. The fxsave alignment isn't 32
bytes. It's 16 bytes. And that's already encoded in the "struct
fxregs_state", so adding that extra alignment is just bogus crud
anyway.

So I seriously think that the whole commit 91a8c2a5b43f is just
fundamentally broken and should probably be reverted. The theoretical
issue it fixes is a smaller problem than the broken code it introduces
(and I'm not just talking about gcc bugs).

Plus the code just sets up and writes to a global variable *anyway*,
so the alleged race with using a static allocation is bogus: if that's
a real concern, then the code is fundamentally buggy in other ways
anyway.

I don't think you can boot with different CPU's having different mxcsr
features anyway, so..

Ingo?

Linus