From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753889AbbIPNxw (ORCPT ); Wed, 16 Sep 2015 09:53:52 -0400 Received: from blu004-omc1s9.hotmail.com ([65.55.116.20]:61671 "EHLO BLU004-OMC1S9.hotmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753835AbbIPNxq (ORCPT ); Wed, 16 Sep 2015 09:53:46 -0400 X-TMN: [QqzBmeKxeuelhZHYi6nrcVoEIXj/gyv1xVP1Kb9e71I=] X-Originating-Email: [wanpeng.li@hotmail.com] Message-ID: From: Wanpeng Li Subject: Re: [PATCH] KVM: vmx: fix VPID is 0000H in non-root operation To: Paolo Bonzini , Jan Kiszka References: <55F96161.2090405@siemens.com> <55F963B6.9070402@redhat.com> CC: Bandan Das , Wincy Van , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Date: Wed, 16 Sep 2015 21:53:35 +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: <55F963B6.9070402@redhat.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 16 Sep 2015 13:53:44.0251 (UTC) FILETIME=[1A13F0B0:01D0F087] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/16/15 8:42 PM, Paolo Bonzini wrote: > > On 16/09/2015 14:32, Jan Kiszka wrote: >> BTW, what will happen if allocate_vpid runs out of free slots and >> returns 0? Will we always fail then...? > The return value of vmx_secondary_exec_control will not have > SECONDARY_EXEC_ENABLE_VPID, so it's okay. However, I think > we need this in the nested VPID patches: > > diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c > index c23482cda1a7..e6859b45b00b 100644 > --- a/arch/x86/kvm/vmx.c > +++ b/arch/x86/kvm/vmx.c > @@ -9456,7 +9460,7 @@ static void prepare_vmcs02(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12) > else > vmcs_write64(TSC_OFFSET, vmx->nested.vmcs01_tsc_offset); > > - if (enable_vpid) { > + if (vmx->nested.vpid02) { > /* > * There is no direct mapping between vpid02 and vpid12, the > * vpid02 is per-vCPU for L0 and reused while the value of > Looks good to me. Regards, Wanpeng Li