From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753131AbbJARhF (ORCPT ); Thu, 1 Oct 2015 13:37:05 -0400 Received: from mail.r00tworld.net ([144.76.92.157]:48478 "EHLO mail.r00tworld.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752284AbbJARhC (ORCPT ); Thu, 1 Oct 2015 13:37:02 -0400 Authentication-Results: mail.r00tworld.net; dmarc=none header.from=ld-linux.so Date: Thu, 1 Oct 2015 19:36:54 +0200 From: Mathias Krause To: Josh Poimboeuf Cc: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, linux-kernel@vger.kernel.org, live-patching@vger.kernel.org, Michal Marek , Peter Zijlstra , Andy Lutomirski , Borislav Petkov , Linus Torvalds , Andi Kleen , Pedro Alves , Namhyung Kim , Bernd Petrovitsch , Chris J Arges , Andrew Morton , Herbert Xu , "David S. Miller" Subject: Re: [PATCH v13 13/23] x86/asm/crypto: Create stack frames in aesni-intel_asm.S Message-ID: <20151001173654.GA15578@ld-linux.so> References: <20151001061026.GA20908@ld-linux.so> <20151001132950.GA4269@treble.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151001132950.GA4269@treble.redhat.com> X-Duff: Duff Lite, Duff Dry, Duff Dark, Lady Duff, Raspberry Duff, Duff Zero User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Do, Okt 01, 2015 at 08:29:50 -0500, Josh Poimboeuf wrote: > On Thu, Oct 01, 2015 at 08:10:26AM +0200, minipli@ld-linux.so wrote: > > On Tue, Sep 22, 2015 at 10:47:04AM -0500, Josh Poimboeuf wrote: > > > ENTRY(aesni_set_key) > > > + FRAME_BEGIN > > > #ifndef __x86_64__ > > > pushl KEYP > > > movl 8(%esp), KEYP # ctx > > > > This will break 32 bit builds using the aesni-intel.ko module. You need > > to adjust the esp-based offsets for the non-x86_64 case, as FRAME_BEGIN > > may do another push. > > > > How about adding a FRAME_OFFSET() macro to to wrap the > > offsets?: > > > > #ifdef CONFIG_FRAME_POINTER > > # define FRAME_OFFSET(x) ((x) + (BITS_PER_LONG / 8)) > > #else > > # define FRAME_OFFSET(x) (x) > > #endif > > > > And using them like this: > > > > movl FRAME_OFFSET(8)(%esp), KEYP # ctx > > Ah, right. The 32-bit ABI passes arguments on the stack instead of via > registers. > > For now, I'm inclined to just make FRAME_BEGIN and FRAME_END do nothing > on 32-bit. We're only doing stack validation on x86_64 and I don't know > if anybody cares about frame pointers on 32-bit at this point. Well, we had issues in the past, especially in that very module, but only on 32 bit systems. So it would be nice to get frame pointers right for 32 bit, too. Regards, Mathias