|
@@ -312,6 +312,7 @@ static enum spectre_v2_mitigation_cmd __init spectre_v2_parse_cmdline(void)
|
|
|
}
|
|
|
|
|
|
if (cmd == SPECTRE_V2_CMD_RETPOLINE_AMD &&
|
|
|
+ boot_cpu_data.x86_vendor != X86_VENDOR_HYGON &&
|
|
|
boot_cpu_data.x86_vendor != X86_VENDOR_AMD) {
|
|
|
pr_err("retpoline,amd selected but CPU is not AMD. Switching to AUTO select\n");
|
|
|
return SPECTRE_V2_CMD_AUTO;
|
|
@@ -371,7 +372,8 @@ static void __init spectre_v2_select_mitigation(void)
|
|
|
return;
|
|
|
|
|
|
retpoline_auto:
|
|
|
- if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD) {
|
|
|
+ if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD ||
|
|
|
+ boot_cpu_data.x86_vendor == X86_VENDOR_HYGON) {
|
|
|
retpoline_amd:
|
|
|
if (!boot_cpu_has(X86_FEATURE_LFENCE_RDTSC)) {
|
|
|
pr_err("Spectre mitigation: LFENCE not serializing, switching to generic retpoline\n");
|