From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH V5 8/9] KVM, pkeys: disable PKU feature without ept Date: Mon, 21 Mar 2016 12:01:54 +0100 Message-ID: <56EFD4A2.7000802@redhat.com> References: <1458554760-4374-1-git-send-email-huaitong.han@intel.com> <1458554760-4374-9-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, guangrong.xiao@linux.intel.com To: Huaitong Han , gleb@kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:35240 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753865AbcCULB6 (ORCPT ); Mon, 21 Mar 2016 07:01:58 -0400 In-Reply-To: <1458554760-4374-9-git-send-email-huaitong.han@intel.com> Sender: kvm-owner@vger.kernel.org List-ID: On 21/03/2016 11:05, Huaitong Han wrote: > This patch disables CPUID:PKU without ept, because pkeys is not yet > implemented for shadow paging. > > Signed-off-by: Huaitong Han > Reviewed-by: Xiao Guangrong > --- > arch/x86/kvm/cpuid.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c > index 7dc7a5a..5028c1e 100644 > --- a/arch/x86/kvm/cpuid.c > +++ b/arch/x86/kvm/cpuid.c > @@ -447,6 +447,12 @@ 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, CPUID_7_ECX); > + if (!tdp_enabled) > + /* > + * PKU is not yet implemented for shadow > + * paging. > + */ > + entry->ecx &= ~F(PKU); > } else { > entry->ebx = 0; > entry->ecx = 0; > I'll squash this into the previous patch. Paolo