Commit da908f2f authored by Zachary Amsden's avatar Zachary Amsden Committed by Marcelo Tosatti

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: default avatarZachary Amsden <zamsden@redhat.com>
Signed-off-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
parent eebb5f31
...@@ -1958,10 +1958,10 @@ static int kvm_cpu_hotplug(struct notifier_block *notifier, unsigned long val, ...@@ -1958,10 +1958,10 @@ static int kvm_cpu_hotplug(struct notifier_block *notifier, unsigned long val,
cpu); cpu);
hardware_disable(NULL); hardware_disable(NULL);
break; break;
case CPU_ONLINE: case CPU_STARTING:
printk(KERN_INFO "kvm: enabling virtualization on CPU%d\n", printk(KERN_INFO "kvm: enabling virtualization on CPU%d\n",
cpu); cpu);
smp_call_function_single(cpu, hardware_enable, NULL, 1); hardware_enable(NULL);
break; break;
} }
return NOTIFY_OK; return NOTIFY_OK;
...@@ -2096,7 +2096,6 @@ int kvm_io_bus_unregister_dev(struct kvm *kvm, enum kvm_bus bus_idx, ...@@ -2096,7 +2096,6 @@ int kvm_io_bus_unregister_dev(struct kvm *kvm, enum kvm_bus bus_idx,
static struct notifier_block kvm_cpu_notifier = { static struct notifier_block kvm_cpu_notifier = {
.notifier_call = kvm_cpu_hotplug, .notifier_call = kvm_cpu_hotplug,
.priority = 20, /* must be > scheduler priority */
}; };
static int vm_stat_get(void *_offset, u64 *val) static int vm_stat_get(void *_offset, u64 *val)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment