aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/include/asm/nospec-branch.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/x86/include/asm/nospec-branch.h b/arch/x86/include/asm/nospec-branch.h
index 19ba5ad19c65..4ad41087ce0e 100644
--- a/arch/x86/include/asm/nospec-branch.h
+++ b/arch/x86/include/asm/nospec-branch.h
@@ -206,16 +206,17 @@ extern char __indirect_thunk_end[];
206static inline void vmexit_fill_RSB(void) 206static inline void vmexit_fill_RSB(void)
207{ 207{
208#ifdef CONFIG_RETPOLINE 208#ifdef CONFIG_RETPOLINE
209 unsigned long loops = RSB_CLEAR_LOOPS / 2; 209 unsigned long loops;
210 210
211 asm volatile (ANNOTATE_NOSPEC_ALTERNATIVE 211 asm volatile (ANNOTATE_NOSPEC_ALTERNATIVE
212 ALTERNATIVE("jmp 910f", 212 ALTERNATIVE("jmp 910f",
213 __stringify(__FILL_RETURN_BUFFER(%0, RSB_CLEAR_LOOPS, %1)), 213 __stringify(__FILL_RETURN_BUFFER(%0, RSB_CLEAR_LOOPS, %1)),
214 X86_FEATURE_RETPOLINE) 214 X86_FEATURE_RETPOLINE)
215 "910:" 215 "910:"
216 : "=&r" (loops), ASM_CALL_CONSTRAINT 216 : "=r" (loops), ASM_CALL_CONSTRAINT
217 : "r" (loops) : "memory" ); 217 : : "memory" );
218#endif 218#endif
219} 219}
220
220#endif /* __ASSEMBLY__ */ 221#endif /* __ASSEMBLY__ */
221#endif /* __NOSPEC_BRANCH_H__ */ 222#endif /* __NOSPEC_BRANCH_H__ */