Skip to content

Commit 8c7261a

Browse files
dkaplan2bp3tk0v
authored andcommitted
x86/bugs: Add attack vector controls for GDS
Use attack vector controls to determine if GDS mitigation is required. Signed-off-by: David Kaplan <[email protected]> Signed-off-by: Borislav Petkov (AMD) <[email protected]> Link: https://lore.kernel.org/[email protected]
1 parent 71dc301 commit 8c7261a

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

arch/x86/kernel/cpu/bugs.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,12 +1030,15 @@ static void __init gds_select_mitigation(void)
10301030
return;
10311031
}
10321032

1033-
if (cpu_mitigations_off())
1034-
gds_mitigation = GDS_MITIGATION_OFF;
10351033
/* Will verify below that mitigation _can_ be disabled */
1036-
1037-
if (gds_mitigation == GDS_MITIGATION_AUTO)
1038-
gds_mitigation = GDS_MITIGATION_FULL;
1034+
if (gds_mitigation == GDS_MITIGATION_AUTO) {
1035+
if (should_mitigate_vuln(X86_BUG_GDS))
1036+
gds_mitigation = GDS_MITIGATION_FULL;
1037+
else {
1038+
gds_mitigation = GDS_MITIGATION_OFF;
1039+
return;
1040+
}
1041+
}
10391042

10401043
/* No microcode */
10411044
if (!(x86_arch_cap_msr & ARCH_CAP_GDS_CTRL)) {

0 commit comments

Comments
 (0)