OSDN Git Service

x86/bugs: Do not enable IBPB-on-entry when IBPB is not supported
authorThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Thu, 7 Jul 2022 16:41:52 +0000 (13:41 -0300)
committerBorislav Petkov <bp@suse.de>
Fri, 8 Jul 2022 10:50:52 +0000 (12:50 +0200)
commit2259da159fbe5dba8ac00b560cf00b6a6537fa18
treec7c295174ab434d421be7ecb5b0792067c269271
parent2c08b9b38f5b0f4a6c2d29be22b695e4ec4a556b
x86/bugs: Do not enable IBPB-on-entry when IBPB is not supported

There are some VM configurations which have Skylake model but do not
support IBPB. In those cases, when using retbleed=ibpb, userspace is going
to be killed and kernel is going to panic.

If the CPU does not support IBPB, warn and proceed with the auto option. Also,
do not fallback to IBPB on AMD/Hygon systems if it is not supported.

Fixes: 3ebc17006888 ("x86/bugs: Add retbleed=ibpb")
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
arch/x86/kernel/cpu/bugs.c