Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2018-02-19 15:46:00 +0100
committerTakashi Iwai <tiwai@suse.de>2018-02-19 15:46:07 +0100
commit48d05148f9059d4003c0594228d09a8012883c38 (patch)
tree4449aea7572d37ee6f76b6d92b6ebfa0856e43ba
parentb9a9156d367f6b452e7cdb3fd0fc5e41fb366471 (diff)
x86/microcode: Do the family check first (bsc#1081436rpm-4.4.114-94.14
bsc#1081437). suse-commit: 14c5f0fc2f10ea3b583a86879498d4dd1b9e9b92
-rw-r--r--arch/x86/kernel/cpu/microcode/core.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c
index 2450b2a34970..cbb6d265e502 100644
--- a/arch/x86/kernel/cpu/microcode/core.c
+++ b/arch/x86/kernel/cpu/microcode/core.c
@@ -95,9 +95,6 @@ static bool __init check_loader_disabled_bsp(void)
bool *res = &dis_ucode_ldr;
#endif
- if (!have_cpuid_p())
- return *res;
-
a = 1;
c = 0;
native_cpuid(&a, &b, &c, &d);
@@ -139,8 +136,9 @@ void __init load_ucode_bsp(void)
{
int vendor;
unsigned int family;
+ bool intel = true;
- if (check_loader_disabled_bsp())
+ if (!have_cpuid_p())
return;
vendor = x86_vendor();
@@ -148,16 +146,27 @@ void __init load_ucode_bsp(void)
switch (vendor) {
case X86_VENDOR_INTEL:
- if (family >= 6)
- load_ucode_intel_bsp();
+ if (family < 6)
+ return;
break;
+
case X86_VENDOR_AMD:
- if (family >= 0x10)
- load_ucode_amd_bsp(family);
+ if (family < 0x10)
+ return;
+ intel = false;
break;
+
default:
- break;
+ return;
}
+
+ if (check_loader_disabled_bsp())
+ return;
+
+ if (intel)
+ load_ucode_intel_bsp();
+ else
+ load_ucode_amd_bsp(family);
}
static bool check_loader_disabled_ap(void)