From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754199AbbJPNOQ (ORCPT ); Fri, 16 Oct 2015 09:14:16 -0400 Received: from blu004-omc1s1.hotmail.com ([65.55.116.12]:54976 "EHLO BLU004-OMC1S1.hotmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751870AbbJPNOP (ORCPT ); Fri, 16 Oct 2015 09:14:15 -0400 X-TMN: [WbIPHQiWGB93fgtM04P0p4yM7V2DwsDNeXrIfwm1nZI=] X-Originating-Email: [wanpeng.li@hotmail.com] Message-ID: From: Wanpeng Li Subject: Re: [PATCH v3 0/5] KVM: nVMX: nested VPID emulation To: Paolo Bonzini References: CC: Jan Kiszka , Bandan Das , Wincy Van , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Date: Fri, 16 Oct 2015 21:13:12 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 16 Oct 2015 13:14:12.0636 (UTC) FILETIME=[8CE0B5C0:01D10814] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Ping, :-) On 10/14/15 12:12 AM, Wanpeng Li wrote: > v2 -> v3: > * separate nested_vmx_vpid_caps and move checks to patch 3/5, > only rejoin them when reading the MSR. > > v1 -> v2: > * set bit 32 of the VMX_EPT_VPID_CAP MSR > * check against the supported types in the implementation of > the INVVPID instruction > * the memory operand must always be read even if it isn't needed > (e.g., for type==global), similar to INVEPT > * for single-context invalidation to check that VPID != 0, though in > practice that doesn't matter because we don't want to support > single-context invalidation > * don't set msr's ept related bits if !enable_ept > > > VPID is used to tag address space and avoid a TLB flush. Currently L0 use > the same VPID to run L1 and all its guests. KVM flushes VPID when switching > between L1 and L2. > > This patch advertises VPID to the L1 hypervisor, then address space of L1 > and L2 can be separately treated and avoid TLB flush when swithing between > L1 and L2. For each nested vmentry, if vpid12 is changed, reuse shadow vpid > w/ an invvpid. > > Performance: > > run lmbench on L2 w/ 3.5 kernel. > > Context switching - times in microseconds - smaller is better > ------------------------------------------------------------------------- > Host OS 2p/0K 2p/16K 2p/64K 8p/16K 8p/64K 16p/16K 16p/64K > ctxsw ctxsw ctxsw ctxsw ctxsw ctxsw ctxsw > --------- ------------- ------ ------ ------ ------ ------ ------- ------- > kernel Linux 3.5.0-1 1.2200 1.3700 1.4500 4.7800 2.3300 5.60000 2.88000 nested VPID > kernel Linux 3.5.0-1 1.2600 1.4300 1.5600 12.7 12.9 3.49000 7.46000 vanilla > > Wanpeng Li (5): > KVM: VMX: adjust interface to allocate/free_vpid > KVM: VMX: introduce __vmx_flush_tlb to handle specific vpid > KVM: nVMX: emulate the INVVPID instruction > KVM: nVMX: nested VPID emulation > KVM: nVMX: expose VPID capability to L1 > > arch/x86/include/asm/vmx.h | 1 + > arch/x86/kvm/vmx.c | 151 ++++++++++++++++++++++++++++++++++++--------- > 2 files changed, 123 insertions(+), 29 deletions(-) >