|
@@ -162,11 +162,12 @@
|
|
|
_ASM_PTR " 999b\n\t" \
|
|
|
".popsection\n\t"
|
|
|
|
|
|
-#if defined(CONFIG_X86_64) && defined(RETPOLINE)
|
|
|
+#ifdef CONFIG_RETPOLINE
|
|
|
+#ifdef CONFIG_X86_64
|
|
|
|
|
|
/*
|
|
|
- * Since the inline asm uses the %V modifier which is only in newer GCC,
|
|
|
- * the 64-bit one is dependent on RETPOLINE not CONFIG_RETPOLINE.
|
|
|
+ * Inline asm uses the %V modifier which is only in newer GCC
|
|
|
+ * which is ensured when CONFIG_RETPOLINE is defined.
|
|
|
*/
|
|
|
# define CALL_NOSPEC \
|
|
|
ANNOTATE_NOSPEC_ALTERNATIVE \
|
|
@@ -181,7 +182,7 @@
|
|
|
X86_FEATURE_RETPOLINE_AMD)
|
|
|
# define THUNK_TARGET(addr) [thunk_target] "r" (addr)
|
|
|
|
|
|
-#elif defined(CONFIG_X86_32) && defined(CONFIG_RETPOLINE)
|
|
|
+#else /* CONFIG_X86_32 */
|
|
|
/*
|
|
|
* For i386 we use the original ret-equivalent retpoline, because
|
|
|
* otherwise we'll run out of registers. We don't care about CET
|
|
@@ -211,6 +212,7 @@
|
|
|
X86_FEATURE_RETPOLINE_AMD)
|
|
|
|
|
|
# define THUNK_TARGET(addr) [thunk_target] "rm" (addr)
|
|
|
+#endif
|
|
|
#else /* No retpoline for C / inline asm */
|
|
|
# define CALL_NOSPEC "call *%[thunk_target]\n"
|
|
|
# define THUNK_TARGET(addr) [thunk_target] "rm" (addr)
|