summaryrefslogtreecommitdiffstats
path: root/drivers/kvm/kvm_main.c
diff options
context:
space:
mode:
authorRusty Russell2007-10-08 02:48:30 +0200
committerAvi Kivity2008-01-30 16:52:50 +0100
commitd589444e924bc72e42fa94853f9096589d69374d (patch)
tree4150b8e1274288911687fe6f4b2dff7f7d052d2b /drivers/kvm/kvm_main.c
parentKVM: Allow dynamic allocation of the mmu shadow cache size (diff)
downloadkernel-qcow2-linux-d589444e924bc72e42fa94853f9096589d69374d.tar.gz
kernel-qcow2-linux-d589444e924bc72e42fa94853f9096589d69374d.tar.xz
kernel-qcow2-linux-d589444e924bc72e42fa94853f9096589d69374d.zip
KVM: Add kvm_free_lapic() to pair with kvm_create_lapic()
Instead of the asymetry of kvm_free_apic, implement kvm_free_lapic(). And guess what? I found a minor bug: we don't need to hrtimer_cancel() from kvm_main.c, because we do that in kvm_free_apic(). Also: 1) kvm_vcpu_uninit should be the reverse order from kvm_vcpu_init. 2) Don't set apic->regs_page to zero before freeing apic. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/kvm_main.c')
-rw-r--r--drivers/kvm/kvm_main.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
index 2bb1f2f66efa..b19734606cd9 100644
--- a/drivers/kvm/kvm_main.c
+++ b/drivers/kvm/kvm_main.c
@@ -268,10 +268,8 @@ EXPORT_SYMBOL_GPL(kvm_vcpu_init);
void kvm_vcpu_uninit(struct kvm_vcpu *vcpu)
{
+ kvm_free_lapic(vcpu);
kvm_mmu_destroy(vcpu);
- if (vcpu->apic)
- hrtimer_cancel(&vcpu->apic->timer.dev);
- kvm_free_apic(vcpu->apic);
free_page((unsigned long)vcpu->pio_data);
free_page((unsigned long)vcpu->run);
}