From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Han, Huaitong" Subject: Re: [V2 PATCH 7/9] x86/hvm: pkeys, add pkeys support for guest_walk_tables Date: Wed, 2 Dec 2015 08:23:16 +0000 Message-ID: <1449044602.4010.18.camel@intel.com> References: <1448617923-10884-1-git-send-email-huaitong.han@intel.com> <1448617923-10884-8-git-send-email-huaitong.han@intel.com> <565E0377.3040103@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <565E0377.3040103@citrix.com> Content-Language: en-US Content-ID: <3C7DEDC9A947D4428696FD09008DE2D9@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: "jbeulich@suse.com" , "andrew.cooper3@citrix.com" Cc: "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On Tue, 2015-12-01 at 20:30 +0000, Andrew Cooper wrote: > > +#include > > I can see why you need xstate.h, but I why do you need i387.h ? Use vcpu_save_fpu functions. > > + > > if ( pse2M ) > > { > > /* Special case: this guest VA is in a PSE superpage, so > > there's > > @@ -330,6 +390,11 @@ guest_walk_tables(struct vcpu *v, struct > > p2m_domain *p2m, > > goto out; > > } > > rc |= ((gflags & mflags) ^ mflags); > > +#if GUEST_PAGING_LEVELS >= 4 > > + pkeys = guest_l1e_get_pkeys(gw->l1e); > > + if (leaf_pte_pkeys_check(v, pfec, gflags, pkeys)) > > + rc |= _PAGE_PKEY_BIT; > > +#endif > > As I identified in v1, the fact that you do not modify the callers of > guest_walk_tables() proves that this change is buggy. You must > modify > the callers to cope with the new error of _PAGE_PKEY_BIT. _PAGE_PKEY_BIT just a flag to tell hap_p2m_ga_to_gfn(GUEST_PAGING_LEVELS) there is a page fault, PK is real physical fault which is included in pfec, the funtion of _PAGE_PKEY_BIT is that hap_p2m_ga_to_gfn returns INVALID_GFN, you can find the pfec modification on PATCH 9/9. > > ~Andrew