Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756634AbbGTQgu (ORCPT ); Mon, 20 Jul 2015 12:36:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50511 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754920AbbGTQgt (ORCPT ); Mon, 20 Jul 2015 12:36:49 -0400 Date: Mon, 20 Jul 2015 11:36:46 -0500 From: Josh Poimboeuf To: Andy Lutomirski Cc: Ingo Molnar , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Michal Marek , Peter Zijlstra , Andy Lutomirski , Borislav Petkov , Linus Torvalds , Andi Kleen , Pedro Alves , X86 ML , live-patching@vger.kernel.org, "linux-kernel@vger.kernel.org" Subject: Re: [RFC PATCH 13/21] x86/asm/crypto: Fix frame pointer usage in aesni-intel_asm.S Message-ID: <20150720163646.GA28075@treble.redhat.com> References: <2ea0f0602978178eafd012e52b8bdb83cfb159d5.1437150175.git.jpoimboe@redhat.com> <20150717194307.GA26757@gmail.com> <20150717203746.GB12761@treble.redhat.com> <20150718025116.GB13059@gmail.com> <20150718035623.GA22664@treble.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1341 Lines: 34 On Mon, Jul 20, 2015 at 08:30:52AM -0700, Andy Lutomirski wrote: > On Fri, Jul 17, 2015 at 8:56 PM, Josh Poimboeuf wrote: > > The reason I suggested to put FRAME in the macro name is to try to > > prevent it from being accidentally used for leaf functions, where it > > isn't needed. > > > > Could someone remind me why it isn't needed for leaf functions? If a function doesn't call any other functions, then it won't ever show up in a stack trace unless: a) the function itself walks the stack, in which case the frame pointer isn't necessary; or b) The function gets hit by an interrupt/exception, in which case frame pointers can't be 100% relied upon anyway. I've noticed that gcc *does* seem to create stack frames for leaf functions. But it's inconsistent, because the early exit path of some functions will skip the stack frame creation and go straight to the return. We could probably get a good performance boost with the -momit-leaf-frame-pointer flag. Though it would make stack traces less reliable when a leaf function gets interrupted. -- Josh -- 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/