All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH] x86: Fix build following c/s 623c720f "x86: use CLFLUSHOPT when available"
Date: Fri, 12 Feb 2016 09:47:16 +0000	[thread overview]
Message-ID: <56BDAA24.5050404@citrix.com> (raw)
In-Reply-To: <56BDA24402000078000D1453@prv-mh.provo.novell.com>

On 12/02/16 08:13, Jan Beulich wrote:
>>>> On 11.02.16 at 20:41, <andrew.cooper3@citrix.com> wrote:
>> On 11/02/16 19:25, Andrew Cooper wrote:
>>> --- a/xen/arch/x86/flushtlb.c
>>> +++ b/xen/arch/x86/flushtlb.c
>>> @@ -141,10 +141,10 @@ void flush_area_local(const void *va, unsigned int flags)
>>>          {
>>>              alternative(ASM_NOP3, "sfence", X86_FEATURE_CLFLUSHOPT);
>>>              for ( i = 0; i < sz; i += c->x86_clflush_size )
>>> -                 alternative_input("rex clflush %0",
>>> -                                   "data16 clflush %0",
>>> -                                   X86_FEATURE_CLFLUSHOPT,
>>> -                                   "m" (((const char *)va)[i]));
>>> +                alternative_input(".byte 0x3e; clflush %0", /* %ds override. */
>>> +                                  "data16 clflush %0",      /* clflushopt.  
>>  */
>>> +                                  X86_FEATURE_CLFLUSHOPT,
>>> +                                  "m" (((const char *)va)[i]));
>>>          }
>>>          else
>>>          {
>> It turns out that Clang is far more useful at diagnosing this issue than
>> GCC.
>>
>> flushtlb.c:144:18: error: invalid instruction mnemonic 'rex'
>>                  alternative_input("rex clflush %0",
>>                  ^
> Except that 'rex' is by no means invalid. If anything Clang's internal
> assembler doesn't support it (and hence is not gas compatible).

That is tangential to the point.  The useful part is the end message:

> <inline asm>:2:2: note: instantiated into assembly here
>         rex clflush (%r15,%rdx)
>         ^~~~~~~~~~~~~~~~~~~~~~~

which makes it substantially more clear that there is both a REX prefix
and REX.B required.

~Andrew

  reply	other threads:[~2016-02-12  9:47 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-11 19:25 [PATCH] x86: Fix build following c/s 623c720f "x86: use CLFLUSHOPT when available" Andrew Cooper
2016-02-11 19:41 ` Andrew Cooper
2016-02-12  8:13   ` Jan Beulich
2016-02-12  9:47     ` Andrew Cooper [this message]
2016-02-11 22:14 ` Doug Goldstein
2016-02-12  8:23 ` Jan Beulich
2016-02-12  9:51   ` Andrew Cooper
2016-02-12 10:00     ` Jan Beulich
2016-02-12 10:02       ` Andrew Cooper
2016-02-12 10:12         ` Jan Beulich
2016-02-12 10:50           ` Andrew Cooper
2016-02-12 10:57             ` Jan Beulich
2016-02-12 11:05               ` Andrew Cooper

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=56BDAA24.5050404@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.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.