All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Shuai Ruan <shuai.ruan@linux.intel.com>
Cc: andrew.cooper3@citrix.com, keir@xen.org, xen-devel@lists.xen.org
Subject: Re: [PATCH 2/2] x86/xsave: use alternative asm on xsave side.
Date: Wed, 03 Feb 2016 04:40:16 -0700	[thread overview]
Message-ID: <56B1F53002000078000CDF17@prv-mh.provo.novell.com> (raw)
In-Reply-To: <1454397064-29268-3-git-send-email-shuai.ruan@linux.intel.com>

>>> On 02.02.16 at 08:11, <shuai.ruan@linux.intel.com> wrote:
> --- a/xen/arch/x86/xstate.c
> +++ b/xen/arch/x86/xstate.c
> @@ -248,24 +248,26 @@ void xsave(struct vcpu *v, uint64_t mask)
>      uint32_t hmask = mask >> 32;
>      uint32_t lmask = mask;
>      int word_size = mask & XSTATE_FP ? (cpu_has_fpu_sel ? 8 : 0) : -1;
> +#define XSAVE(pfx) \
> +        alternative_io_3(".byte " pfx "0x0f,0xae,0x27\n", \
> +                         ".byte " pfx "0x0f,0xae,0x37\n", \
> +                         X86_FEATURE_XSAVEOPT, \
> +                         ".byte " pfx "0x0f,0xc7,0x27\n", \
> +                         X86_FEATURE_XSAVEC, \
> +                         ".byte " pfx "0x0f,0xc7,0x37\n", \
> +                         X86_FEATURE_XSAVES, \
> +                         "=m" (*ptr), \
> +                         "a" (lmask), "d" (hmask), "D" (ptr))
>  
>      if ( word_size <= 0 || !is_pv_32bit_vcpu(v) )
>      {
>          typeof(ptr->fpu_sse.fip.sel) fcs = ptr->fpu_sse.fip.sel;
>          typeof(ptr->fpu_sse.fdp.sel) fds = ptr->fpu_sse.fdp.sel;
>  
> -        if ( cpu_has_xsaves )
> -            asm volatile ( ".byte 0x48,0x0f,0xc7,0x2f"
> -                           : "=m" (*ptr)
> -                           : "a" (lmask), "d" (hmask), "D" (ptr) );
> -        else if ( cpu_has_xsavec )
> -            asm volatile ( ".byte 0x48,0x0f,0xc7,0x27"
> -                           : "=m" (*ptr)
> -                           : "a" (lmask), "d" (hmask), "D" (ptr) );
> -        else if ( cpu_has_xsaveopt )
> +        if ( cpu_has_xsaveopt || cpu_has_xsaves )
>          {
>              /*
> -             * xsaveopt may not write the FPU portion even when the respective
> +             * xsaveopt/xsaves may not write the FPU portion even when the respective

Apart from this line now being too long and hence the entire
comment needing re-formatting
Reviewed-by: Jan Beulich <jbeulich@suse.com>

Jan

  reply	other threads:[~2016-02-03 11:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-02  7:11 [PATCH 0/2] use alternative asm on xsave side Shuai Ruan
2016-02-02  7:11 ` [PATCH 1/2] x86: add alternavive_io_2/3 to support alternative with 2/3 features Shuai Ruan
2016-02-02  7:11 ` [PATCH 2/2] x86/xsave: use alternative asm on xsave side Shuai Ruan
2016-02-03 11:40   ` Jan Beulich [this message]
2016-02-03 12:08     ` Jan Beulich

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=56B1F53002000078000CDF17@prv-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=keir@xen.org \
    --cc=shuai.ruan@linux.intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.