We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ae6b4bb commit 333286eCopy full SHA for 333286e
arch/x86/include/asm/nospec-branch.h
@@ -57,6 +57,7 @@
57
* the optimal version - two calls, each with their own speculation
58
* trap should their return address end up getting used, in a loop.
59
*/
60
+#ifdef CONFIG_X86_64
61
#define __FILL_RETURN_BUFFER(reg, nr) \
62
mov $(nr/2), reg; \
63
771: \
@@ -67,6 +68,17 @@
67
68
jnz 771b; \
69
/* barrier for jnz misprediction */ \
70
lfence;
71
+#else
72
+/*
73
+ * i386 doesn't unconditionally have LFENCE, as such it can't
74
+ * do a loop.
75
+ */
76
+#define __FILL_RETURN_BUFFER(reg, nr) \
77
+ .rept nr; \
78
+ __FILL_RETURN_SLOT; \
79
+ .endr; \
80
+ add $(BITS_PER_LONG/8) * nr, %_ASM_SP;
81
+#endif
82
83
/*
84
* Stuff a single RSB slot.
0 commit comments