Josh Poimboeuf 91857ae203 x86/srso: Set CPUID feature bits independently of bug or mitigation status
Booting with mitigations=off incorrectly prevents the
X86_FEATURE_{IBPB_BRTYPE,SBPB} CPUID bits from getting set.

Also, future CPUs without X86_BUG_SRSO might still have IBPB with branch
type prediction flushing, in which case SBPB should be used instead of
IBPB.  The current code doesn't allow for that.

Also, cpu_has_ibpb_brtype_microcode() has some surprising side effects
and the setting of these feature bits really doesn't belong in the
mitigation code anyway.  Move it to earlier.

Fixes: fb3bd914b3ec ("x86/srso: Add a Speculative RAS Overflow mitigation")
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Nikolay Borisov <nik.borisov@suse.com>
Reviewed-by: Borislav Petkov (AMD) <bp@alien8.de>
Acked-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/869a1709abfe13b673bdd10c2f4332ca253a40bc.1693889988.git.jpoimboe@kernel.org
2023-09-19 10:54:07 +02:00
..
2023-08-31 12:20:12 -07:00
2023-09-04 11:26:29 -07:00
2023-09-07 13:52:20 -07:00
2023-09-18 19:30:08 +02:00
2023-08-31 12:20:12 -07:00
2023-08-30 20:23:07 -07:00
2023-09-17 09:49:03 +02:00
2023-04-08 13:45:37 -07:00
2023-08-26 22:40:37 +02:00
2023-08-31 12:20:12 -07:00
2022-07-25 10:32:32 +02:00
2023-05-15 20:03:08 +02:00
2023-09-05 11:01:47 -07:00