mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
x86/bugs: Fix handling when SRSO mitigation is disabled
[ Upstream commit 1dbb6b1495 ]
When the SRSO mitigation is disabled, either via mitigations=off or
spec_rstack_overflow=off, the warning about the lack of IBPB-enhancing
microcode is printed anyway.
This is unnecessary since the user has turned off the mitigation.
[ bp: Massage, drop SBPB rationale as it doesn't matter because when
mitigations are disabled x86_pred_cmd is not being used anyway. ]
Signed-off-by: David Kaplan <david.kaplan@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Acked-by: Josh Poimboeuf <jpoimboe@kernel.org>
Link: https://lore.kernel.org/r/20240904150711.193022-1-david.kaplan@amd.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
b5dba603de
commit
dd91f89517
@@ -2551,10 +2551,9 @@ static void __init srso_select_mitigation(void)
|
|||||||
{
|
{
|
||||||
bool has_microcode = boot_cpu_has(X86_FEATURE_IBPB_BRTYPE);
|
bool has_microcode = boot_cpu_has(X86_FEATURE_IBPB_BRTYPE);
|
||||||
|
|
||||||
if (cpu_mitigations_off())
|
if (!boot_cpu_has_bug(X86_BUG_SRSO) ||
|
||||||
return;
|
cpu_mitigations_off() ||
|
||||||
|
srso_cmd == SRSO_CMD_OFF) {
|
||||||
if (!boot_cpu_has_bug(X86_BUG_SRSO)) {
|
|
||||||
if (boot_cpu_has(X86_FEATURE_SBPB))
|
if (boot_cpu_has(X86_FEATURE_SBPB))
|
||||||
x86_pred_cmd = PRED_CMD_SBPB;
|
x86_pred_cmd = PRED_CMD_SBPB;
|
||||||
return;
|
return;
|
||||||
@@ -2585,11 +2584,6 @@ static void __init srso_select_mitigation(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch (srso_cmd) {
|
switch (srso_cmd) {
|
||||||
case SRSO_CMD_OFF:
|
|
||||||
if (boot_cpu_has(X86_FEATURE_SBPB))
|
|
||||||
x86_pred_cmd = PRED_CMD_SBPB;
|
|
||||||
return;
|
|
||||||
|
|
||||||
case SRSO_CMD_MICROCODE:
|
case SRSO_CMD_MICROCODE:
|
||||||
if (has_microcode) {
|
if (has_microcode) {
|
||||||
srso_mitigation = SRSO_MITIGATION_MICROCODE;
|
srso_mitigation = SRSO_MITIGATION_MICROCODE;
|
||||||
@@ -2643,6 +2637,8 @@ static void __init srso_select_mitigation(void)
|
|||||||
pr_err("WARNING: kernel not compiled with MITIGATION_SRSO.\n");
|
pr_err("WARNING: kernel not compiled with MITIGATION_SRSO.\n");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
|||||||
Reference in New Issue
Block a user