From: Andi Kleen <andi@firstfloor.org>
To: tglx@linuxtronix.de
Cc: torvalds@linux-foundation.org, gregkh@linux-foundation.org,
dwmw@amazon.co.uk, tim.c.chen@linux.intel.com,
linux-kernel@vger.kernel.org, dave.hansen@intel.com,
Andi Kleen <ak@linux.intel.com>
Subject: [PATCH 05/11] x86/retpoline/hyperv: Convert assembler indirect jumps
Date: Wed, 3 Jan 2018 15:09:28 -0800 [thread overview]
Message-ID: <20180103230934.15788-6-andi@firstfloor.org> (raw)
In-Reply-To: <20180103230934.15788-1-andi@firstfloor.org>
From: Andi Kleen <ak@linux.intel.com>
Convert all indirect jumps in hyperv inline asm code to use
non speculative sequences.
Based on code from David Woodhouse and Tim Chen
Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
arch/x86/include/asm/mshyperv.h | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/arch/x86/include/asm/mshyperv.h b/arch/x86/include/asm/mshyperv.h
index 5400add2885b..2dfcdd401d4c 100644
--- a/arch/x86/include/asm/mshyperv.h
+++ b/arch/x86/include/asm/mshyperv.h
@@ -7,6 +7,7 @@
#include <linux/nmi.h>
#include <asm/io.h>
#include <asm/hyperv.h>
+#include <asm/jump-asm.h>
/*
* The below CPUID leaves are present if VersionAndFeatures.HypervisorPresent
@@ -186,7 +187,7 @@ static inline u64 hv_do_hypercall(u64 control, void *input, void *output)
return U64_MAX;
__asm__ __volatile__("mov %4, %%r8\n"
- "call *%5"
+ NOSPEC_CALL("%5")
: "=a" (hv_status), ASM_CALL_CONSTRAINT,
"+c" (control), "+d" (input_address)
: "r" (output_address), "m" (hv_hypercall_pg)
@@ -200,7 +201,7 @@ static inline u64 hv_do_hypercall(u64 control, void *input, void *output)
if (!hv_hypercall_pg)
return U64_MAX;
- __asm__ __volatile__("call *%7"
+ __asm__ __volatile__(NOSPEC_CALL("%7")
: "=A" (hv_status),
"+c" (input_address_lo), ASM_CALL_CONSTRAINT
: "A" (control),
@@ -227,7 +228,7 @@ static inline u64 hv_do_fast_hypercall8(u16 code, u64 input1)
#ifdef CONFIG_X86_64
{
- __asm__ __volatile__("call *%4"
+ __asm__ __volatile__(NOSPEC_CALL("%4")
: "=a" (hv_status), ASM_CALL_CONSTRAINT,
"+c" (control), "+d" (input1)
: "m" (hv_hypercall_pg)
@@ -238,7 +239,7 @@ static inline u64 hv_do_fast_hypercall8(u16 code, u64 input1)
u32 input1_hi = upper_32_bits(input1);
u32 input1_lo = lower_32_bits(input1);
- __asm__ __volatile__ ("call *%5"
+ __asm__ __volatile__ (NOSPEC_CALL("%5")
: "=A"(hv_status),
"+c"(input1_lo),
ASM_CALL_CONSTRAINT
--
2.14.3
next prev parent reply other threads:[~2018-01-03 23:09 UTC|newest]
Thread overview: 101+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-03 23:09 Avoid speculative indirect calls in kernel Andi Kleen
2018-01-03 23:09 ` [PATCH 01/11] x86/retpoline: Define retpoline indirect thunk and macros Andi Kleen
2018-01-03 23:09 ` [PATCH 02/11] x86/retpoline/crypto: Convert crypto assembler indirect jumps Andi Kleen
2018-01-03 23:09 ` [PATCH 03/11] x86/retpoline/entry: Convert entry " Andi Kleen
2018-01-03 23:09 ` [PATCH 04/11] x86/retpoline/ftrace: Convert ftrace " Andi Kleen
2018-01-03 23:09 ` Andi Kleen [this message]
2018-01-03 23:09 ` [PATCH 06/11] x86/retpoline/crypto: Convert xen " Andi Kleen
2018-01-03 23:09 ` [PATCH 07/11] x86/retpoline/checksum32: Convert " Andi Kleen
2018-01-03 23:09 ` [PATCH 08/11] x86/retpoline/irq32: " Andi Kleen
2018-01-03 23:09 ` [PATCH 09/11] x86/retpoline: Finally enable retpoline for C code Andi Kleen
2018-01-04 8:28 ` Greg KH
2018-01-04 8:30 ` Dave Hansen
2018-01-03 23:09 ` [PATCH 10/11] retpoline/taint: Taint kernel for missing retpoline in compiler Andi Kleen
2018-01-04 0:29 ` Thomas Gleixner
2018-01-04 0:35 ` Randy Dunlap
2018-01-03 23:09 ` [PATCH 11/11] retpoline/objtool: Disable some objtool warnings Andi Kleen
2018-01-03 23:51 ` Avoid speculative indirect calls in kernel Linus Torvalds
2018-01-04 0:00 ` Alan Cox
2018-01-04 0:09 ` Andi Kleen
2018-01-04 0:12 ` Thomas Gleixner
2018-01-04 0:15 ` Andi Kleen
2018-01-04 0:19 ` Jiri Kosina
2018-01-05 2:01 ` james harvey
2018-01-05 10:40 ` Woodhouse, David
2018-01-05 12:29 ` james harvey
2018-01-05 12:06 ` Alan Cox
2018-01-04 0:29 ` Alan Cox
2018-01-04 0:31 ` Thomas Gleixner
2018-01-04 0:38 ` Alan Cox
2018-01-04 0:40 ` Andi Kleen
2018-01-04 8:15 ` Woodhouse, David
2018-01-04 15:53 ` Andi Kleen
2018-01-04 15:55 ` Woodhouse, David
2018-01-04 0:20 ` Linus Torvalds
2018-01-04 0:26 ` Thomas Gleixner
2018-01-04 0:18 ` David Lang
2018-01-04 1:00 ` Paul Turner
2018-01-04 1:41 ` Paolo Bonzini
2018-01-04 1:59 ` Alan Cox
2018-01-04 2:11 ` Paolo Bonzini
2018-01-04 8:20 ` Woodhouse, David
2018-01-04 11:42 ` Pavel Machek
2018-01-04 11:47 ` Woodhouse, David
2018-01-04 14:20 ` Paolo Bonzini
2018-01-04 14:51 ` Andrew Cooper
2018-01-04 15:29 ` Woodhouse, David
2018-01-04 15:32 ` Paolo Bonzini
2018-01-04 15:37 ` Andrew Cooper
2018-01-04 16:15 ` David Woodhouse
2018-01-04 20:00 ` Tom Lendacky
2018-01-04 20:05 ` David Woodhouse
2018-01-04 23:47 ` Tom Lendacky
2018-01-05 0:06 ` Andrew Cooper
2018-01-05 0:26 ` Tom Lendacky
2018-01-04 16:52 ` Andrea Arcangeli
2018-01-04 15:32 ` Paolo Bonzini
2018-01-04 16:25 ` Andrea Arcangeli
2018-01-04 17:04 ` Alan Cox
2018-01-04 17:40 ` Andrea Arcangeli
2018-01-04 17:13 ` Dave Hansen
2018-01-04 17:15 ` Paolo Bonzini
2018-01-04 18:05 ` Andrea Arcangeli
2018-01-04 14:55 ` Woodhouse, David
2018-01-04 18:24 ` Pavel Machek
2018-01-04 19:57 ` Jon Masters
2018-01-05 0:41 ` Jon Masters
2018-01-05 0:54 ` Thomas Gleixner
2018-01-05 4:11 ` Jon Masters
2018-01-05 9:59 ` Thomas Gleixner
2018-01-08 10:28 ` Andrea Arcangeli
2018-01-08 20:42 ` [tip:x86/pti] x86/tboot: Unbreak tboot with PTI enabled tip-bot for Dave Hansen
2018-01-08 20:53 ` Avoid speculative indirect calls in kernel Thomas Gleixner
2018-01-08 21:32 ` Andrea Arcangeli
2018-01-10 0:45 ` Thomas Gleixner
2018-01-10 1:11 ` Dave Hansen
2018-01-10 16:02 ` Thomas Gleixner
2018-01-05 6:49 ` Willy Tarreau
2018-01-05 6:57 ` Dave Hansen
2018-01-05 7:13 ` Willy Tarreau
2018-01-07 14:14 ` Borislav Petkov
2018-01-07 17:21 ` David Lang
2018-01-07 18:49 ` Borislav Petkov
2018-01-07 17:44 ` Willy Tarreau
2018-01-07 18:55 ` Borislav Petkov
2018-01-07 22:10 ` Willy Tarreau
2018-01-08 9:18 ` Thomas Gleixner
2018-01-08 9:29 ` Willy Tarreau
2018-01-08 16:22 ` Borislav Petkov
2018-01-08 16:53 ` Willy Tarreau
2018-01-05 12:12 ` Alan Cox
2018-01-09 1:44 ` Samir Bellabes
[not found] ` <CAL9bgJ8XNJgCtxR6+M+Vm9eDBVZ4Dyi_-Lt-Q1ei9N=TE2c6cg@mail.gmail.com>
2018-01-07 5:04 ` Fwd: " Kiernan Hager
2018-01-07 6:39 ` Willy Tarreau
2018-01-07 14:01 ` Alan Cox
2018-01-07 17:47 ` Willy Tarreau
2018-01-07 18:01 ` Ivan Ivanov
2018-01-07 18:16 ` Woodhouse, David
2018-01-04 11:26 ` Pavel Machek
2018-01-04 11:54 ` Alan Cox
2018-01-04 18:33 ` Linus Torvalds
2018-01-04 20:08 ` Jon Masters
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180103230934.15788-6-andi@firstfloor.org \
--to=andi@firstfloor.org \
--cc=ak@linux.intel.com \
--cc=dave.hansen@intel.com \
--cc=dwmw@amazon.co.uk \
--cc=gregkh@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linuxtronix.de \
--cc=tim.c.chen@linux.intel.com \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.