From: Andy Lutomirski <luto@amacapital.net>
To: Linus Torvalds <torvalds@linux-foundation.org>, Jan Kara <jack@suse.cz>
Cc: Ingo Molnar <mingo@kernel.org>, Borislav Petkov <bp@alien8.de>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
the arch/x86 maintainers <x86@kernel.org>
Subject: Re: Non-booting current Linus' tree
Date: Sun, 5 Jul 2015 13:01:35 -0700 [thread overview]
Message-ID: <55998D1F.1030004@amacapital.net> (raw)
In-Reply-To: <CA+55aFyOMm4Tu3RPao4fQ=Ek0KH=8LSn1hoFRXp-L+Js3GeMvQ@mail.gmail.com>
On 07/03/2015 02:40 PM, Linus Torvalds wrote:
> 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.
>
Are you sure?
The 64-bit part of arch/x86/Makefile contains:
# Use -mpreferred-stack-boundary=3 if supported.
KBUILD_CFLAGS += $(call cc-option,-mpreferred-stack-boundary=3)
but make V=1 isn't showing -mpreferred-stack-boundary=3. This may be
because:
error: -mpreferred-stack-boundary=3 is not between 4 and 12
extern int bar(const char *);
^
I found:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53383
and, indeed, -mno-sse -mpreferred-stack-boundary=3 is accepted. This
make me think that the makefile is broken -- cc-option isn't working
because it doesn't check -mpreferred-stack-boundary in conjunction with
-mno-sse.
Given that -mpreferred-stack-boundary=3 doesn't appear to being set, I
think this is really our bug: our asm code makes no effort to align the
stack to a 16-byte boundary as required by the ABI, and we're not
overriding the ABI correctly.
I'll send a patch for the Makefile issue.
--Andy
prev parent reply other threads:[~2015-07-05 20:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-03 15:23 Non-booting current Linus' tree Jan Kara
2015-07-03 15:28 ` Thomas Gleixner
2015-07-03 21:40 ` Linus Torvalds
2015-07-04 7:58 ` [PATCH] x86/fpu: Fix boot crash in the early FPU code Ingo Molnar
2015-07-04 8:07 ` Thomas Gleixner
2015-07-04 8:08 ` Ingo Molnar
2015-07-04 8:09 ` [tip:x86/urgent] " tip-bot for Ingo Molnar
2015-07-05 10:00 ` [PATCH] " Maciej W. Rozycki
2015-07-05 20:01 ` Andy Lutomirski [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55998D1F.1030004@amacapital.net \
--to=luto@amacapital.net \
--cc=bp@alien8.de \
--cc=jack@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox