From mboxrd@z Thu Jan 1 00:00:00 1970 From: Suravee Suthikulpanit Subject: Re: [PART1 RFC v4 02/11] KVM: x86: Introducing kvm_x86_ops VM init/uninit hooks Date: Mon, 18 Apr 2016 17:01:09 -0500 Message-ID: <57155925.2080009@amd.com> References: <1460017232-17429-1-git-send-email-Suravee.Suthikulpanit@amd.com> <1460017232-17429-3-git-send-email-Suravee.Suthikulpanit@amd.com> <20160411204937.GA6762@potion.brq.redhat.com> <570D6ED5.4030403@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: , , , , , , , To: Paolo Bonzini , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= Return-path: In-Reply-To: <570D6ED5.4030403@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org Paolo, On 04/12/2016 04:55 PM, Paolo Bonzini wrote: > > > On 11/04/2016 22:49, Radim Kr=C4=8Dm=C3=A1=C5=99 wrote: >>>> @@ -7781,6 +7784,9 @@ static void kvm_free_vcpus(struct kvm *kvm) >>>> kvm_for_each_vcpu(i, vcpu, kvm) >>>> kvm_arch_vcpu_free(vcpu); >>>> >>>> + if (kvm_x86_ops->vm_uninit) >>>> + kvm_x86_ops->vm_uninit(kvm); >> vm_uninit() doesn't seem to have much to do with kvm_free_vcpus(), >> 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 pointe= r, > so please call it early, right after the "if (current->mm =3D=3D kvm-= >mm)" > block. > > Paolo Good point. Thanks, Suravee