From 97e91e28fa8fcbac30beab3de72060ada27d5671 Mon Sep 17 00:00:00 2001 From: Takuya Yoshikawa Date: Tue, 16 Nov 2010 17:35:02 +0900 Subject: 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 Signed-off-by: Marcelo Tosatti --- virt/kvm/kvm_main.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'virt') diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 4023264c4cd..f69fca7a88b 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, case CPU_DYING: printk(KERN_INFO "kvm: disabling virtualization on CPU%d\n", cpu); + spin_lock(&kvm_lock); hardware_disable(NULL); + spin_unlock(&kvm_lock); break; case CPU_STARTING: printk(KERN_INFO "kvm: enabling virtualization on CPU%d\n", -- cgit v1.2.3-70-g09d2