aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>2011-10-09 15:42:00 -0400
committerBorislav Petkov <borislav.petkov@amd.com>2011-10-13 10:20:35 -0400
commit70989449daccf545214b4840b112558e25c2b3fc (patch)
tree60aef1f69d98cd7e1ef4ee5d1fe15ffd2cdbae9f /arch
parent37cf95162af4036b4198756a590aab8126fa2ce4 (diff)
x86, microcode: Don't request microcode from userspace unnecessarily
Requesting the microcode from userspace *every time* when onlining CPUs (during a CPU hotplug operation) is unnecessary. Thus, ensure that once the kernel gets the microcode after booting, it is not freed nor invalidated when a CPU goes offline, so that it can be reused when that CPU comes back online, without requesting userspace for it again. As a result, the CPU hotplug operations become faster as well. Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com> Acked-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Andreas Herrmann <andreas.herrmann3@amd.com> Link: http://lkml.kernel.org/r/4E91F908.5010006@linux.vnet.ibm.com Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/microcode_core.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/arch/x86/kernel/microcode_core.c b/arch/x86/kernel/microcode_core.c
index f9242800bc84..f2d2a664e797 100644
--- a/arch/x86/kernel/microcode_core.c
+++ b/arch/x86/kernel/microcode_core.c
@@ -483,7 +483,13 @@ mc_cpu_callback(struct notifier_block *nb, unsigned long action, void *hcpu)
483 sysfs_remove_group(&sys_dev->kobj, &mc_attr_group); 483 sysfs_remove_group(&sys_dev->kobj, &mc_attr_group);
484 pr_debug("CPU%d removed\n", cpu); 484 pr_debug("CPU%d removed\n", cpu);
485 break; 485 break;
486 case CPU_DEAD: 486
487 /*
488 * When a CPU goes offline, don't free up or invalidate the copy of
489 * the microcode in kernel memory, so that we can reuse it when the
490 * CPU comes back online without unnecessarily requesting the userspace
491 * for it again.
492 */
487 case CPU_UP_CANCELED_FROZEN: 493 case CPU_UP_CANCELED_FROZEN:
488 /* The CPU refused to come up during a system resume */ 494 /* The CPU refused to come up during a system resume */
489 microcode_fini_cpu(cpu); 495 microcode_fini_cpu(cpu);