Skip to content

Commit ea08816

Browse files
dwmw2KAGA-KOKO
authored andcommitted
x86/retpoline/xen: Convert Xen hypercall indirect jumps
Convert indirect call in Xen hypercall to use non-speculative sequence, when CONFIG_RETPOLINE is enabled. Signed-off-by: David Woodhouse <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Acked-by: Arjan van de Ven <[email protected]> Acked-by: Ingo Molnar <[email protected]> Reviewed-by: Juergen Gross <[email protected]> Cc: [email protected] Cc: Rik van Riel <[email protected]> Cc: Andi Kleen <[email protected]> Cc: Josh Poimboeuf <[email protected]> Cc: [email protected] Cc: Peter Zijlstra <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Jiri Kosina <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Dave Hansen <[email protected]> Cc: Kees Cook <[email protected]> Cc: Tim Chen <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Paul Turner <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent e70e589 commit ea08816

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

arch/x86/include/asm/xen/hypercall.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
#include <asm/page.h>
4545
#include <asm/pgtable.h>
4646
#include <asm/smap.h>
47+
#include <asm/nospec-branch.h>
4748

4849
#include <xen/interface/xen.h>
4950
#include <xen/interface/sched.h>
@@ -217,9 +218,9 @@ privcmd_call(unsigned call,
217218
__HYPERCALL_5ARG(a1, a2, a3, a4, a5);
218219

219220
stac();
220-
asm volatile("call *%[call]"
221+
asm volatile(CALL_NOSPEC
221222
: __HYPERCALL_5PARAM
222-
: [call] "a" (&hypercall_page[call])
223+
: [thunk_target] "a" (&hypercall_page[call])
223224
: __HYPERCALL_CLOBBER5);
224225
clac();
225226

0 commit comments

Comments
 (0)