aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kvm
diff options
context:
space:
mode:
authorAlexander Graf <alex@csgraf.de>2010-02-22 10:52:14 -0500
committerAvi Kivity <avi@redhat.com>2010-04-25 05:39:25 -0400
commita595405df9efb89710cd555d29df0e4902f90613 (patch)
tree1e190f38f77e407465e14ae5eb3b468ffbce0ed7 /arch/powerpc/kvm
parent7e821d3920c130d413c4c7454b0ece59445490db (diff)
KVM: PPC: Destory timer on vcpu destruction
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>
Diffstat (limited to 'arch/powerpc/kvm')
-rw-r--r--arch/powerpc/kvm/powerpc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
index ad2b6275acb7..ace31ca05245 100644
--- a/arch/powerpc/kvm/powerpc.c
+++ b/arch/powerpc/kvm/powerpc.c
@@ -200,6 +200,10 @@ struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm, unsigned int id)
200 200
201void kvm_arch_vcpu_free(struct kvm_vcpu *vcpu) 201void kvm_arch_vcpu_free(struct kvm_vcpu *vcpu)
202{ 202{
203 /* Make sure we're not using the vcpu anymore */
204 hrtimer_cancel(&vcpu->arch.dec_timer);
205 tasklet_kill(&vcpu->arch.tasklet);
206
203 kvmppc_remove_vcpu_debugfs(vcpu); 207 kvmppc_remove_vcpu_debugfs(vcpu);
204 kvmppc_core_vcpu_free(vcpu); 208 kvmppc_core_vcpu_free(vcpu);
205} 209}