diff options
Diffstat (limited to 'arch/x86/kernel/microcode_intel.c')
| -rw-r--r-- | arch/x86/kernel/microcode_intel.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/x86/kernel/microcode_intel.c b/arch/x86/kernel/microcode_intel.c index 622dc4a2178..a8e62792d17 100644 --- a/arch/x86/kernel/microcode_intel.c +++ b/arch/x86/kernel/microcode_intel.c | |||
| @@ -155,6 +155,7 @@ static DEFINE_SPINLOCK(microcode_update_lock); | |||
| 155 | static int collect_cpu_info(int cpu_num, struct cpu_signature *csig) | 155 | static int collect_cpu_info(int cpu_num, struct cpu_signature *csig) |
| 156 | { | 156 | { |
| 157 | struct cpuinfo_x86 *c = &cpu_data(cpu_num); | 157 | struct cpuinfo_x86 *c = &cpu_data(cpu_num); |
| 158 | unsigned long flags; | ||
| 158 | unsigned int val[2]; | 159 | unsigned int val[2]; |
| 159 | 160 | ||
| 160 | memset(csig, 0, sizeof(*csig)); | 161 | memset(csig, 0, sizeof(*csig)); |
| @@ -174,11 +175,16 @@ static int collect_cpu_info(int cpu_num, struct cpu_signature *csig) | |||
| 174 | csig->pf = 1 << ((val[1] >> 18) & 7); | 175 | csig->pf = 1 << ((val[1] >> 18) & 7); |
| 175 | } | 176 | } |
| 176 | 177 | ||
| 178 | /* serialize access to the physical write to MSR 0x79 */ | ||
| 179 | spin_lock_irqsave(µcode_update_lock, flags); | ||
| 180 | |||
| 177 | wrmsr(MSR_IA32_UCODE_REV, 0, 0); | 181 | wrmsr(MSR_IA32_UCODE_REV, 0, 0); |
| 178 | /* see notes above for revision 1.07. Apparent chip bug */ | 182 | /* see notes above for revision 1.07. Apparent chip bug */ |
| 179 | sync_core(); | 183 | sync_core(); |
| 180 | /* get the current revision from MSR 0x8B */ | 184 | /* get the current revision from MSR 0x8B */ |
| 181 | rdmsr(MSR_IA32_UCODE_REV, val[0], csig->rev); | 185 | rdmsr(MSR_IA32_UCODE_REV, val[0], csig->rev); |
| 186 | spin_unlock_irqrestore(µcode_update_lock, flags); | ||
| 187 | |||
| 182 | pr_debug("microcode: collect_cpu_info : sig=0x%x, pf=0x%x, rev=0x%x\n", | 188 | pr_debug("microcode: collect_cpu_info : sig=0x%x, pf=0x%x, rev=0x%x\n", |
| 183 | csig->sig, csig->pf, csig->rev); | 189 | csig->sig, csig->pf, csig->rev); |
| 184 | 190 | ||
