From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH 09/10] x86/hvm: pkeys, add pkeys support for guest_walk_tables Date: Mon, 16 Nov 2015 16:59:39 +0000 Message-ID: <564A0B7B.3050007@citrix.com> References: <1447669917-17939-1-git-send-email-huaitong.han@intel.com> <1447669917-17939-10-git-send-email-huaitong.han@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1447669917-17939-10-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 , jbeulich@suse.com, jun.nakajima@intel.com, eddie.dong@intel.com, kevin.tian@intel.com, george.dunlap@eu.citrix.com, ian.jackson@eu.citrix.com, stefano.stabellini@eu.citrix.com, ian.campbell@citrix.com, wei.liu2@citrix.com, keir@xen.org Cc: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On 16/11/15 10:31, Huaitong Han wrote: > #if GUEST_PAGING_LEVELS >= 4 /* 64-bit only... */ > diff --git a/xen/include/asm-x86/guest_pt.h b/xen/include/asm-x86/guest_pt.h > index f8a0d76..1c0f050 100644 > --- a/xen/include/asm-x86/guest_pt.h > +++ b/xen/include/asm-x86/guest_pt.h > @@ -154,6 +154,17 @@ static inline u32 guest_l4e_get_flags(guest_l4e_t gl4e) > { return l4e_get_flags(gl4e); } > #endif > > +static inline u32 guest_l1e_get_pkeys(guest_l1e_t gl1e) > +{ return l1e_get_pkeys(gl1e); } > +static inline u32 guest_l2e_get_pkeys(guest_l2e_t gl2e) > +{ return l2e_get_pkeys(gl2e); } > +static inline u32 guest_l3e_get_pkeys(guest_l3e_t gl3e) > +{ return l3e_get_pkeys(gl3e); } > +#if GUEST_PAGING_LEVELS >= 4 > +static inline u32 guest_l4e_get_pkeys(guest_l4e_t gl4e) > +{ return l4e_get_pkeys(gl4e); } > +#endif Actually, the manual indicates that protection keys only exist in L3, L2 and L1 entries. Therefore, guest_l4e_get_pkeys() is not valid and should be removed, as should l4e_get_pkeys() in patch 6. ~Andrew