[PATCH] KVM: MMU: Destroy mmu while we still have a vcpu left
authorAvi Kivity <avi@qumranet.com>
Sat, 6 Jan 2007 00:36:55 +0000 (16:36 -0800)
committerLinus Torvalds <torvalds@woody.osdl.org>
Sat, 6 Jan 2007 07:55:27 +0000 (23:55 -0800)
mmu_destroy flushes the guest tlb (indirectly), which needs a valid vcpu.

Signed-off-by: Avi Kivity <avi@qumranet.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/kvm/kvm_main.c

index 6623fecff040ba04a3a94b3a228d002d9a6f3a5f..6e15aef6c34ffea51d2ff7aaddb4891eb0a09f48 100644 (file)
@@ -271,8 +271,8 @@ static void kvm_free_physmem(struct kvm *kvm)
 
 static void kvm_free_vcpu(struct kvm_vcpu *vcpu)
 {
-       kvm_arch_ops->vcpu_free(vcpu);
        kvm_mmu_destroy(vcpu);
+       kvm_arch_ops->vcpu_free(vcpu);
 }
 
 static void kvm_free_vcpus(struct kvm *kvm)