aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZachary Amsden <zamsden@redhat.com>2010-08-20 04:07:27 -0400
committerMarcelo Tosatti <mtosatti@redhat.com>2010-09-09 12:48:16 -0400
commitda908f2fb4e783c2a4de751fb90f11a0dd041161 (patch)
tree0fb41e2650900f49fe36cd13046cdbe9fe5dec89
parenteebb5f31b8d9a2620dcf32297096f8ce1240b179 (diff)
KVM: x86: Perform hardware_enable in CPU_STARTING callback
The CPU_STARTING callback was added upstream with the intention of being used for KVM, specifically for the hardware enablement that must be done before we can run in hardware virt. It had bugs on the x86_64 architecture at the time, where it was called after CPU_ONLINE. The arches have since merged and the bug is gone. It might be noted other features should probably start making use of this callback; microcode updates in particular which might be fixing important erratums would be best applied before beginning to run user tasks. Signed-off-by: Zachary Amsden <zamsden@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
-rw-r--r--virt/kvm/kvm_main.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index b78b794c1039..d4853a54771a 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -1958,10 +1958,10 @@ static int kvm_cpu_hotplug(struct notifier_block *notifier, unsigned long val,
1958 cpu); 1958 cpu);
1959 hardware_disable(NULL); 1959 hardware_disable(NULL);
1960 break; 1960 break;
1961 case CPU_ONLINE: 1961 case CPU_STARTING:
1962 printk(KERN_INFO "kvm: enabling virtualization on CPU%d\n", 1962 printk(KERN_INFO "kvm: enabling virtualization on CPU%d\n",
1963 cpu); 1963 cpu);
1964 smp_call_function_single(cpu, hardware_enable, NULL, 1); 1964 hardware_enable(NULL);
1965 break; 1965 break;
1966 } 1966 }
1967 return NOTIFY_OK; 1967 return NOTIFY_OK;
@@ -2096,7 +2096,6 @@ int kvm_io_bus_unregister_dev(struct kvm *kvm, enum kvm_bus bus_idx,
2096 2096
2097static struct notifier_block kvm_cpu_notifier = { 2097static struct notifier_block kvm_cpu_notifier = {
2098 .notifier_call = kvm_cpu_hotplug, 2098 .notifier_call = kvm_cpu_hotplug,
2099 .priority = 20, /* must be > scheduler priority */
2100}; 2099};
2101 2100
2102static int vm_stat_get(void *_offset, u64 *val) 2101static int vm_stat_get(void *_offset, u64 *val)