Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4159260pxv; Mon, 19 Jul 2021 18:49:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwuMnKVQmNSWbIgN7kpXl2TRzbSKK3OipGqkc51fHZ9jSZXhRapLUH4a4WscxgabVf9n0sW X-Received: by 2002:a17:906:55cd:: with SMTP id z13mr28883270ejp.99.1626745768375; Mon, 19 Jul 2021 18:49:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626745768; cv=none; d=google.com; s=arc-20160816; b=TL0ME6e3ktTbJHpVzMdwWOQI2pf+5Jf2t4rsAsoXEW2tddrIL1FqaS2tuMDLBLMZQO uYvsYVTTsWfFqPG8euWmBVHRvE/NyxMWOfKYrA7Mdd2IEiNc8N7wapyJVqUZsnoB5Ph5 /yaHQXeOTnBV2f2NeMudvwDedEi6gRsS4z9dkKHmlPlzLVgNtPPMR56j3fRHI+KDLXS6 G8svz2DaUjVMbz86M1MvnjBad7tl3lG4b8RSGHtunco9TLy6iUd7l5fTDfDO4eK/Qfs4 hg5jNRAe1pbZyDoWJ9BhH5gYlaOhfB2bXXNozREAnZE7Q1v6NQdNhL27TDgImznOihLz 19QA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=dWVubguch7IY6Sd9VcECEJg/jakToJD/oRpMzlEkhGI=; b=vq/w3+KnnAX8O7Qf0/cM9Qd2n/xWaXApGDfCnQQDkjVHftEY0u/b3t8prZiQSxritI F3BjFltaPZQOIjNoRyZK06hgsJWykT7tKrXHfDTS4mLVtkBX7QCdGFxVoSGUHmE0+PUw 994t+O2LiZJ7FrvBfQQnNdl79uuI+QZfGyN4nLc8ymR96FUFNuL+sZjo34Bjn5VHPNL8 fiMNG7LkZXlYIyDRZ9/iChbfrW2SoFAZ7uSD6h6q0Amxd9FlAhk+yUqSN+5zqzTSH25e Ur6ZB/FLvFx4g1sQJrdL/OIrN6mSoeuv2AZIWAMg3AbvOxpZ/PYcvCsU6nXdljtvrdaH No6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YwLLc7cp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qa18si22629609ejc.491.2021.07.19.18.49.06; Mon, 19 Jul 2021 18:49:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YwLLc7cp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345642AbhGSPJa (ORCPT + 99 others); Mon, 19 Jul 2021 11:09:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:60724 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237772AbhGSOoY (ORCPT ); Mon, 19 Jul 2021 10:44:24 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5A9E76128E; Mon, 19 Jul 2021 15:22:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626708165; bh=aFsUVaC5yWClsBlgSlvKGh2SHyPxxgiWPz3InVNf2CQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YwLLc7cppg3IJssucWmWbn8e0Or9vdjIojM1lS9xMjVGz9/Uqra/drxmdqlCAvgD+ jfWg7sOfV4YKtm91WF0LOnVA3+oLmUrjI6OvenjdR52ZaY6rRodD8It23/JJ6W9B7h pkGdLjWovA/mZzoiX8i8gAonO1ocGRsmpSgPWl60= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nathan Chancellor , Nick Desaulniers , Michael Ellerman Subject: [PATCH 4.14 206/315] powerpc/barrier: Avoid collision with clangs __lwsync macro Date: Mon, 19 Jul 2021 16:51:35 +0200 Message-Id: <20210719144950.203863297@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210719144942.861561397@linuxfoundation.org> References: <20210719144942.861561397@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nathan Chancellor commit 015d98149b326e0f1f02e44413112ca8b4330543 upstream. A change in clang 13 results in the __lwsync macro being defined as __builtin_ppc_lwsync, which emits 'lwsync' or 'msync' depending on what the target supports. This breaks the build because of -Werror in arch/powerpc, along with thousands of warnings: In file included from arch/powerpc/kernel/pmc.c:12: In file included from include/linux/bug.h:5: In file included from arch/powerpc/include/asm/bug.h:109: In file included from include/asm-generic/bug.h:20: In file included from include/linux/kernel.h:12: In file included from include/linux/bitops.h:32: In file included from arch/powerpc/include/asm/bitops.h:62: arch/powerpc/include/asm/barrier.h:49:9: error: '__lwsync' macro redefined [-Werror,-Wmacro-redefined] #define __lwsync() __asm__ __volatile__ (stringify_in_c(LWSYNC) : : :"memory") ^ :308:9: note: previous definition is here #define __lwsync __builtin_ppc_lwsync ^ 1 error generated. Undefine this macro so that the runtime patching introduced by commit 2d1b2027626d ("powerpc: Fixup lwsync at runtime") continues to work properly with clang and the build no longer breaks. Cc: stable@vger.kernel.org Signed-off-by: Nathan Chancellor Reviewed-by: Nick Desaulniers Signed-off-by: Michael Ellerman Link: https://github.com/ClangBuiltLinux/linux/issues/1386 Link: https://github.com/llvm/llvm-project/commit/62b5df7fe2b3fda1772befeda15598fbef96a614 Link: https://lore.kernel.org/r/20210528182752.1852002-1-nathan@kernel.org Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/include/asm/barrier.h | 2 ++ 1 file changed, 2 insertions(+) --- a/arch/powerpc/include/asm/barrier.h +++ b/arch/powerpc/include/asm/barrier.h @@ -42,6 +42,8 @@ # define SMPWMB eieio #endif +/* clang defines this macro for a builtin, which will not work with runtime patching */ +#undef __lwsync #define __lwsync() __asm__ __volatile__ (stringify_in_c(LWSYNC) : : :"memory") #define dma_rmb() __lwsync() #define dma_wmb() __asm__ __volatile__ (stringify_in_c(SMPWMB) : : :"memory")