From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH] x86: Fix build following c/s 623c720f "x86: use CLFLUSHOPT when available" Date: Fri, 12 Feb 2016 09:47:16 +0000 Message-ID: <56BDAA24.5050404@citrix.com> References: <1455218743-12751-1-git-send-email-andrew.cooper3@citrix.com> <56BCE3E3.8050105@citrix.com> <56BDA24402000078000D1453@prv-mh.provo.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <56BDA24402000078000D1453@prv-mh.provo.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: Xen-devel List-Id: xen-devel@lists.xenproject.org On 12/02/16 08:13, Jan Beulich wrote: >>>> On 11.02.16 at 20:41, 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: > :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