From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754000AbbIOPam (ORCPT ); Tue, 15 Sep 2015 11:30:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56999 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752725AbbIOPaj (ORCPT ); Tue, 15 Sep 2015 11:30:39 -0400 Subject: Re: [PATCH v2 2/8] KVM: x86: add pcommit support To: Xiao Guangrong References: <1441778757-5866-1-git-send-email-guangrong.xiao@linux.intel.com> <1441778757-5866-3-git-send-email-guangrong.xiao@linux.intel.com> Cc: gleb@kernel.org, mtosatti@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org From: Paolo Bonzini Message-ID: <55F8399B.8080101@redhat.com> Date: Tue, 15 Sep 2015 17:30:35 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <1441778757-5866-3-git-send-email-guangrong.xiao@linux.intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/09/2015 08:05, Xiao Guangrong wrote: > + if (!guest_cpuid_has_pcommit(vcpu) && nested) > + vmx->nested.nested_vmx_secondary_ctls_high &= > + ~SECONDARY_EXEC_PCOMMIT; It is legal to set CPUID multiple times, so I think we need if (static_cpu_has(X86_FEATURE_PCOMMIT) && nested) { if (guest_cpuid_has_pcommit(vcpu)) vmx->nested.nested_vmx_secondary_ctls_high |= SECONDARY_EXEC_PCOMMIT; else vmx->nested.nested_vmx_secondary_ctls_high &= ~SECONDARY_EXEC_PCOMMIT; } The INVPCID exit probably should be handled the same way as PCOMMIT; moving both to a new nested_vmx_update_ctls_msrs probably makes sense. This can be done on top of this series. Paolo