aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpu/microcode
diff options
context:
space:
mode:
authorBorislav Petkov <bp@suse.de>2016-02-03 06:33:40 -0500
committerIngo Molnar <mingo@kernel.org>2016-02-09 05:41:17 -0500
commitc416e6117575213a5a962149620684a09f9e4ece (patch)
treed2c1cba034278b0775ca1f2cbacd365314be70c0 /arch/x86/kernel/cpu/microcode
parent26cbaa4dc676a444aa626cbc642c4c8181ef1378 (diff)
x86/microcode/intel: Use *wrmsrl variants
... and drop the 32-bit casting games which we had to do at the time because wrmsr() was unforgiving then, see c3fd0bd5e19a from the full history tree: commit c3fd0bd5e19aaff9cdd104edff136a2023db657e Author: Linus Torvalds <torvalds@home.osdl.org> Date: Tue Feb 17 23:23:41 2004 -0800 Fix up the microcode update on regular 32-bit x86. Our wrmsr() is a bit unforgiving and really doesn't like 64-bit values. ... Tested-by: Thomas Voegtle <tv@lio96.de> Signed-off-by: Borislav Petkov <bp@suse.de> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/1454499225-21544-13-git-send-email-bp@alien8.de Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/kernel/cpu/microcode')
-rw-r--r--arch/x86/kernel/cpu/microcode/intel.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/arch/x86/kernel/cpu/microcode/intel.c b/arch/x86/kernel/cpu/microcode/intel.c
index 35186a0dd5fc..ff0b44951d12 100644
--- a/arch/x86/kernel/cpu/microcode/intel.c
+++ b/arch/x86/kernel/cpu/microcode/intel.c
@@ -370,7 +370,7 @@ static int collect_cpu_info_early(struct ucode_cpu_info *uci)
370 native_rdmsr(MSR_IA32_PLATFORM_ID, val[0], val[1]); 370 native_rdmsr(MSR_IA32_PLATFORM_ID, val[0], val[1]);
371 csig.pf = 1 << ((val[1] >> 18) & 7); 371 csig.pf = 1 << ((val[1] >> 18) & 7);
372 } 372 }
373 native_wrmsr(MSR_IA32_UCODE_REV, 0, 0); 373 native_wrmsrl(MSR_IA32_UCODE_REV, 0);
374 374
375 /* As documented in the SDM: Do a CPUID 1 here */ 375 /* As documented in the SDM: Do a CPUID 1 here */
376 sync_core(); 376 sync_core();
@@ -648,10 +648,8 @@ static int apply_microcode_early(struct ucode_cpu_info *uci, bool early)
648 return 0; 648 return 0;
649 649
650 /* write microcode via MSR 0x79 */ 650 /* write microcode via MSR 0x79 */
651 native_wrmsr(MSR_IA32_UCODE_WRITE, 651 native_wrmsrl(MSR_IA32_UCODE_WRITE, (unsigned long)mc->bits);
652 (unsigned long)mc->bits, 652 native_wrmsrl(MSR_IA32_UCODE_REV, 0);
653 (unsigned long)mc->bits >> 16 >> 16);
654 native_wrmsr(MSR_IA32_UCODE_REV, 0, 0);
655 653
656 /* As documented in the SDM: Do a CPUID 1 here */ 654 /* As documented in the SDM: Do a CPUID 1 here */
657 sync_core(); 655 sync_core();
@@ -860,10 +858,8 @@ static int apply_microcode_intel(int cpu)
860 return 0; 858 return 0;
861 859
862 /* write microcode via MSR 0x79 */ 860 /* write microcode via MSR 0x79 */
863 wrmsr(MSR_IA32_UCODE_WRITE, 861 wrmsrl(MSR_IA32_UCODE_WRITE, (unsigned long)mc->bits);
864 (unsigned long) mc->bits, 862 wrmsrl(MSR_IA32_UCODE_REV, 0);
865 (unsigned long) mc->bits >> 16 >> 16);
866 wrmsr(MSR_IA32_UCODE_REV, 0, 0);
867 863
868 /* As documented in the SDM: Do a CPUID 1 here */ 864 /* As documented in the SDM: Do a CPUID 1 here */
869 sync_core(); 865 sync_core();