Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755112AbcDKUto (ORCPT ); Mon, 11 Apr 2016 16:49:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50971 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754111AbcDKUtn (ORCPT ); Mon, 11 Apr 2016 16:49:43 -0400 Date: Mon, 11 Apr 2016 22:49:38 +0200 From: Radim =?utf-8?B?S3LEjW3DocWZ?= To: Suravee Suthikulpanit 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 Subject: Re: [PART1 RFC v4 02/11] KVM: x86: Introducing kvm_x86_ops VM init/uninit hooks 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 Content-Disposition: inline In-Reply-To: <1460017232-17429-3-git-send-email-Suravee.Suthikulpanit@amd.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 11 Apr 2016 20:49:42 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 695 Lines: 18 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.)