From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753080AbbGEKAS (ORCPT ); Sun, 5 Jul 2015 06:00:18 -0400 Received: from eddie.linux-mips.org ([148.251.95.138]:53716 "EHLO cvs.linux-mips.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751273AbbGEKAQ (ORCPT ); Sun, 5 Jul 2015 06:00:16 -0400 Date: Sun, 5 Jul 2015 11:00:14 +0100 (BST) From: "Maciej W. Rozycki" To: Ingo Molnar cc: Linus Torvalds , Jan Kara , Borislav Petkov , Linux Kernel Mailing List , the arch/x86 maintainers Subject: Re: [PATCH] x86/fpu: Fix boot crash in the early FPU code In-Reply-To: <20150704075819.GA9201@gmail.com> Message-ID: References: <20150703152303.GA14041@quack.suse.cz> <20150704075819.GA9201@gmail.com> User-Agent: Alpine 2.11 (LFD 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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). FWIW, Maciej