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: kevin.tian@intel.com, wei.liu2@citrix.com,
	Ian.Campbell@citrix.com, stefano.stabellini@eu.citrix.com,
	andrew.cooper3@citrix.com, ian.jackson@eu.citrix.com,
	xen-devel@lists.xen.org, jun.nakajima@intel.com, keir@xen.org
Subject: Re: [V11 1/3] x86/xsaves: enable xsaves/xrstors/xsavec in xen
Date: Fri, 20 Nov 2015 04:35:00 -0700	[thread overview]
Message-ID: <564F137402000078000B714F@prv-mh.provo.novell.com> (raw)
In-Reply-To: <1447982282-7437-2-git-send-email-shuai.ruan@linux.intel.com>

>>> On 20.11.15 at 02:18, <shuai.ruan@linux.intel.com> wrote:
> @@ -187,36 +363,56 @@ void xrstor(struct vcpu *v, uint64_t mask)
>      switch ( __builtin_expect(ptr->fpu_sse.x[FPU_WORD_SIZE_OFFSET], 8) )
>      {
>      default:
> -        asm volatile ( "1: .byte 0x48,0x0f,0xae,0x2f\n"
> -                       ".section .fixup,\"ax\"      \n"
> -                       "2: mov %5,%%ecx             \n"
> -                       "   xor %1,%1                \n"
> -                       "   rep stosb                \n"
> -                       "   lea %2,%0                \n"
> -                       "   mov %3,%1                \n"
> -                       "   jmp 1b                   \n"
> -                       ".previous                   \n"
> -                       _ASM_EXTABLE(1b, 2b)
> -                       : "+&D" (ptr), "+&a" (lmask)
> -                       : "m" (*ptr), "g" (lmask), "d" (hmask),
> -                         "m" (xsave_cntxt_size)
> -                       : "ecx" );
> +        alternative_io( "1: "".byte 0x48,0x0f,0xae,0x2f \n"
> +                        ".section .fixup,\"ax\"         \n"
> +                        "2: mov %6,%%ecx                \n"
> +                        "   xor %1,%1                   \n"
> +                        "   rep stosb                   \n"
> +                        "   lea %3,%0                   \n"
> +                        "   mov %4,%1                   \n"
> +                        "   jmp 1b                      \n"
> +                        ".previous                      \n"
> +                        _ASM_EXTABLE(1b, 2b),
> +                        ".byte 0x48,0x0f,0xc7,0x1f      \n"
> +                        ".section .fixup,\"ax\"         \n"
> +                        "2: mov %6,%%ecx                \n"
> +                        "   xor %1,%1                   \n"
> +                        "   rep stosb                   \n"
> +                        "   lea %3,%0                   \n"
> +                        "   mov %4,%1                   \n"
> +                        "   jmp 1b                      \n"
> +                        ".previous                      \n"
> +                        _ASM_EXTABLE(1b, 2b),
> +                        X86_FEATURE_XSAVES,
> +                        ASM_OUTPUT2("+&D" (ptr), "+&a" (lmask)),
> +                        "m" (*ptr), "g" (lmask), "d" (hmask), "m" (xsave_cntxt_size)
> +                        : "ecx" );

So I had specifically asked for _not_ altering the indentation (to help
review), but you still modified the whole block. Which, if I hadn't
looked closely, would have hidden the %5 -> %6 and similar other
changes. I realize that's due to the dummy input alternative_io()
inserts. So I see three options for you (in order of my preference):

1) Do the conversion properly, splitting things out into a macro, in
a separate, prereq patch. "Properly" here meaning to convert from
numbered to named operands.

2) Fix alternative_{io,input}() to no longer have the - afaict -
pointless dummy input. The comment says it's for API compatibility,
which we (other than Linux from where it was taken) don't care
about. The only current user of alternative_io() should be unaffected,
as it uses named operands already. (This would again be in a prereq
patch, and the main patch would leave indentation unaltered.)

3) Stay with what you have, but leave the original indentation and
add a comment explaining the apparently odd numbering.

Albeit if 1 or 2 was chosen, 3 would seem to be a good idea anyway.

Jan

  reply	other threads:[~2015-11-20 11:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-20  1:17 [V11 0/3] add xsaves/xrstors support Shuai Ruan
2015-11-20  1:18 ` [V11 1/3] x86/xsaves: enable xsaves/xrstors/xsavec in xen Shuai Ruan
2015-11-20 11:35   ` Jan Beulich [this message]
2015-11-23  5:22     ` Shuai Ruan
     [not found]     ` <20151123052255.GA12378@shuai.ruan@linux.intel.com>
2015-11-23 10:06       ` Jan Beulich
2015-11-23 11:06         ` Shuai Ruan
     [not found]         ` <20151123110624.GA13622@shuai.ruan@linux.intel.com>
2015-11-23 11:24           ` Jan Beulich
2015-11-20  1:18 ` [V11 2/3] x86/xsaves: enable xsaves/xrstors for hvm guest Shuai Ruan
2015-11-20  1:18 ` [V11 3/3] libxc: expose xsaves/xgetbv1/xsavec to " Shuai Ruan

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=564F137402000078000B714F@prv-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jun.nakajima@intel.com \
    --cc=keir@xen.org \
    --cc=kevin.tian@intel.com \
    --cc=shuai.ruan@linux.intel.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=wei.liu2@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 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.