Commit 43934a38 authored by Jeremy Katz's avatar Jeremy Katz Committed by Avi Kivity

KVM: Move virtualization deactivation from CPU_DEAD state to CPU_DOWN_PREPARE

This gives it more chances of surviving suspend.
Signed-off-by: default avatarJeremy Katz <katzj@redhat.com>
Signed-off-by: default avatarAvi Kivity <avi@qumranet.com>
parent bf3f8e86
...@@ -2080,13 +2080,17 @@ static int kvm_cpu_hotplug(struct notifier_block *notifier, unsigned long val, ...@@ -2080,13 +2080,17 @@ static int kvm_cpu_hotplug(struct notifier_block *notifier, unsigned long val,
int cpu = (long)v; int cpu = (long)v;
switch (val) { switch (val) {
case CPU_DEAD: case CPU_DOWN_PREPARE:
case CPU_UP_CANCELED: case CPU_UP_CANCELED:
printk(KERN_INFO "kvm: disabling virtualization on CPU%d\n",
cpu);
decache_vcpus_on_cpu(cpu); decache_vcpus_on_cpu(cpu);
smp_call_function_single(cpu, kvm_arch_ops->hardware_disable, smp_call_function_single(cpu, kvm_arch_ops->hardware_disable,
NULL, 0, 1); NULL, 0, 1);
break; break;
case CPU_UP_PREPARE: case CPU_ONLINE:
printk(KERN_INFO "kvm: enabling virtualization on CPU%d\n",
cpu);
smp_call_function_single(cpu, kvm_arch_ops->hardware_enable, smp_call_function_single(cpu, kvm_arch_ops->hardware_enable,
NULL, 0, 1); NULL, 0, 1);
break; break;
......
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