mirror of
https://github.com/torvalds/linux.git
synced 2025-11-03 10:10:33 +02:00
x86/bugs: Add attack vector controls for spectre_v1
Use attack vector controls to determine if spectre_v1 mitigation is required. Signed-off-by: David Kaplan <david.kaplan@amd.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Link: https://lore.kernel.org/20250707183316.1349127-12-david.kaplan@amd.com
This commit is contained in:
parent
8c7261abcb
commit
19a5f3ea43
1 changed files with 5 additions and 2 deletions
|
|
@ -1144,13 +1144,16 @@ static bool smap_works_speculatively(void)
|
|||
|
||||
static void __init spectre_v1_select_mitigation(void)
|
||||
{
|
||||
if (!boot_cpu_has_bug(X86_BUG_SPECTRE_V1) || cpu_mitigations_off())
|
||||
if (!boot_cpu_has_bug(X86_BUG_SPECTRE_V1))
|
||||
spectre_v1_mitigation = SPECTRE_V1_MITIGATION_NONE;
|
||||
|
||||
if (!should_mitigate_vuln(X86_BUG_SPECTRE_V1))
|
||||
spectre_v1_mitigation = SPECTRE_V1_MITIGATION_NONE;
|
||||
}
|
||||
|
||||
static void __init spectre_v1_apply_mitigation(void)
|
||||
{
|
||||
if (!boot_cpu_has_bug(X86_BUG_SPECTRE_V1) || cpu_mitigations_off())
|
||||
if (!boot_cpu_has_bug(X86_BUG_SPECTRE_V1))
|
||||
return;
|
||||
|
||||
if (spectre_v1_mitigation == SPECTRE_V1_MITIGATION_AUTO) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue