From: Eduardo Habkost Subject: Re: [Qemu-devel] [PATCH v3 0/3] target-i386: add memory protection-key support Date: Wed, 18 Nov 2015 15:51:59 -0200 Message-ID: <20151118175159.GJ20436@thinpad.lan.raisama.net> References: <1447813217-10532-1-git-send-email-huaitong.han@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: pbonzini@redhat.com, rth@twiddle.net, afaerber@suse.de, qemu-devel@nongnu.org, kvm@vger.kernel.org To: Huaitong Han Return-path: Received: from mx1.redhat.com ([209.132.183.28]:38843 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754619AbbKRRyF (ORCPT ); Wed, 18 Nov 2015 12:54:05 -0500 Content-Disposition: inline In-Reply-To: <1447813217-10532-1-git-send-email-huaitong.han@intel.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Nov 18, 2015 at 10:20:14AM +0800, Huaitong Han wrote: > Changes in v3: > *Fix cpuid_7_0_ecx_feature_name error. > > Changes in v2: > *Fix memcpy error for xsave state. > *Fix TCG_7_0_ECX_FEATURES to 0. > *Make subjects more readable. > > The protection-key feature provides an additional mechanism by which IA-32e > paging controls access to usermode addresses. > > Hardware support for protection keys for user pages is enumerated with CPUID > feature flag CPUID.7.0.ECX[3]:PKU. Software support is CPUID.7.0.ECX[4]:OSPKE > with the setting of CR4.PKE(bit 22). > > The PKRU register is XSAVE-managed state CPUID.D.0.EAX[9], the size of XSAVE > state component for PKRU is 8 bytes, the offset is 0xa80. Is every CPU supporting PKU guaranteed to have CPUID.(EAX=0DH,ECX=9):EBX = 0xa80? Where is the PKRU state offset/layout documented? > > The specification of Protection Keys can be found at SDM (4.6.2, volume 3) > http://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-manual-325462.pdf. > [...] -- Eduardo