From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759629AbcBYFvM (ORCPT ); Thu, 25 Feb 2016 00:51:12 -0500 Received: from torg.zytor.com ([198.137.202.12]:53998 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751830AbcBYFvH (ORCPT ); Thu, 25 Feb 2016 00:51:07 -0500 Date: Wed, 24 Feb 2016 21:48:54 -0800 From: tip-bot for Josh Poimboeuf Message-ID: Cc: acme@kernel.org, brgerst@gmail.com, peterz@infradead.org, torvalds@linux-foundation.org, mingo@kernel.org, akpm@linux-foundation.org, bernd@petrovitsch.priv.at, linux-kernel@vger.kernel.org, bp@suse.de, luto@amacapital.net, dvlasenk@redhat.com, chris.j.arges@canonical.com, jslaby@suse.cz, jpoimboe@redhat.com, bp@alien8.de, palves@redhat.com, tglx@linutronix.de, mmarek@suse.cz, hpa@zytor.com, namhyung@gmail.com, luto@kernel.org Reply-To: bp@alien8.de, chris.j.arges@canonical.com, jpoimboe@redhat.com, jslaby@suse.cz, hpa@zytor.com, luto@kernel.org, namhyung@gmail.com, mmarek@suse.cz, tglx@linutronix.de, palves@redhat.com, brgerst@gmail.com, acme@kernel.org, torvalds@linux-foundation.org, mingo@kernel.org, peterz@infradead.org, bp@suse.de, luto@amacapital.net, dvlasenk@redhat.com, bernd@petrovitsch.priv.at, akpm@linux-foundation.org, linux-kernel@vger.kernel.org In-Reply-To: <4373e5bff459b9fd66ce5d45bfcc881a5c202643.1453405861.git.jpoimboe@redhat.com> References: <4373e5bff459b9fd66ce5d45bfcc881a5c202643.1453405861.git.jpoimboe@redhat.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/debug] x86/asm/entry: Create stack frames in thunk functions Git-Commit-ID: 058fb73274f9e7eb72acc9836cbb2c4a9f9659a0 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 058fb73274f9e7eb72acc9836cbb2c4a9f9659a0 Gitweb: http://git.kernel.org/tip/058fb73274f9e7eb72acc9836cbb2c4a9f9659a0 Author: Josh Poimboeuf AuthorDate: Thu, 21 Jan 2016 16:49:20 -0600 Committer: Ingo Molnar CommitDate: Wed, 24 Feb 2016 08:35:43 +0100 x86/asm/entry: Create stack frames in thunk functions Thunk functions are callable non-leaf functions that don't honor CONFIG_FRAME_POINTER, which can result in bad stack traces. Also they aren't annotated as ELF callable functions which can confuse tooling. Create stack frames for them when CONFIG_FRAME_POINTER is enabled and add the ELF function type. Signed-off-by: Josh Poimboeuf Reviewed-by: Borislav Petkov Cc: Andrew Morton Cc: Andy Lutomirski Cc: Andy Lutomirski Cc: Arnaldo Carvalho de Melo Cc: Bernd Petrovitsch Cc: Borislav Petkov Cc: Brian Gerst Cc: Chris J Arges Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Jiri Slaby Cc: Linus Torvalds Cc: Michal Marek Cc: Namhyung Kim Cc: Pedro Alves Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: live-patching@vger.kernel.org Link: http://lkml.kernel.org/r/4373e5bff459b9fd66ce5d45bfcc881a5c202643.1453405861.git.jpoimboe@redhat.com Signed-off-by: Ingo Molnar --- arch/x86/entry/thunk_64.S | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/x86/entry/thunk_64.S b/arch/x86/entry/thunk_64.S index efb2b93..98df1fa 100644 --- a/arch/x86/entry/thunk_64.S +++ b/arch/x86/entry/thunk_64.S @@ -8,11 +8,14 @@ #include #include "calling.h" #include +#include /* rdi: arg1 ... normal C conventions. rax is saved/restored. */ .macro THUNK name, func, put_ret_addr_in_rdi=0 .globl \name + .type \name, @function \name: + FRAME_BEGIN /* this one pushes 9 elems, the next one would be %rIP */ pushq %rdi @@ -62,6 +65,7 @@ restore: popq %rdx popq %rsi popq %rdi + FRAME_END ret _ASM_NOKPROBE(restore) #endif