From mboxrd@z Thu Jan 1 00:00:00 1970 From: Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: [PART1 RFC v4 02/11] KVM: x86: Introducing kvm_x86_ops VM init/uninit hooks Date: Mon, 11 Apr 2016 22:49:38 +0200 Message-ID: <20160411204937.GA6762@potion.brq.redhat.com> References: <1460017232-17429-1-git-send-email-Suravee.Suthikulpanit@amd.com> <1460017232-17429-3-git-send-email-Suravee.Suthikulpanit@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: pbonzini@redhat.com, joro@8bytes.org, bp@alien8.de, gleb@kernel.org, alex.williamson@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, wei@redhat.com, sherry.hurwitz@amd.com To: Suravee Suthikulpanit Return-path: Content-Disposition: inline In-Reply-To: <1460017232-17429-3-git-send-email-Suravee.Suthikulpanit@amd.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org 2016-04-07 03:20-0500, Suravee Suthikulpanit: > Adding function pointers in struct kvm_x86_ops for processor-specific > layer to provide hooks for when KVM initialize and un-initialize VM. > > Signed-off-by: Suravee Suthikulpanit > --- > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > @@ -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.)