Skip to contentSkip to conversation

KVM: PPC: Destory timer on vcpu destruction

PATCH Applied Alexander Graf 2 participants 2 messages Feb 22, 2010 – Feb 24, 2010 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 arch/powerpc/kvm/powerpc.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
arch/powerpc/kvm/powerpc.c +4 -0
index 8902935..5a8eb95 100644
@@ -199,6 +199,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);
 }
Signature · 1 line
1.6.0.2

A message that is not in the archive (sent off-list or not yet received): 1266853934-31883-1-git-send-email-agraf-l3A5Bk7waGM@public.gmane.org

Applied
#2 lore raw
Quoted 6 lines · Alexander Graf

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.

Applied, thanks.

Signature · 1 line
error compiling committee.c: too many arguments to function