xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>, Jan Beulich <JBeulich@suse.com>,
	Xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH for-4.7] xen/hvm: Fix advertisment of available xstates following c/s c52319642
Date: Fri, 10 Jun 2016 19:29:05 +0100	[thread overview]
Message-ID: <20160610182904.GM28116@citrix.com> (raw)
In-Reply-To: <1465582663-15317-1-git-send-email-andrew.cooper3@citrix.com>

On Fri, Jun 10, 2016 at 07:17:43PM +0100, Andrew Cooper wrote:
> PKU lives in CPUID.7[0].ECX, not EBX.  This causes hardware with BMI1 to
> accidentally advertise PKU in CPUID.0xD[0].EAX.  Any OS which proceeds to
> blindly write this into %xcr0 takes a #GP fault.  (Experimentally, Windows
> Vista 32bit falls into this category.)
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: Jan Beulich <JBeulich@suse.com>
> CC: Wei Liu <wei.liu2@citrix.com>
> 

Reviewed-by: Wei Liu <wei.liu2@citrix.com>

and

Release-acked-by: Wei Liu <wei.liu2@citrix.com>

> This is all going to be far less error prone when I have guest_has_$FEATURE(v)
> helpers which read the bits out of a flat array...
> ---
>  xen/arch/x86/hvm/hvm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
> index e664b34..78db903 100644
> --- a/xen/arch/x86/hvm/hvm.c
> +++ b/xen/arch/x86/hvm/hvm.c
> @@ -3466,7 +3466,7 @@ void hvm_cpuid(unsigned int input, unsigned int *eax, unsigned int *ebx,
>                                    xstate_sizes[_XSTATE_BNDCSR]);
>              }
>  
> -            if ( _ebx & cpufeat_mask(X86_FEATURE_PKU) )
> +            if ( _ecx & cpufeat_mask(X86_FEATURE_PKU) )
>              {
>                  xfeature_mask |= XSTATE_PKRU;
>                  xstate_size = max(xstate_size,
> -- 
> 2.1.4
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  reply	other threads:[~2016-06-10 18:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-10 18:17 [PATCH for-4.7] xen/hvm: Fix advertisment of available xstates following c/s c52319642 Andrew Cooper
2016-06-10 18:29 ` Wei Liu [this message]
2016-06-13  9:48 ` Jan Beulich
2016-06-13 10:42   ` Wei Liu

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=20160610182904.GM28116@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /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).