From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759193AbcBYFsA (ORCPT ); Thu, 25 Feb 2016 00:48:00 -0500 Received: from torg.zytor.com ([198.137.202.12]:53562 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1758126AbcBYFr6 (ORCPT ); Thu, 25 Feb 2016 00:47:58 -0500 Date: Wed, 24 Feb 2016 21:45:16 -0800 From: tip-bot for Josh Poimboeuf Message-ID: Cc: jslaby@suse.cz, akpm@linux-foundation.org, dvlasenk@redhat.com, bp@alien8.de, mingo@kernel.org, linux-kernel@vger.kernel.org, bernd@petrovitsch.priv.at, torvalds@linux-foundation.org, boris.ostrovsky@oracle.com, luto@amacapital.net, palves@redhat.com, konrad.wilk@oracle.com, peterz@infradead.org, chris.j.arges@canonical.com, namhyung@gmail.com, brgerst@gmail.com, hpa@zytor.com, tglx@linutronix.de, acme@kernel.org, bp@suse.de, mmarek@suse.cz, jpoimboe@redhat.com, luto@kernel.org, david.vrabel@citrix.com Reply-To: mmarek@suse.cz, jpoimboe@redhat.com, luto@kernel.org, bp@suse.de, david.vrabel@citrix.com, namhyung@gmail.com, palves@redhat.com, konrad.wilk@oracle.com, chris.j.arges@canonical.com, peterz@infradead.org, hpa@zytor.com, tglx@linutronix.de, acme@kernel.org, brgerst@gmail.com, bernd@petrovitsch.priv.at, linux-kernel@vger.kernel.org, torvalds@linux-foundation.org, boris.ostrovsky@oracle.com, luto@amacapital.net, dvlasenk@redhat.com, jslaby@suse.cz, akpm@linux-foundation.org, mingo@kernel.org, bp@alien8.de In-Reply-To: References: To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/debug] x86/xen: Add stack frame dependency to hypercall inline asm calls Git-Commit-ID: 0e8e2238b52e5301d1d1d4a298ec5b72ac54c702 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: 0e8e2238b52e5301d1d1d4a298ec5b72ac54c702 Gitweb: http://git.kernel.org/tip/0e8e2238b52e5301d1d1d4a298ec5b72ac54c702 Author: Josh Poimboeuf AuthorDate: Thu, 21 Jan 2016 16:49:09 -0600 Committer: Ingo Molnar CommitDate: Wed, 24 Feb 2016 08:35:41 +0100 x86/xen: Add stack frame dependency to hypercall inline asm calls If a hypercall is inlined at the beginning of a function, gcc can insert the call instruction before setting up a stack frame, which breaks frame pointer convention if CONFIG_FRAME_POINTER is enabled and can result in a bad stack trace. Force a stack frame to be created if CONFIG_FRAME_POINTER is enabled by listing the stack pointer as an output operand for the hypercall inline asm statements. Signed-off-by: Josh Poimboeuf Reviewed-by: David Vrabel Reviewed-by: Borislav Petkov Cc: Andrew Morton Cc: Andy Lutomirski Cc: Andy Lutomirski Cc: Arnaldo Carvalho de Melo Cc: Bernd Petrovitsch Cc: Boris Ostrovsky Cc: Borislav Petkov Cc: Brian Gerst Cc: Chris J Arges Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Jiri Slaby Cc: Konrad Rzeszutek Wilk 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/c6face5a46713108bded9c4c103637222abc4528.1453405861.git.jpoimboe@redhat.com Signed-off-by: Ingo Molnar --- arch/x86/include/asm/xen/hypercall.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/xen/hypercall.h b/arch/x86/include/asm/xen/hypercall.h index 3bcdcc8..a12a047 100644 --- a/arch/x86/include/asm/xen/hypercall.h +++ b/arch/x86/include/asm/xen/hypercall.h @@ -110,9 +110,10 @@ extern struct { char _entry[32]; } hypercall_page[]; register unsigned long __arg2 asm(__HYPERCALL_ARG2REG) = __arg2; \ register unsigned long __arg3 asm(__HYPERCALL_ARG3REG) = __arg3; \ register unsigned long __arg4 asm(__HYPERCALL_ARG4REG) = __arg4; \ - register unsigned long __arg5 asm(__HYPERCALL_ARG5REG) = __arg5; + register unsigned long __arg5 asm(__HYPERCALL_ARG5REG) = __arg5; \ + register void *__sp asm(_ASM_SP); -#define __HYPERCALL_0PARAM "=r" (__res) +#define __HYPERCALL_0PARAM "=r" (__res), "+r" (__sp) #define __HYPERCALL_1PARAM __HYPERCALL_0PARAM, "+r" (__arg1) #define __HYPERCALL_2PARAM __HYPERCALL_1PARAM, "+r" (__arg2) #define __HYPERCALL_3PARAM __HYPERCALL_2PARAM, "+r" (__arg3)