From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752290AbbIPCgO (ORCPT ); Tue, 15 Sep 2015 22:36:14 -0400 Received: from blu004-omc1s17.hotmail.com ([65.55.116.28]:55020 "EHLO BLU004-OMC1S17.hotmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751378AbbIPCgM (ORCPT ); Tue, 15 Sep 2015 22:36:12 -0400 X-TMN: [6fXXfxEmWEP1gDVFKqQhlRsQ3LjImKML] X-Originating-Email: [wanpeng.li@hotmail.com] Message-ID: Subject: Re: [PATCH] KVM: nVMX: nested VPID emulation To: Jan Kiszka , Paolo Bonzini References: <55F6DF9D.5070508@siemens.com> <55F8563D.3050905@siemens.com> CC: kvm@vger.kernel.org, linux-kernel@vger.kernel.org From: Wanpeng Li Date: Wed, 16 Sep 2015 10:36:04 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <55F8563D.3050905@siemens.com> Content-Type: text/plain; charset="iso-8859-15"; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 16 Sep 2015 02:36:10.0591 (UTC) FILETIME=[729BB6F0:01D0F028] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/16/15 1:32 AM, Jan Kiszka wrote: > On 2015-09-15 12:14, Wanpeng Li wrote: >> On 9/14/15 10:54 PM, Jan Kiszka wrote: >>> Last but not least: the guest can now easily exhaust the host's pool of >>> vpid by simply spawning plenty of VCPUs for L2, no? Is this acceptable >>> or should there be some limit? >> I reuse the value of vpid02 while vpid12 changed w/ one invvpid in v2, >> and the scenario which you pointed out can be avoid. > I cannot yet follow why there is no chance for L1 to consume all vpids > that the host manages in that single, global bitmap by simply spawning a > lot of nested VCPUs for some L2. What is enforcing L1 to call nested > vmclear - apparently the only way, besides destructing nested VCPUs, to > release such vpids again? In v2, there is no direct mapping between vpid02 and vpid12, the vpid02 is per-vCPU for L0 and reused while the value of vpid12 is changed w/ one invvpid during nested vmentry. The vpid12 is allocated by L1 for L2, so it will not influence global bitmap(for vpid01 and vpid02 allocation) even if spawn a lot of nested vCPUs. Regards, Wanpeng Li