Skip to content

Commit 244d00b

Browse files
kimphillamdsuryasaimadhu
authored andcommitted
x86/speculation: Use generic retpoline by default on AMD
AMD retpoline may be susceptible to speculation. The speculation execution window for an incorrect indirect branch prediction using LFENCE/JMP sequence may potentially be large enough to allow exploitation using Spectre V2. By default, don't use retpoline,lfence on AMD. Instead, use the generic retpoline. Signed-off-by: Kim Phillips <[email protected]> Signed-off-by: Borislav Petkov <[email protected]>
1 parent 44a3918 commit 244d00b

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

arch/x86/kernel/cpu/bugs.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -941,15 +941,6 @@ static enum spectre_v2_mitigation __init spectre_v2_select_retpoline(void)
941941
return SPECTRE_V2_NONE;
942942
}
943943

944-
if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD ||
945-
boot_cpu_data.x86_vendor == X86_VENDOR_HYGON) {
946-
if (!boot_cpu_has(X86_FEATURE_LFENCE_RDTSC)) {
947-
pr_err("LFENCE not serializing, switching to generic retpoline\n");
948-
return SPECTRE_V2_RETPOLINE;
949-
}
950-
return SPECTRE_V2_LFENCE;
951-
}
952-
953944
return SPECTRE_V2_RETPOLINE;
954945
}
955946

0 commit comments

Comments
 (0)