kernel_optimize_test/arch/x86/entry
Peter Zijlstra 3dddacf8c3 x86/entry: Add kernel IBRS implementation
commit 2dbb887e875b1de3ca8f40ddf26bcfe55798c609 upstream.

Implement Kernel IBRS - currently the only known option to mitigate RSB
underflow speculation issues on Skylake hardware.

Note: since IBRS_ENTER requires fuller context established than
UNTRAIN_RET, it must be placed after it. However, since UNTRAIN_RET
itself implies a RET, it must come after IBRS_ENTER. This means
IBRS_ENTER needs to also move UNTRAIN_RET.

Note 2: KERNEL_IBRS is sub-optimal for XenPV.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
[cascardo: conflict at arch/x86/entry/entry_64.S, skip_r11rcx]
[cascardo: conflict at arch/x86/entry/entry_64_compat.S]
[cascardo: conflict fixups, no ANNOTATE_NOENDBR]
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
[bwh: Backported to 5.10: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-25 11:26:42 +02:00
..
syscalls
vdso x86: Use return-thunk in asm code 2022-07-25 11:26:39 +02:00
vsyscall x86/vsyscall_emu/64: Don't use RET in vsyscall emulation 2022-07-25 11:26:38 +02:00
calling.h x86/entry: Add kernel IBRS implementation 2022-07-25 11:26:42 +02:00
common.c
entry_32.S x86: Prepare asm files for straight-line-speculation 2022-07-25 11:26:28 +02:00
entry_64_compat.S x86/entry: Add kernel IBRS implementation 2022-07-25 11:26:42 +02:00
entry_64.S x86/entry: Add kernel IBRS implementation 2022-07-25 11:26:42 +02:00
Makefile
syscall_32.c
syscall_64.c
syscall_x32.c
thunk_32.S x86: Prepare asm files for straight-line-speculation 2022-07-25 11:26:28 +02:00
thunk_64.S x86: Prepare asm files for straight-line-speculation 2022-07-25 11:26:28 +02:00