[PATCH v2 2/2] x86/retpoline: Use X86_RETPOLINE_COMMON to enable 32bit retpoline

From: Andi Kleen
Date: Tue Jan 09 2018 - 20:56:36 EST


From: Andi Kleen <ak@xxxxxxxxxxxxxxx>

32bit uses a single retpoline sequence for AMD/Intel. Previously
X86_RETPOLINE was always set for AMD/Intel but that's not true anymore.
So now use the new X86_FEATURE_RETPOLINE_COMMON flag that is set
for both.

Signed-off-by: Andi Kleen <ak@xxxxxxxxxxxxxxx>
---
arch/x86/include/asm/nospec-branch.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/include/asm/nospec-branch.h b/arch/x86/include/asm/nospec-branch.h
index c1cef78f0e12..bbd5343f2fea 100644
--- a/arch/x86/include/asm/nospec-branch.h
+++ b/arch/x86/include/asm/nospec-branch.h
@@ -116,7 +116,7 @@
# define CALL_NOSPEC ALTERNATIVE( \
"call *%[thunk_target]\n", \
"call __x86_indirect_thunk_%V[thunk_target]\n", \
- X86_FEATURE_RETPOLINE)
+ X86_FEATURE_RETPOLINE_COMMON)
# define THUNK_TARGET(addr) [thunk_target] "r" (addr)
#elif defined(CONFIG_X86_32) && defined(CONFIG_RETPOLINE)
/*
@@ -142,7 +142,7 @@
" .align 16\n" \
"do_call%=:\n" \
" call do_retpoline%=;\n", \
- X86_FEATURE_RETPOLINE)
+ X86_FEATURE_RETPOLINE_COMMON)

# define THUNK_TARGET(addr) [thunk_target] "rm" (addr)
#else /* No retpoline */
--
2.14.3