Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751937AbcDRUk2 (ORCPT ); Mon, 18 Apr 2016 16:40:28 -0400 Received: from mail-bl2on0097.outbound.protection.outlook.com ([65.55.169.97]:10307 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751015AbcDRUkZ (ORCPT ); Mon, 18 Apr 2016 16:40:25 -0400 Authentication-Results: amd.com; dkim=none (message not signed) header.d=none;amd.com; dmarc=none action=none header.from=amd.com; Subject: Re: [PART1 RFC v4 02/11] KVM: x86: Introducing kvm_x86_ops VM init/uninit hooks To: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= 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> CC: , , , , , , , , From: Suravee Suthikulpanit Message-ID: <5715462F.6090303@amd.com> Date: Mon, 18 Apr 2016 15:40:15 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <20160411204937.GA6762@potion.brq.redhat.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [165.204.53.123] X-ClientProxiedBy: BY1PR0501CA0041.namprd05.prod.outlook.com (10.162.139.51) To CY1PR12MB0442.namprd12.prod.outlook.com (10.163.91.20) X-MS-Office365-Filtering-Correlation-Id: 9c9e60c4-911d-4a5e-a1e1-08d367c9a97f X-Microsoft-Exchange-Diagnostics: 1;CY1PR12MB0442;2:X7ia8/wlc/kSFokNdWOPMdhXtT6GkFYvAjds+cVyHtlEJE9z4XU3v5bp9v+03E8h3pyWBgaHljTI7IVSLaUs8DxUsHNAQ20Cenl/j3c1EfBGVYykA/5sBD+q2naJfaU+Sijx7B671Sl+N5bqQRH3ISYLdrsCj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JM1C5E3H2Fyja1qnExelSJ1llbZXxZY+/pSVGhvuVqvq;4:YV5KUEbF2t1hZ/jEp6yPLzCJ74QFJrAfgAnOfuhIOgGKsWtj6w3voo7mtpqRCDsz8ABVMjdaQEH4xpqgQR8IfF9js87K5TLK0Ua5/5S6YLS8rcbe3t4WDR9F4f5VsAlnjEgtuQTV9L58FIeKuHsCYRtMi+q59V/+auYDGbg7YYJhxx2tmuW/nZ9p10ISAnAB+FrxnrThp8u1eLl8jVxHfsf9D5rGGfp5obJ9np54jlHO5jN1Fy1dddJ4KE+fY4WZx23nfRfCgloJ6M/YRgFghKLM6eIJgl7UdIzEENA2QBAjL3sOFHvAJI0w+Rr2cOsZm/apUN6/NDCJo0QDSngALbM3qsrhhyMtHr2qPBuw2SP9ipE5Ltl7/DE5ROZl0RtACXNsxHjNkT9bz6k5aCNB0UY7x04OegOcvb0nJlQwosE= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(9101521026)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6055026);SRVR:CY1PR12MB0442;BCL:0;PCL:0;RULEID:;SRVR:CY1PR12MB0442; X-Forefront-PRVS: 0916FC3A18 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6009001)(6049001)(377454003)(377424004)(24454002)(23676002)(110136002)(586003)(33656002)(3846002)(6116002)(5004730100002)(81166005)(2870700001)(4326007)(4001350100001)(50466002)(86362001)(99136001)(1096002)(47776003)(50986999)(65816999)(87266999)(54356999)(65956001)(2906002)(64126003)(92566002)(59896002)(5008740100001)(66066001)(65806001)(189998001)(77096005)(76176999)(80316001)(83506001)(42186005)(19580395003)(19580405001)(36756003)(2950100001);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR12MB0442;H:[10.224.4.142];FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTFQUjEy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HIRBYlbIg3Mfw1FxU9Vnrbf0xhhafhr/8X8NQhpgmLYks4=;7:AcSvBEekddEOwi5sPnb+DKN13BJLL4fat7SYJHrFzMuEa3n00yFmY8HP+ELXgowWdZYGIooaeH0etxpQcQ1YIZBmIf99D6ayN2sbn3hhJxxJ2lpnkrVj5bnaQ0gd4zqtiigdGefzu/n0q/zW6tppgFotdyVphiXCf63nT3i0iF/TIQxbZrXtc14PCEZO4L4CsvBvSgtYzK46ofvKeWwcZw==;20:7XzsnVYXNnt9FkADUK5vQJ0VbcoYM2BGDIYtTyYrdtMYKI/oBJEwpSesZwrHHtMIDIUUf2TdRu3nH5+d5XRxqjTLIWna5ghp4CTG5e5NVAitPqOgvREf6yZq+e92kybJWgDEQ77RYbVl0E4wqld/8NqPRF73n2Y28e7LD++NUelvmsBTNv1NNBkVduOPaFcki45813QWV5K7zFcOH7u7ADVxV3Pgy5W3LrIlFoEk//iooKXCrrfbDSSO+sqvCAWc X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Apr 2016 20:40:21.2923 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR12MB0442 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 874 Lines: 28 Radim, On 04/12/2016 03:49 AM, Radim Krčmář wrote: > 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.) > Okay. I'll rename this and move the hook to be called from kvm_arch_destroy_vm(). Thanks, Suravee