From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934372AbcALMmP (ORCPT ); Tue, 12 Jan 2016 07:42:15 -0500 Received: from mail.skyhub.de ([78.46.96.112]:43313 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933459AbcALMmM (ORCPT ); Tue, 12 Jan 2016 07:42:12 -0500 Date: Tue, 12 Jan 2016 13:41:58 +0100 From: Borislav Petkov 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 , Linus Torvalds , Andi Kleen , Pedro Alves , Namhyung Kim , Bernd Petrovitsch , Chris J Arges , Andrew Morton , Jiri Slaby , Arnaldo Carvalho de Melo Subject: Re: [PATCH v15 21/25] x86/asm: Create stack frames in rwsem functions Message-ID: <20160112124158.GB22699@pd.tnic> References: <721641cb556b9b88aa559ec8f7de2d3e9e8c2e6d.1450442274.git.jpoimboe@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <721641cb556b9b88aa559ec8f7de2d3e9e8c2e6d.1450442274.git.jpoimboe@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 18, 2015 at 06:39:35AM -0600, Josh Poimboeuf wrote: > rwsem.S has several callable non-leaf functions which don't honor > CONFIG_FRAME_POINTER, which can result in bad stack traces. > > Create stack frames for them when CONFIG_FRAME_POINTER is enabled. > > Signed-off-by: Josh Poimboeuf > --- > arch/x86/lib/rwsem.S | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) > > diff --git a/arch/x86/lib/rwsem.S b/arch/x86/lib/rwsem.S > index 40027db..be110ef 100644 > --- a/arch/x86/lib/rwsem.S > +++ b/arch/x86/lib/rwsem.S > @@ -15,6 +15,7 @@ > > #include > #include > +#include > > #define __ASM_HALF_REG(reg) __ASM_SEL(reg, e##reg) > #define __ASM_HALF_SIZE(inst) __ASM_SEL(inst##w, inst##l) > @@ -84,24 +85,29 @@ > > /* Fix up special calling conventions */ > ENTRY(call_rwsem_down_read_failed) > + FRAME_BEGIN Remind me again, please, why aren't we hiding those FRAME_BEGIN/FRAME_END macros in the ENTRY/ENDPROC ones? > save_common_regs > __ASM_SIZE(push,) %__ASM_REG(dx) > movq %rax,%rdi > call rwsem_down_read_failed > __ASM_SIZE(pop,) %__ASM_REG(dx) > restore_common_regs > + FRAME_END > ret > ENDPROC(call_rwsem_down_read_failed) Thanks! -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply.