On 11/04/2016 22:49, Radim KrÄmÃÅ wrote:
vm_uninit() doesn't seem to have much to do with kvm_free_vcpus(),@@ -7781,6 +7784,9 @@ static void kvm_free_vcpus(struct kvm *kvm)
kvm_for_each_vcpu(i, vcpu, kvm)
+ if (kvm_x86_ops->vm_uninit)
please call it from kvm_arch_destroy_vm().
(kvm_x86_ops.vm_destroy would be a better name then.)
Especially, you're calling it with struct kvm full of dangling pointer,
so please call it early, right after the "if (current->mm == kvm->mm)"