Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758697Ab1E0IiZ (ORCPT ); Fri, 27 May 2011 04:38:25 -0400 Received: from service87.mimecast.com ([94.185.240.25]:60679 "HELO service87.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752470Ab1E0IiX convert rfc822-to-8bit (ORCPT ); Fri, 27 May 2011 04:38:23 -0400 Date: Fri, 27 May 2011 09:38:08 +0100 From: Catalin Marinas To: Russell King - ARM Linux Cc: Nicolas Pitre , Will Deacon , =?iso-8859-1?Q?M=E5ns_Rullg=E5rd?= , lkml , ak@linux.intel.com, Andrew Morton , sam@ravnborg.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] ARM: Do not allow unaligned accesses when CONFIG_ALIGNMENT_TRAP Message-ID: <20110527083806.GA21100@e102109-lin.cambridge.arm.com> References: <20110524171331.GA2941@arm.com> <20110525111405.GA12010@e102109-lin.cambridge.arm.com> <20110525124348.GA2340@arm.com> <1306429854.26735.9.camel@e102144-lin.cambridge.arm.com> <20110526215101.GL24876@n2100.arm.linux.org.uk> MIME-Version: 1.0 In-Reply-To: <20110526215101.GL24876@n2100.arm.linux.org.uk> User-Agent: Mutt/1.5.20 (2009-06-14) X-OriginalArrivalTime: 27 May 2011 08:38:32.0114 (UTC) FILETIME=[75C81920:01CC1C49] X-MC-Unique: 111052709381901201 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: 8BIT Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1587 Lines: 37 On Thu, May 26, 2011 at 10:51:01PM +0100, Russell King - ARM Linux wrote: > On Thu, May 26, 2011 at 05:03:39PM -0400, Nicolas Pitre wrote: > > It is possible that -fconserve-stack is still valuable on ARM given that > > it is also used with -mno-unaligned-access for other things than > > structure packing on the stack, and therefore its merits can be debated > > independently from the alignment issue at hand. > > Catalin said in his mail "I haven't tried with -mno-unaligned-access, I > suspect the variables on the stack would be aligned.". So I don't think > we know enough to say whether -mno-unaligned-access avoids the stack > packing. OK, I tried this now: -fconserve-stack: we get unaligned accesses on the stack because the newer versions of gcc turned unaligned accesses on by default. -fconserve-stack -mno-unaligned-access: the stack variables are aligned. We probably get the benefit of -fconserve-stack as well. So as per the initial post in this thread, we could have -mno-unaligned-access on ARM always on (when CONFIG_ALIGNMENT_TRAP). As Nicolas suggested, we could compile some files with -munaligned-access (and maybe -fno-conserve-stack). I raised this with the gcc guys so they are looking into it. But it really doesn't look like a gcc bug as long as -mno-unaligned-access is taken into account. -- Catalin -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/