Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753273AbeADOh2 (ORCPT + 1 other); Thu, 4 Jan 2018 09:37:28 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:50700 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753212AbeADOhX (ORCPT ); Thu, 4 Jan 2018 09:37:23 -0500 From: David Woodhouse To: ak@linux.intel.com Cc: David Woodhouse , Paul Turner , LKML , Linus Torvalds , Greg Kroah-Hartman , Tim Chen , Dave Hansen , tglx@linutronix.de, Kees Cook , Rik van Riel , Peter Zijlstra , Andy Lutomirski , Jiri Kosina , gnomes@lxorguk.ukuu.org.uk Subject: [PATCH v3 06/13] x86/retpoline/xen: Convert Xen hypercall indirect jumps Date: Thu, 4 Jan 2018 14:37:03 +0000 Message-Id: <20180104143710.8961-6-dwmw@amazon.co.uk> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180104143710.8961-1-dwmw@amazon.co.uk> References: <20180104143710.8961-1-dwmw@amazon.co.uk> In-Reply-To: <1515058213.12987.89.camel@amazon.co.uk> References: <1515058213.12987.89.camel@amazon.co.uk> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: Convert indirect call in Xen hypercall to use non-speculative sequence, when CONFIG_RETPOLINE is enabled. Signed-off-by: David Woodhouse --- 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 7cb282e9e587..393c0048c63e 100644 --- a/arch/x86/include/asm/xen/hypercall.h +++ b/arch/x86/include/asm/xen/hypercall.h @@ -44,6 +44,7 @@ #include #include #include +#include #include #include @@ -217,9 +218,9 @@ privcmd_call(unsigned call, __HYPERCALL_5ARG(a1, a2, a3, a4, a5); stac(); - asm volatile("call *%[call]" + asm volatile(NOSPEC_CALL : __HYPERCALL_5PARAM - : [call] "a" (&hypercall_page[call]) + : [thunk_target] "a" (&hypercall_page[call]) : __HYPERCALL_CLOBBER5); clac(); -- 2.14.3