aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpu/microcode/intel.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-01-11 19:46:20 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2016-01-11 19:46:20 -0500
commit671d5532aaad777782b66eff71bc4dfad25f942d (patch)
treefdd480fbd7bd8078c60e1fe3eea98a8cefb8df67 /arch/x86/kernel/cpu/microcode/intel.c
parent67c707e451e12f59e57bca6cf33b5803cb74b022 (diff)
parent0007bccc3cfd1e69deb0fd73ccc426b4cedb061d (diff)
Merge branch 'x86-cpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 cpu updates from Ingo Molnar: "The main changes in this cycle were: - Improved CPU ID handling code and related enhancements (Borislav Petkov) - RDRAND fix (Len Brown)" * 'x86-cpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86: Replace RDRAND forced-reseed with simple sanity check x86/MSR: Chop off lower 32-bit value x86/cpu: Fix MSR value truncation issue x86/cpu/amd, kvm: Satisfy guest kernel reads of IC_CFG MSR kvm: Add accessors for guest CPU's family, model, stepping x86/cpu: Unify CPU family, model, stepping calculation
Diffstat (limited to 'arch/x86/kernel/cpu/microcode/intel.c')
-rw-r--r--arch/x86/kernel/cpu/microcode/intel.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/arch/x86/kernel/cpu/microcode/intel.c b/arch/x86/kernel/cpu/microcode/intel.c
index ce47402eb2f9..ee81c544ee0d 100644
--- a/arch/x86/kernel/cpu/microcode/intel.c
+++ b/arch/x86/kernel/cpu/microcode/intel.c
@@ -145,10 +145,10 @@ matching_model_microcode(struct microcode_header_intel *mc_header,
145 int ext_sigcount, i; 145 int ext_sigcount, i;
146 struct extended_signature *ext_sig; 146 struct extended_signature *ext_sig;
147 147
148 fam = __x86_family(sig); 148 fam = x86_family(sig);
149 model = x86_model(sig); 149 model = x86_model(sig);
150 150
151 fam_ucode = __x86_family(mc_header->sig); 151 fam_ucode = x86_family(mc_header->sig);
152 model_ucode = x86_model(mc_header->sig); 152 model_ucode = x86_model(mc_header->sig);
153 153
154 if (fam == fam_ucode && model == model_ucode) 154 if (fam == fam_ucode && model == model_ucode)
@@ -163,7 +163,7 @@ matching_model_microcode(struct microcode_header_intel *mc_header,
163 ext_sigcount = ext_header->count; 163 ext_sigcount = ext_header->count;
164 164
165 for (i = 0; i < ext_sigcount; i++) { 165 for (i = 0; i < ext_sigcount; i++) {
166 fam_ucode = __x86_family(ext_sig->sig); 166 fam_ucode = x86_family(ext_sig->sig);
167 model_ucode = x86_model(ext_sig->sig); 167 model_ucode = x86_model(ext_sig->sig);
168 168
169 if (fam == fam_ucode && model == model_ucode) 169 if (fam == fam_ucode && model == model_ucode)
@@ -365,7 +365,7 @@ static int collect_cpu_info_early(struct ucode_cpu_info *uci)
365 native_cpuid(&eax, &ebx, &ecx, &edx); 365 native_cpuid(&eax, &ebx, &ecx, &edx);
366 csig.sig = eax; 366 csig.sig = eax;
367 367
368 family = __x86_family(csig.sig); 368 family = x86_family(csig.sig);
369 model = x86_model(csig.sig); 369 model = x86_model(csig.sig);
370 370
371 if ((model >= 5) || (family > 6)) { 371 if ((model >= 5) || (family > 6)) {
@@ -521,16 +521,12 @@ static bool __init load_builtin_intel_microcode(struct cpio_data *cp)
521{ 521{
522#ifdef CONFIG_X86_64 522#ifdef CONFIG_X86_64
523 unsigned int eax = 0x00000001, ebx, ecx = 0, edx; 523 unsigned int eax = 0x00000001, ebx, ecx = 0, edx;
524 unsigned int family, model, stepping;
525 char name[30]; 524 char name[30];
526 525
527 native_cpuid(&eax, &ebx, &ecx, &edx); 526 native_cpuid(&eax, &ebx, &ecx, &edx);
528 527
529 family = __x86_family(eax); 528 sprintf(name, "intel-ucode/%02x-%02x-%02x",
530 model = x86_model(eax); 529 x86_family(eax), x86_model(eax), x86_stepping(eax));
531 stepping = eax & 0xf;
532
533 sprintf(name, "intel-ucode/%02x-%02x-%02x", family, model, stepping);
534 530
535 return get_builtin_firmware(cp, name); 531 return get_builtin_firmware(cp, name);
536#else 532#else