aboutsummaryrefslogtreecommitdiffstats
path: root/virt/kvm/kvm_main.c
diff options
context:
space:
mode:
authorTakuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>2010-11-16 03:35:02 -0500
committerAvi Kivity <avi@redhat.com>2011-01-12 04:29:28 -0500
commit97e91e28fa8fcbac30beab3de72060ada27d5671 (patch)
treeb6a1331007935961eb25157e7cceba13d9587090 /virt/kvm/kvm_main.c
parente730b63cc083852551b092e1c93f0ef22c25f220 (diff)
KVM: take kvm_lock for hardware_disable() during cpu hotplug
In kvm_cpu_hotplug(), only CPU_STARTING case is protected by kvm_lock. This patch adds missing protection for CPU_DYING case. Signed-off-by: Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'virt/kvm/kvm_main.c')
-rw-r--r--virt/kvm/kvm_main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 4023264c4cd5..f69fca7a88b5 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -2140,7 +2140,9 @@ static int kvm_cpu_hotplug(struct notifier_block *notifier, unsigned long val,
2140 case CPU_DYING: 2140 case CPU_DYING:
2141 printk(KERN_INFO "kvm: disabling virtualization on CPU%d\n", 2141 printk(KERN_INFO "kvm: disabling virtualization on CPU%d\n",
2142 cpu); 2142 cpu);
2143 spin_lock(&kvm_lock);
2143 hardware_disable(NULL); 2144 hardware_disable(NULL);
2145 spin_unlock(&kvm_lock);
2144 break; 2146 break;
2145 case CPU_STARTING: 2147 case CPU_STARTING:
2146 printk(KERN_INFO "kvm: enabling virtualization on CPU%d\n", 2148 printk(KERN_INFO "kvm: enabling virtualization on CPU%d\n",