diff options
author | Jeremy Katz <katzj@redhat.com> | 2007-02-19 07:37:46 -0500 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2007-03-04 04:12:39 -0500 |
commit | 43934a38d7cb39ff33baedc7f2c40a2a891116fa (patch) | |
tree | 14d37a98c2ce5ac05e23ef3f2411d2df90988504 /drivers/kvm | |
parent | bf3f8e86c2e22b9bd1375be1bbbd67384dba4342 (diff) |
KVM: Move virtualization deactivation from CPU_DEAD state to CPU_DOWN_PREPARE
This gives it more chances of surviving suspend.
Signed-off-by: Jeremy Katz <katzj@redhat.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm')
-rw-r--r-- | drivers/kvm/kvm_main.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c index af866147ff25..0a96c2c7e191 100644 --- a/drivers/kvm/kvm_main.c +++ b/drivers/kvm/kvm_main.c | |||
@@ -2080,13 +2080,17 @@ static int kvm_cpu_hotplug(struct notifier_block *notifier, unsigned long val, | |||
2080 | int cpu = (long)v; | 2080 | int cpu = (long)v; |
2081 | 2081 | ||
2082 | switch (val) { | 2082 | switch (val) { |
2083 | case CPU_DEAD: | 2083 | case CPU_DOWN_PREPARE: |
2084 | case CPU_UP_CANCELED: | 2084 | case CPU_UP_CANCELED: |
2085 | printk(KERN_INFO "kvm: disabling virtualization on CPU%d\n", | ||
2086 | cpu); | ||
2085 | decache_vcpus_on_cpu(cpu); | 2087 | decache_vcpus_on_cpu(cpu); |
2086 | smp_call_function_single(cpu, kvm_arch_ops->hardware_disable, | 2088 | smp_call_function_single(cpu, kvm_arch_ops->hardware_disable, |
2087 | NULL, 0, 1); | 2089 | NULL, 0, 1); |
2088 | break; | 2090 | break; |
2089 | case CPU_UP_PREPARE: | 2091 | case CPU_ONLINE: |
2092 | printk(KERN_INFO "kvm: enabling virtualization on CPU%d\n", | ||
2093 | cpu); | ||
2090 | smp_call_function_single(cpu, kvm_arch_ops->hardware_enable, | 2094 | smp_call_function_single(cpu, kvm_arch_ops->hardware_enable, |
2091 | NULL, 0, 1); | 2095 | NULL, 0, 1); |
2092 | break; | 2096 | break; |