]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
x86/srso: Add IBPB_BRTYPE support
authorBorislav Petkov (AMD) <bp@alien8.de>
Tue, 18 Jul 2023 09:13:40 +0000 (11:13 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Aug 2023 17:58:34 +0000 (19:58 +0200)
commit4e9115e194a8d21195a5e7600975ed601dd364ff
tree73d1764dbfb9769cf30991e24ed33b38edee8e18
parentb35087763a44d1eb45857f799579a351332be505
x86/srso: Add IBPB_BRTYPE support

Upstream commit: 79113e4060aba744787a81edb9014f2865193854

Add support for the synthetic CPUID flag which "if this bit is 1,
it indicates that MSR 49h (PRED_CMD) bit 0 (IBPB) flushes all branch
type predictions from the CPU branch predictor."

This flag is there so that this capability in guests can be detected
easily (otherwise one would have to track microcode revisions which is
impossible for guests).

It is also needed only for Zen3 and -4. The other two (Zen1 and -2)
always flush branch type predictions by default.

Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/include/asm/cpufeatures.h
arch/x86/kernel/cpu/bugs.c