From: Herbert Xu Subject: Re: x86-64: Maintain 16-byte stack alignment Date: Fri, 13 Jan 2017 16:42:51 +0800 Message-ID: <20170113084251.GD22022@gondor.apana.org.au> References: <20170112140215.rh247gwk55fjzmg7@treble> <20170112201511.yj5ekqmj76r2yv6t@treble> <20170113031107.mgitq54fmjnrvi6f@treble> <20170113042758.whof5fk6eu7myctq@treble> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Josh Poimboeuf , Linux Crypto Mailing List , Thomas Gleixner , Andy Lutomirski , Ingo Molnar , Andy Lutomirski , Linux Kernel Mailing List , Ard Biesheuvel To: Linus Torvalds Return-path: Received: from helcar.hengli.com.au ([209.40.204.226]:46073 "EHLO helcar.apana.org.au" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750822AbdAMIn3 (ORCPT ); Fri, 13 Jan 2017 03:43:29 -0500 Content-Disposition: inline In-Reply-To: Sender: linux-crypto-owner@vger.kernel.org List-ID: On Thu, Jan 12, 2017 at 08:37:18PM -0800, Linus Torvalds wrote: > > So then the compiler actually needs to start adding useless instructions > just to keep the stack 16-byte aligned. Which it does. Of course most of the time no extra instructions are required because there are stack variables, so it's just matter of adding 8 to the value you're subtracting from rsp. But it is probably why gcc assumes that the stack is 16-byte aligned which triggered my original crash. Here is an example from the function that was involved in the crash, without frame pointers: 00000000000001b0 : 1b0: 41 54 push %r12 1b2: 55 push %rbp 1b3: 48 81 ec f8 00 00 00 sub $0xf8,%rsp Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt