From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Han, Huaitong" Subject: Re: [PATCH V6 0/5] x86/hvm: pkeys, add memory protection-key support Date: Tue, 26 Jan 2016 08:06:59 +0000 Message-ID: <1453795627.21648.4.camel@intel.com> References: <1453188659-8908-1-git-send-email-huaitong.han@intel.com> <56A64C5E02000078000CAB86@prv-mh.provo.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <56A64C5E02000078000CAB86@prv-mh.provo.novell.com> Content-Language: en-US Content-ID: 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" Cc: "george.dunlap@eu.citrix.com" , "andrew.cooper3@citrix.com" , "keir@xen.org" , "wei.liu2@citrix.com" , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On Mon, 2016-01-25 at 08:25 -0700, Jan Beulich wrote: > > > > On 19.01.16 at 08:30, wrote: > > Changes in v6: > > *2 patches merged are not included. > > *Don't write XSTATE_PKRU to PV's xcr0. > > *Use "if()" instead of "?:" in cpuid handling patch. > > *Update read_pkru function. > > *Use value 4 instead of CONFIG_PAGING_LEVELS. > > *Add George's patch for PFEC_insn_fetch handling. > > How does this last item match up with ... "At the moment PFEC_insn_fetch is only set in hvm_fetch_from_guest_virt() if hvm_nx_enabled() or hvm_smep_enabled() are true. Which means that if you *don't* have nx or smep enabled, then the patch series as is will fault on instruction fetches when it shouldn't. (I don't remember anyone mentioning nx or smep being enabled as a prerequisite for pkeys.)" I think realistically the only way to address this is to start making the clean separation between "pfec in" and "pfec out" I mentioned in the previous discussion. I've coded up the attached patch, but only compile-tested it. Can you give it a look to see if you think it is correct, test it, include it in your next patch series? --from George's comments on V5 patches. > > > Huaitong Han (5): > > x86/hvm: pkeys, disable pkeys for guests in non-paging mode > > x86/hvm: pkeys, add pkeys support for guest_walk_tables > > x86/hvm: pkeys, add xstate support for pkeys > > xen/mm: Clean up pfec handling in gva_to_gfn > > x86/hvm: pkeys, add pkeys support for cpuid handling > > ... all five patches being yours? I will update a patch author to George. > > Jan >