Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752935AbeAJSWt (ORCPT + 1 other); Wed, 10 Jan 2018 13:22:49 -0500 Received: from terminus.zytor.com ([65.50.211.136]:42555 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752198AbeAJSWr (ORCPT ); Wed, 10 Jan 2018 13:22:47 -0500 Date: Wed, 10 Jan 2018 10:17:02 -0800 From: tip-bot for Andi Kleen Message-ID: Cc: dave.hansen@intel.com, pjt@google.com, mingo@kernel.org, ak@linux.intel.com, peterz@infradead.org, tglx@linutronix.de, tim.c.chen@linux.intel.com, keescook@google.com, hpa@zytor.com, arjan@linux.intel.com, torvalds@linux-foundation.org, jikos@kernel.org, gregkh@linux-foundation.org, linux-kernel@vger.kernel.org, luto@amacapital.net, riel@redhat.com Reply-To: mingo@kernel.org, peterz@infradead.org, tglx@linutronix.de, ak@linux.intel.com, pjt@google.com, dave.hansen@intel.com, gregkh@linux-foundation.org, jikos@kernel.org, torvalds@linux-foundation.org, riel@redhat.com, luto@amacapital.net, linux-kernel@vger.kernel.org, keescook@google.com, tim.c.chen@linux.intel.com, arjan@linux.intel.com, hpa@zytor.com In-Reply-To: <1515508997-6154-11-git-send-email-dwmw@amazon.co.uk> References: <1515508997-6154-11-git-send-email-dwmw@amazon.co.uk> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/pti] x86/retpoline/irq32: Convert assembler indirect jumps Git-Commit-ID: f83bd6a0911450ffe6b76c94dfe4230154256e26 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 Return-Path: Commit-ID: f83bd6a0911450ffe6b76c94dfe4230154256e26 Gitweb: https://git.kernel.org/tip/f83bd6a0911450ffe6b76c94dfe4230154256e26 Author: Andi Kleen AuthorDate: Tue, 9 Jan 2018 14:43:16 +0000 Committer: Thomas Gleixner CommitDate: Wed, 10 Jan 2018 19:09:12 +0100 x86/retpoline/irq32: Convert assembler indirect jumps Convert all indirect jumps in 32bit irq inline asm code to use non speculative sequences. Signed-off-by: Andi Kleen Signed-off-by: Thomas Gleixner Acked-by: Arjan van de Ven Acked-by: Ingo Molnar Cc: gnomes@lxorguk.ukuu.org.uk Cc: Rik van Riel Cc: Peter Zijlstra Cc: Linus Torvalds Cc: Jiri Kosina Cc: Andy Lutomirski Cc: Dave Hansen Cc: Kees Cook Cc: Tim Chen Cc: Greg Kroah-Hartman Cc: Paul Turner Link: https://lkml.kernel.org/r/1515508997-6154-11-git-send-email-dwmw@amazon.co.uk --- arch/x86/kernel/irq_32.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/arch/x86/kernel/irq_32.c b/arch/x86/kernel/irq_32.c index a83b334..c1bdbd3 100644 --- a/arch/x86/kernel/irq_32.c +++ b/arch/x86/kernel/irq_32.c @@ -20,6 +20,7 @@ #include #include +#include #ifdef CONFIG_DEBUG_STACKOVERFLOW @@ -55,11 +56,11 @@ DEFINE_PER_CPU(struct irq_stack *, softirq_stack); static void call_on_stack(void *func, void *stack) { asm volatile("xchgl %%ebx,%%esp \n" - "call *%%edi \n" + CALL_NOSPEC "movl %%ebx,%%esp \n" : "=b" (stack) : "0" (stack), - "D"(func) + [thunk_target] "D"(func) : "memory", "cc", "edx", "ecx", "eax"); } @@ -95,11 +96,11 @@ static inline int execute_on_irq_stack(int overflow, struct irq_desc *desc) call_on_stack(print_stack_overflow, isp); asm volatile("xchgl %%ebx,%%esp \n" - "call *%%edi \n" + CALL_NOSPEC "movl %%ebx,%%esp \n" : "=a" (arg1), "=b" (isp) : "0" (desc), "1" (isp), - "D" (desc->handle_irq) + [thunk_target] "D" (desc->handle_irq) : "memory", "cc", "ecx"); return 1; }