Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp658935pxv; Thu, 15 Jul 2021 12:43:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzk1eUT/xhUH40EEO81pQHjHHakQrwEGtSbJrBTArzDmYepUiGP1Wgg3IKpjCC1uu42/rRT X-Received: by 2002:a17:907:f98:: with SMTP id kb24mr7224105ejc.554.1626378194712; Thu, 15 Jul 2021 12:43:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626378194; cv=none; d=google.com; s=arc-20160816; b=nMDtuq/Hcq3AXz8hhakHQJJk9uD62Ep8+Q7JvbMGc0YSvBZ4Xkk1z6/oDzVqtCF3pj /HAh6hygQFhZmcKAO1g6UQN0EHFdIwgV1rYNgInXAbz6+8WzQawLUkRzmuFEI9sWzTp8 su/3Rd7RGImQehmH45zhaUCNn4h9unFqbP2D94gTYshmk3NyJ4dxJbjzsVHwEpbNhEQZ w8YFzh1vDfIaupwdRNfgOA0ZAWAbzWcR+SD9sfaMuhnem0KoPRUl2sJimQEIdaKVVwXZ gBsAvo6vW3hE/ag+AYXyM6nJAgL7sPGoSfaIYUWAcKP0KsEOnZ3lUMM58xJxsQIsmpVe +/ow== 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=iwzkb3Li2m2Dihpo01Nl1KUlqNxBG0ALF+s9E/Xob6Y=; b=GR62ew2rxuA7E4n4PJmhaiMyc5QJCoIgufF+K+WrDwbrZa7O03anOslCAWoL6D918S TGx0UpHzn5xdVqyAU1V54UXXM7XOfS9t5HmqsrFjy30zvDhnltInmmWpDoWkHkeu4cDu nx/9gbWNO1KDvioHL3LqMkDLbAvE9zXDBsKwDsgyCsqqep8mOG687xJeuVRJQrN9REnf cT8C5tolV0tbEremn9QBvUTPIXEtgYfCaEP7iZ6bK3AJjkD920bkmk1W0TMkRYhgAmPq KadWrxFJY/8Pt53CpZXb3SG379hUZ9/yNYsqo3iMk2rrzIN5C1zn/hPOJmB7uK4KUTCD LLng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=K3Sdxd53; 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 mj21si7533386ejb.25.2021.07.15.12.42.51; Thu, 15 Jul 2021 12:43:14 -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=K3Sdxd53; 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 S1345145AbhGOTkq (ORCPT + 99 others); Thu, 15 Jul 2021 15:40:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:50730 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244507AbhGOTOx (ORCPT ); Thu, 15 Jul 2021 15:14:53 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6D85D613DC; Thu, 15 Jul 2021 19:10:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626376231; bh=WnfKwdefcVhKmY+SMQ457/yqAt2i1E6NF6MSh8EUvak=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=K3Sdxd53iHozsYfnZNxj2O5dsCdjsDeGSNfSTzWek1/fpPO73YVi1YUoPz/Tq6hIh Grikva6rannPB2RnZGM8PSgo4ZJDr6nRu59w4KxhbGNIMJComogJUlDyrK1ycuhjvb Z7OjX+UvlGsWrXEkEXVodNZmiRrw3Nznszct8j0s= 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 5.13 183/266] powerpc/barrier: Avoid collision with clangs __lwsync macro Date: Thu, 15 Jul 2021 20:38:58 +0200 Message-Id: <20210715182643.787593930@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182613.933608881@linuxfoundation.org> References: <20210715182613.933608881@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 @@ -46,6 +46,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")