* [PATCH] KVM: PPC: Destory timer on vcpu destruction
@ 2010-02-22 15:52 Alexander Graf
[not found] ` <1266853934-31883-1-git-send-email-agraf-l3A5Bk7waGM@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Alexander Graf @ 2010-02-22 15:52 UTC (permalink / raw)
To: kvm-ppc; +Cc: kvm list
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 <agraf@suse.de>
---
arch/powerpc/kvm/powerpc.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
index 8902935..5a8eb95 100644
--- a/arch/powerpc/kvm/powerpc.c
+++ b/arch/powerpc/kvm/powerpc.c
@@ -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);
}
--
1.6.0.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-02-24 10:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-22 15:52 [PATCH] KVM: PPC: Destory timer on vcpu destruction Alexander Graf
[not found] ` <1266853934-31883-1-git-send-email-agraf-l3A5Bk7waGM@public.gmane.org>
2010-02-24 10:22 ` Avi Kivity
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox