Re: In kernel PIC support: kernel patch

Dong, Eddie
2007-07-06T17:46:29Z

Avi Kivity wrote:
> Merged both into the 'lapic2' branch. Got the following oops running
> Windows (i386 on Intel):
>

Avi:
This one should fixed the bug.
Against lapic2 dc03e1b70198e0e4aadfc9063399590fa42cf55e.
thx,eddie

Destroy io bus earlier than all the registered bus node get freed
including vpic.

Signed-off-by: Yaozu (Eddie) Dong <eddie.dong-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
index d785b2e..06e5804 100644
--- a/drivers/kvm/kvm_main.c
+++ b/drivers/kvm/kvm_main.c
@@ -427,9 +427,9 @@ static void kvm_destroy_vm(struct kvm *kvm)
spin_lock(&kvm_lock);
list_del(&kvm->vm_list);
spin_unlock(&kvm_lock);
- kfree(kvm->vpic);
kvm_io_bus_destroy(&kvm->pio_bus);
kvm_io_bus_destroy(&kvm->mmio_bus);
+ kfree(kvm->vpic);
kvm_free_vcpus(kvm);
kvm_free_physmem(kvm);
kfree(kvm);