]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
KVM: PPC: Destory timer on vcpu destruction
authorAlexander Graf <alex@csgraf.de>
Mon, 22 Feb 2010 15:52:14 +0000 (16:52 +0100)
committerAvi Kivity <avi@redhat.com>
Sun, 25 Apr 2010 09:39:25 +0000 (12:39 +0300)
When we destory a vcpu, we should also make sure to kill all pending
timers that could still be up. When not doing this, hrtimers might
dereference null pointers trying to call our code.

This patch fixes spontanious kernel panics seen after closing VMs.

Signed-off-by: Alexander Graf <alex@csgraf.de>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/powerpc/kvm/powerpc.c

index ad2b6275acb724b9648854c19be8cd65a62bc3ed..ace31ca05245c60d28ffcb12750388d1196fb023 100644 (file)
@@ -200,6 +200,10 @@ struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm, unsigned int id)
 
 void kvm_arch_vcpu_free(struct kvm_vcpu *vcpu)
 {
+       /* Make sure we're not using the vcpu anymore */
+       hrtimer_cancel(&vcpu->arch.dec_timer);
+       tasklet_kill(&vcpu->arch.tasklet);
+
        kvmppc_remove_vcpu_debugfs(vcpu);
        kvmppc_core_vcpu_free(vcpu);
 }