]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit41632f38cec12ebe92fb936da78ce28be7f692a7
treec7c295174ab434d421be7ecb5b0792067c269271
parent0071ec4ce58fd6153fce3a0a66c2f35f22b262ac
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: bf9a7f6cdeaa ("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