From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH V2 7/7] KVM, pkeys: disable PKU feature without ept Date: Mon, 16 Nov 2015 10:20:10 +0100 Message-ID: <56499FCA.20303@redhat.com> References: <1447660311-12003-1-git-send-email-huaitong.han@intel.com> <1447660311-12003-8-git-send-email-huaitong.han@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Huaitong Han , gleb@kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:40633 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751139AbbKPJUP (ORCPT ); Mon, 16 Nov 2015 04:20:15 -0500 In-Reply-To: <1447660311-12003-8-git-send-email-huaitong.han@intel.com> Sender: kvm-owner@vger.kernel.org List-ID: On 16/11/2015 08:51, Huaitong Han wrote: > This patch disables CPUID:PKU without ept. The commit message and probably the code too should say why. Paolo > Signed-off-by: Huaitong Han > > diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c > index ece687b..e1113ae 100644 > --- a/arch/x86/kvm/cpuid.c > +++ b/arch/x86/kvm/cpuid.c > @@ -447,6 +447,8 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function, > entry->ebx |= F(TSC_ADJUST); > entry->ecx &= kvm_supported_word11_x86_features; > cpuid_mask(&entry->ecx, 13); > + if (!tdp_enabled) > + entry->ecx &= ~F(PKU); > } else { > entry->ebx = 0; > entry->ecx = 0; >