diff options
author | Peter Zijlstra <[email protected]> | 2021-10-26 14:01:44 +0200 |
---|---|---|
committer | Peter Zijlstra <[email protected]> | 2021-10-28 23:25:28 +0200 |
commit | bbe2df3f6b6da7848398d55b1311d58a16ec21e4 (patch) | |
tree | 2abeeafd8f025733e94cf8e6a0e96bfd2ea5d004 /net/lapb/lapb_timer.c | |
parent | 2f0cbb2a8e5bbf101e9de118fc0eb168111a5e1e (diff) |
x86/alternative: Try inline spectre_v2=retpoline,amd
Try and replace retpoline thunk calls with:
LFENCE
CALL *%\reg
for spectre_v2=retpoline,amd.
Specifically, the sequence above is 5 bytes for the low 8 registers,
but 6 bytes for the high 8 registers. This means that unless the
compilers prefix stuff the call with higher registers this replacement
will fail.
Luckily GCC strongly favours RAX for the indirect calls and most (95%+
for defconfig-x86_64) will be converted. OTOH clang strongly favours
R11 and almost nothing gets converted.
Note: it will also generate a correct replacement for the Jcc.d32
case, except unless the compilers start to prefix stuff that, it'll
never fit. Specifically:
Jncc.d8 1f
LFENCE
JMP *%\reg
1:
is 7-8 bytes long, where the original instruction in unpadded form is
only 6 bytes.
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Reviewed-by: Borislav Petkov <[email protected]>
Acked-by: Josh Poimboeuf <[email protected]>
Tested-by: Alexei Starovoitov <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'net/lapb/lapb_timer.c')
0 files changed, 0 insertions, 0 deletions