From patchwork Thu Feb 11 19:25:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 8284771 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 63874BEEE5 for ; Thu, 11 Feb 2016 19:29:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6C0F9202FE for ; Thu, 11 Feb 2016 19:29:13 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [50.57.142.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8F27120260 for ; Thu, 11 Feb 2016 19:29:12 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aTws8-0001en-Kh; Thu, 11 Feb 2016 19:25:48 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aTws7-0001ei-Sr for xen-devel@lists.xen.org; Thu, 11 Feb 2016 19:25:47 +0000 Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id 97/A6-29478-B30ECB65; Thu, 11 Feb 2016 19:25:47 +0000 X-Env-Sender: prvs=84296f867=Andrew.Cooper3@citrix.com X-Msg-Ref: server-16.tower-206.messagelabs.com!1455218745!21541718!1 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 42698 invoked from network); 11 Feb 2016 19:25:46 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-16.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 11 Feb 2016 19:25:46 -0000 X-IronPort-AV: E=Sophos;i="5.22,432,1449532800"; d="scan'208";a="331173198" From: Andrew Cooper To: Xen-devel Date: Thu, 11 Feb 2016 19:25:43 +0000 Message-ID: <1455218743-12751-1-git-send-email-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 X-DLP: MIA1 Cc: Andrew Cooper , Jan Beulich Subject: [Xen-devel] [PATCH] x86: Fix build following c/s 623c720f "x86: use CLFLUSHOPT when available" X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP CentOS 7 gets into trouble when compiling Xen citing: flushtlb.c: Assembler messages: flushtlb.c:149: Error: value of 256 too large for field of 1 bytes at 1 The line number is wrong, and the error message not helpful. It turns out that the intermediate generated assembly was # 139 "arch/x86/flushtlb.c" 1 661: rex clflush (%r15) 662: .pushsection .altinstructions,"a" and it was having trouble combining the explicit REX prefix with the REX.B required for the use of %r15. Follow what Linux does and use a redundant %ds prefix instead, for a final generated instruction of `3e 41 0f ae 3f` While modifying this line, fix the indentation which was out by one space. Signed-off-by: Andrew Cooper Tested-by: Doug Goldstein --- CC: Jan Beulich --- xen/arch/x86/flushtlb.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xen/arch/x86/flushtlb.c b/xen/arch/x86/flushtlb.c index 90a004f..727434e 100644 --- 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 {