From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753131AbbGEUBr (ORCPT ); Sun, 5 Jul 2015 16:01:47 -0400 Received: from mail-pd0-f173.google.com ([209.85.192.173]:36177 "EHLO mail-pd0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752609AbbGEUBj (ORCPT ); Sun, 5 Jul 2015 16:01:39 -0400 Subject: Re: Non-booting current Linus' tree To: Linus Torvalds , Jan Kara References: <20150703152303.GA14041@quack.suse.cz> Cc: Ingo Molnar , Borislav Petkov , Linux Kernel Mailing List , the arch/x86 maintainers From: Andy Lutomirski X-Enigmail-Draft-Status: N1110 Message-ID: <55998D1F.1030004@amacapital.net> Date: Sun, 5 Jul 2015 13:01:35 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/03/2015 02:40 PM, Linus Torvalds wrote: > On Fri, Jul 3, 2015 at 8:23 AM, Jan Kara 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