From: Paolo Bonzini <pbonzini@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>,
Huaitong Han <huaitong.han@intel.com>
Cc: qemu-devel@nongnu.org, afaerber@suse.de, kvm@vger.kernel.org,
rth@twiddle.net
Subject: Re: [Qemu-devel] [PATCH v3 0/3] target-i386: add memory protection-key support
Date: Wed, 18 Nov 2015 22:28:41 +0100 [thread overview]
Message-ID: <564CED89.40504@redhat.com> (raw)
In-Reply-To: <20151118175159.GJ20436@thinpad.lan.raisama.net>
On 18/11/2015 18:51, Eduardo Habkost wrote:
> Is every CPU supporting PKU guaranteed to have
> CPUID.(EAX=0DH,ECX=9):EBX = 0xa80?
We asked Intel a while ago when reorganizing XSAVE support in KVM and
QEMU. Unfortunately, Intel is not listing the offsets anymore in the
documentation, but they confirmed at the time that offsets won't change.
http://lists.xen.org/archives/html/xen-devel/2013-09/msg00484.html is
pretty clear in this respect:
>> [adding H. Peter Anvin... the context is whether the layout of the
>> XSAVE/XRSTOR area is fixed, including the offset of each separate
>> Ext_SAVE_Area].
>
> It is.
>
>> So please Intel, pretty please do not modify the XSAVE offsets, and
>> clarify this as soon as possible.
>
> They will not change.
>
> -hpa
This of course doesn't mean that the 0xa80 is correct; it only means
that if it is correct, it will always stay correct. :)
It makes sense that 0xa80 is correct, since ECX=8 is a supervisor state
(thus never saved by XSAVE/XSAVEOPT).
The fact that standard format does not account for supervisor states
means that supporting supervisor states in KVM might encounter a few
small complications. In particular we might have to modify KVM and QEMU
to support compacted format in KVM_GET/SET_XSAVE. For now the only
supervisor state is just a bunch of MSRs, so it would not be necessary
to include it in KVM_GET/SET_XSAVE. Problem averted for now, then.
> Where is the PKRU state offset/layout documented?
Volume 1 of the SDM, section 13.5.7 ("PKRU State") documents the layout.
(Careful: chapter 13 of volume 1 is "Managing State Using the XSAVE
Feature Set"; chapter 13 of volume 3 is "System Programming for
Instruction Set Extensions and Processor Extended States", and also
deals with XSAVE).
Paolo
next prev parent reply other threads:[~2015-11-18 21:28 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-18 2:20 [Qemu-devel] [PATCH v3 0/3] target-i386: add memory protection-key support Huaitong Han
2015-11-18 2:20 ` [Qemu-devel] [PATCH v3 1/3] target-i386: add pkeys support for cpuid handling Huaitong Han
2015-11-18 15:58 ` Eduardo Habkost
2015-11-19 6:36 ` Han, Huaitong
2015-11-19 11:10 ` Paolo Bonzini
2015-11-19 14:56 ` Eduardo Habkost
2015-11-18 2:20 ` [Qemu-devel] [PATCH v3 2/3] target-i386: add pkeys support for xsave state handling Huaitong Han
2015-11-18 2:20 ` [Qemu-devel] [PATCH v3 3/3] target-i386: add pkeys support for vm migration Huaitong Han
2015-11-18 17:51 ` [Qemu-devel] [PATCH v3 0/3] target-i386: add memory protection-key support Eduardo Habkost
2015-11-18 21:28 ` Paolo Bonzini [this message]
2015-12-04 14:57 ` Eduardo Habkost
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=564CED89.40504@redhat.com \
--to=pbonzini@redhat.com \
--cc=afaerber@suse.de \
--cc=ehabkost@redhat.com \
--cc=huaitong.han@intel.com \
--cc=kvm@vger.kernel.org \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).