]> 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)
commitda19931d784611b3c7e57c7097a41744f78bde7a
treec7c295174ab434d421be7ecb5b0792067c269271
parent067569e7f8b24697e9c617ae02752df648aea451
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: 6bbb56b56b4e ("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