summaryrefslogtreecommitdiffstats
path: root/drivers/kvm
diff options
context:
space:
mode:
authorAvi Kivity <avi@qumranet.com>2007-01-22 20:40:38 -0800
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-01-23 07:52:06 -0800
commit084384754ebe6636f9e5554ad30b3143b4a26c84 (patch)
tree140022f23fa4e397b7d9f5c1ac54a55a2988f67f /drivers/kvm
parent0dbe5a111382fd1320ff4b1d889e5b8c41290619 (diff)
downloadkernel-crypto-084384754ebe6636f9e5554ad30b3143b4a26c84.tar.gz
kernel-crypto-084384754ebe6636f9e5554ad30b3143b4a26c84.tar.xz
kernel-crypto-084384754ebe6636f9e5554ad30b3143b4a26c84.zip
[PATCH] KVM: make sure there is a vcpu context loaded when destroying the mmu
This makes the vmwrite errors on vm shutdown go away. Signed-off-by: Avi Kivity <avi@qumranet.com> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/kvm')
-rw-r--r--drivers/kvm/kvm_main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
index 67c1154960f..be4651abe72 100644
--- a/drivers/kvm/kvm_main.c
+++ b/drivers/kvm/kvm_main.c
@@ -272,7 +272,9 @@ static void kvm_free_physmem(struct kvm *kvm)
static void kvm_free_vcpu(struct kvm_vcpu *vcpu)
{
+ vcpu_load(vcpu->kvm, vcpu_slot(vcpu));
kvm_mmu_destroy(vcpu);
+ vcpu_put(vcpu);
kvm_arch_ops->vcpu_free(vcpu);
}