aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBorislav Petkov <borislav.petkov@amd.com>2012-08-03 09:26:50 -0400
committerH. Peter Anvin <hpa@linux.intel.com>2012-08-22 19:14:44 -0400
commitbb9d3e473d5b324907e15dff4e54410b28ea50e2 (patch)
tree3b9407657183c6695dccf0800ccc8693c4b11682
parent4dbf32c30f7e5379588a692c7bf80b05d9ef8026 (diff)
x86, microcode: Drop uci->mc check on resume path
Remove the uci->mc check on the cpu resume path because the low-level drivers do that anyway. More importantly, though, this fixes a contrived and obscure but still important case. Imagine the following: * boot machine, no new microcode in /lib/firmware * a subset of the CPUs is offlined * in the meantime, user puts new fresh microcode container into /lib/firmware and reloads it by doing $ echo 1 > /sys/devices/system/cpu/microcode/reload * offlined cores come back online and they don't get the newer microcode applied due to this check. Later patches take care of the issue on AMD. While at it, cleanup code around it. Signed-off-by: Borislav Petkov <borislav.petkov@amd.com> Link: http://lkml.kernel.org/r/1344361461-10076-4-git-send-email-bp@amd64.org Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
-rw-r--r--arch/x86/kernel/microcode_core.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/arch/x86/kernel/microcode_core.c b/arch/x86/kernel/microcode_core.c
index 63a956865022..706a5c9b8eb2 100644
--- a/arch/x86/kernel/microcode_core.c
+++ b/arch/x86/kernel/microcode_core.c
@@ -369,13 +369,10 @@ static void microcode_fini_cpu(int cpu)
369 369
370static enum ucode_state microcode_resume_cpu(int cpu) 370static enum ucode_state microcode_resume_cpu(int cpu)
371{ 371{
372 struct ucode_cpu_info *uci = ucode_cpu_info + cpu;
373
374 if (!uci->mc)
375 return UCODE_NFOUND;
376
377 pr_debug("CPU%d updated upon resume\n", cpu); 372 pr_debug("CPU%d updated upon resume\n", cpu);
378 apply_microcode_on_target(cpu); 373
374 if (apply_microcode_on_target(cpu))
375 return UCODE_ERROR;
379 376
380 return UCODE_OK; 377 return UCODE_OK;
381} 378}
@@ -404,14 +401,11 @@ static enum ucode_state microcode_init_cpu(int cpu)
404static enum ucode_state microcode_update_cpu(int cpu) 401static enum ucode_state microcode_update_cpu(int cpu)
405{ 402{
406 struct ucode_cpu_info *uci = ucode_cpu_info + cpu; 403 struct ucode_cpu_info *uci = ucode_cpu_info + cpu;
407 enum ucode_state ustate;
408 404
409 if (uci->valid) 405 if (uci->valid)
410 ustate = microcode_resume_cpu(cpu); 406 return microcode_resume_cpu(cpu);
411 else
412 ustate = microcode_init_cpu(cpu);
413 407
414 return ustate; 408 return microcode_init_cpu(cpu);
415} 409}
416 410
417static int mc_device_add(struct device *dev, struct subsys_interface *sif) 411static int mc_device_add(struct device *dev, struct subsys_interface *sif)