From patchwork Tue Feb 9 20:01: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: 8265471 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 319AFBEEED for ; Tue, 9 Feb 2016 20:04:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6BCC920268 for ; Tue, 9 Feb 2016 20:04:48 +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 9B2D82022A for ; Tue, 9 Feb 2016 20:04:47 +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 1aTEU0-0001cU-4n; Tue, 09 Feb 2016 20:01:56 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aTETx-0001bp-Ox for xen-devel@lists.xen.org; Tue, 09 Feb 2016 20:01:53 +0000 Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id 92/1D-25435-1B54AB65; Tue, 09 Feb 2016 20:01:53 +0000 X-Env-Sender: prvs=8403a2554=Andrew.Cooper3@citrix.com X-Msg-Ref: server-6.tower-27.messagelabs.com!1455048110!22676647!2 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 9097 invoked from network); 9 Feb 2016 20:01:52 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-6.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 9 Feb 2016 20:01:52 -0000 X-IronPort-AV: E=Sophos;i="5.22,422,1449532800"; d="scan'208";a="337115294" From: Andrew Cooper To: Xen-devel Date: Tue, 9 Feb 2016 20:01:43 +0000 Message-ID: <1455048108-5045-4-git-send-email-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1455048108-5045-1-git-send-email-andrew.cooper3@citrix.com> References: <1455048108-5045-1-git-send-email-andrew.cooper3@citrix.com> MIME-Version: 1.0 X-DLP: MIA1 Cc: Andrew Cooper , Jan Beulich Subject: [Xen-devel] [PATCH 3/8] xen/x86: Remove %z modifier from inline assembly 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 Clang doesn't support the %z modifier. Replace both uses with an explicit l suffix, and cover the changes with BUILD_BUG_ON()s Signed-off-by: Andrew Cooper Acked-by: Jan Beulich --- CC: Jan Beulich --- xen/arch/x86/xstate.c | 3 ++- xen/include/asm-x86/spinlock.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/xstate.c b/xen/arch/x86/xstate.c index c5d17ff..4f2fb8e 100644 --- a/xen/arch/x86/xstate.c +++ b/xen/arch/x86/xstate.c @@ -353,11 +353,12 @@ void xrstor(struct vcpu *v, uint64_t mask) { switch ( __builtin_expect(ptr->fpu_sse.x[FPU_WORD_SIZE_OFFSET], 8) ) { + BUILD_BUG_ON(sizeof(faults) != 4); /* Clang doesn't support %z in asm. */ #define XRSTOR(pfx) \ alternative_io("1: .byte " pfx "0x0f,0xae,0x2f\n" \ "3:\n" \ " .section .fixup,\"ax\"\n" \ - "2: inc%z[faults] %[faults]\n" \ + "2: incl %[faults]\n" \ " jmp 3b\n" \ " .previous\n" \ _ASM_EXTABLE(1b, 2b), \ diff --git a/xen/include/asm-x86/spinlock.h b/xen/include/asm-x86/spinlock.h index 70a85af..be72c0f 100644 --- a/xen/include/asm-x86/spinlock.h +++ b/xen/include/asm-x86/spinlock.h @@ -2,7 +2,8 @@ #define __ASM_SPINLOCK_H #define _raw_read_unlock(l) \ - asm volatile ( "lock; dec%z0 %0" : "+m" ((l)->lock) :: "memory" ) + BUILD_BUG_ON(sizeof((l)->lock) != 4); /* Clang doesn't support %z in asm. */ \ + asm volatile ( "lock; decl %0" : "+m" ((l)->lock) :: "memory" ) /* * On x86 the only reordering is of reads with older writes. In the