From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wei Liu Subject: Re: [PATCH 01/10] x86/hvm: pkeys, add pkeys support for cpuid handling Date: Mon, 16 Nov 2015 16:58:52 +0000 Message-ID: <20151116165852.GB25764@citrix.com> References: <1447669917-17939-1-git-send-email-huaitong.han@intel.com> <1447669917-17939-2-git-send-email-huaitong.han@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1447669917-17939-2-git-send-email-huaitong.han@intel.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Huaitong Han Cc: kevin.tian@intel.com, wei.liu2@citrix.com, jbeulich@suse.com, stefano.stabellini@eu.citrix.com, george.dunlap@eu.citrix.com, andrew.cooper3@citrix.com, eddie.dong@intel.com, xen-devel@lists.xen.org, jun.nakajima@intel.com, keir@xen.org, ian.jackson@eu.citrix.com, ian.campbell@citrix.com List-Id: xen-devel@lists.xenproject.org On Mon, Nov 16, 2015 at 06:31:48PM +0800, Huaitong Han wrote: > This patch adds pkeys support for cpuid handing. > > Pkeys hardware support is CPUID.7.0.ECX[3]:PKU. software support is > CPUID.7.0.ECX[4]:OSPKE and it reflects the support setting of CR4.PKE. > > Signed-off-by: Huaitong Han > All patches in your series don't contain diffstat. Can you have that in your patches in the future? > diff --git a/tools/libxc/xc_cpufeature.h b/tools/libxc/xc_cpufeature.h > index c3ddc80..f6a9778 100644 > --- a/tools/libxc/xc_cpufeature.h > +++ b/tools/libxc/xc_cpufeature.h > @@ -141,5 +141,7 @@ > #define X86_FEATURE_ADX 19 /* ADCX, ADOX instructions */ > #define X86_FEATURE_SMAP 20 /* Supervisor Mode Access Protection */ > > +/* Intel-defined CPU features, CPUID level 0x00000007:0 (ecx) */ > +#define X86_FEATURE_PKU 3 > > #endif /* __LIBXC_CPUFEATURE_H */ > diff --git a/tools/libxc/xc_cpuid_x86.c b/tools/libxc/xc_cpuid_x86.c > index e146a3e..34bb964 100644 > --- a/tools/libxc/xc_cpuid_x86.c > +++ b/tools/libxc/xc_cpuid_x86.c > @@ -367,9 +367,11 @@ static void xc_cpuid_hvm_policy( > bitmaskof(X86_FEATURE_ADX) | > bitmaskof(X86_FEATURE_SMAP) | > bitmaskof(X86_FEATURE_FSGSBASE)); > + regs[2] &= bitmaskof(X86_FEATURE_PKU); > } else > - regs[1] = 0; > - regs[0] = regs[2] = regs[3] = 0; > + regs[1] = regs[2] = 0; > + > + regs[0] = regs[3] = 0; > break; As far as I can tell this snippet is the only place toolstack code is touched in this series. I'm going to delegate reviewing to x86 maintainers. :-) Wei.