From patchwork Wed Mar 27 18:45:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 161279 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp6829005jan; Wed, 27 Mar 2019 11:47:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqxjkJD8Gj0vlon4rI7pGVolW1982OZzWTcNNY8mgJioKy/2BwtRk2lD6JRXBCPVItA8ZZgo X-Received: by 2002:a81:3247:: with SMTP id y68mr32076825ywy.359.1553712449561; Wed, 27 Mar 2019 11:47:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553712449; cv=none; d=google.com; s=arc-20160816; b=Ann8TDyoRQaQRB7pIpUHndbnJsjaR+cX2Sy7UztgrXPrNX0INL6v+vjgN9DJlhbGFv EBadEP2Q3y2jrl0n1+Xlv1sayQ92RUz1Ki6K82YW2IBtcsP5tx3liynIrlGvlbrJU63O h29KvicCVoF8MQGgG3iaawcl9iPFcPmqW4Y2mfl29BPtfwGiyJNho5JVfEheRfjkhSkm hCo4AT+YuxWvQot1z+Dv5dL6m16hLfo6i/5tN2sB0ziqi9tfkk00h0yd9LYe4VLUlL2/ RMiSsmoRxrSvTg2ebBkq1wuSvY/EM7nWwF+M6LGcKtSAKxJKmR/SxoMd56c6xL5jadLL RkJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:references:in-reply-to:message-id:date:to:from; bh=BxMe19Z/8r867rsdvcMowl9HUuEpsoEPim08dgmt/cs=; b=JTgYZK7ZrMsugr7GO1u8qSFiJ2X3dMnAC4calvr/9U1ua2UP8nDlOhn2Kfc3mng/yO H86b4N44/68UVYWIpZCooNXZE0ZfTsXdlwz4mvsOI7cDnCV5WmKe5GCW3cqFALpWolK7 UBk6swL5DDMZ07BzbcyRv/AKgFcFo6c0b8nXUxtci/Ux2xEOReqOowpkwhr740mjmfDE SsyecRpqafmk3NwTmEr58LQK+gNrdOCILCUR9HZDoKDYSzqp7aEmZS0whkHCu/b0FrBF /KvOTF4f66YwUl1pNtz3bz4kqt5sm7TXCKD21TdCq/ZLX8pAql7Ga+4cOyC4tgCWPkN4 Xb2g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id w186si12440392ywc.259.2019.03.27.11.47.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 Mar 2019 11:47:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1h9DYo-0001ps-J0; Wed, 27 Mar 2019 18:46:02 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1h9DYn-0001os-C2 for xen-devel@lists.xenproject.org; Wed, 27 Mar 2019 18:46:01 +0000 X-Inumbo-ID: 90a1495a-50c0-11e9-bc90-bc764e045a96 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTP id 90a1495a-50c0-11e9-bc90-bc764e045a96; Wed, 27 Mar 2019 18:46:00 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0B7271596; Wed, 27 Mar 2019 11:46:00 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.196.50]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CC9263F557; Wed, 27 Mar 2019 11:45:58 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Wed, 27 Mar 2019 18:45:31 +0000 Message-Id: <20190327184531.30986-13-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190327184531.30986-1-julien.grall@arm.com> References: <20190327184531.30986-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH 12/12] xen/arm64: __cmpxchg and __cmpxchg_mb should always be inline X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Artem_Mygaiev@epam.com, Oleksandr_Tyshchenko@epam.com, Julien Grall , sstabellini@kernel.org, Andrii_Anisov@epam.com MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Currently __cmpxchg_mb and __cmpxchg are only marked inline. The compiler is free to decide to not honor the inline. This will result to generate code use __bad_cmpxchg and lead a link failure. This was caught by Clang 8.0. Signed-off-by: Julien Grall Reviewed-by: Stefano Stabellini --- xen/include/asm-arm/arm64/cmpxchg.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/xen/include/asm-arm/arm64/cmpxchg.h b/xen/include/asm-arm/arm64/cmpxchg.h index ae42b2f5ff..359271173e 100644 --- a/xen/include/asm-arm/arm64/cmpxchg.h +++ b/xen/include/asm-arm/arm64/cmpxchg.h @@ -63,8 +63,9 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size extern void __bad_cmpxchg(volatile void *ptr, int size); -static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old, - unsigned long new, int size) +static always_inline unsigned long __cmpxchg(volatile void *ptr, + unsigned long old, + unsigned long new, int size) { unsigned long oldval = 0, res; @@ -137,8 +138,9 @@ static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old, return oldval; } -static inline unsigned long __cmpxchg_mb(volatile void *ptr, unsigned long old, - unsigned long new, int size) +static always_inline unsigned long __cmpxchg_mb(volatile void *ptr, + unsigned long old, + unsigned long new, int size) { unsigned long ret;