Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3264598pxb; Mon, 16 Nov 2020 09:49:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJx3h/nN1Q21WFalZZtNMCsTigieM7NayApPZWRn6VR4R+k+zp4lgQAG2B3ZDUgxG6WF6Rp3 X-Received: by 2002:a05:6402:8cc:: with SMTP id d12mr16999114edz.134.1605548998960; Mon, 16 Nov 2020 09:49:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605548998; cv=none; d=google.com; s=arc-20160816; b=vZmsHNQE0oq5Ij5LYbH/QeksDFqETFSU64dhkqFwKY/Dxr3aC2Y7i9MWL+CmkYhnJ0 bn0+LH0hndZ1+pyrgccqsmTR0KLBx6FDVzEjB6U4fSFYvSfZf4if+3OAxkAkx8tzY6In eiXPhFWLhykwCCL8YoKVLNY8zfGQZmlELl72lFeSVXvMI9eeLlhSI3e5VG95Fk81lStT 0fzfqs0Y+pkSBcqlSiLIyT6OUDlxV3B3slEoIYbsntzwUCBi+xpaLs/8rf6nQLarr2Dz DMt/F24hwwTV8vOttaUBX/gEyqk+EqlfUeUCTm7zDQaXFBBCKPKHQQqnA5w3sUObKLvj bx0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from; bh=OiiUQaM2bYfHqobx2mMOU17o8AjbbiVsNUB/GdzyHa0=; b=nNsU93cVTvvtK5AMOGF4DZjlinN+plhw0Q4LVnoIxFlD5lByiPPTxixFhS53ep8SgM x++44imPQVgatjIE7SrqaSs+49b7MOIibK7NG1VxNE68F6k89eLPAFlY9AJ6fE3xiHX1 ZDy3nc86rdmm8iKn7YJxTCKe8czXjaw83efS/aOjzmi1TlSO9xV+yy5MGVK+NSSfVtIZ I+U99VLkxF4YbNL+JhH+vRkxVmeB5gDrixNne3ZMIpH3o2icP/ll0RUbl5BD8SC/kV4h yehlaMydI50mO1WTiXUAVcGYsuujBYppeQJn98nl1Hfmvk6Vtz8U9aOaVK1HPbzappP5 QWqg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r9si11976558ejo.134.2020.11.16.09.49.35; Mon, 16 Nov 2020 09:49:58 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387815AbgKPRr3 (ORCPT + 99 others); Mon, 16 Nov 2020 12:47:29 -0500 Received: from mail-out.m-online.net ([212.18.0.10]:40440 "EHLO mail-out.m-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730657AbgKPRr2 (ORCPT ); Mon, 16 Nov 2020 12:47:28 -0500 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4CZc3K30kTz1rx7x; Mon, 16 Nov 2020 18:47:25 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4CZc3K26fdz1qtZ6; Mon, 16 Nov 2020 18:47:25 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id Fcuw266vvLxM; Mon, 16 Nov 2020 18:47:24 +0100 (CET) X-Auth-Info: wxbQwUFoWhqFj8s7Vg1V6Cvh2UMn555Uc46N/96aYxMCH5Z0HHAeNhVd/Wcn8Qne Received: from igel.home (ppp-46-244-169-244.dynamic.mnet-online.de [46.244.169.244]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Mon, 16 Nov 2020 18:47:24 +0100 (CET) Received: by igel.home (Postfix, from userid 1000) id C6D3B2C3328; Mon, 16 Nov 2020 18:47:23 +0100 (CET) From: Andreas Schwab To: Arvind Sankar Cc: Nathan Chancellor , Nick Desaulniers , clang-built-linux@googlegroups.com, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Subject: Re: [PATCH] compiler.h: Fix barrier_data() on clang References: <20201014212631.207844-1-nivedita@alum.mit.edu> X-Yow: It's the land of DONNY AND MARIE as promised in TV GUIDE! Date: Mon, 16 Nov 2020 18:47:23 +0100 In-Reply-To: <20201014212631.207844-1-nivedita@alum.mit.edu> (Arvind Sankar's message of "Wed, 14 Oct 2020 17:26:31 -0400") Message-ID: <87sg999ot0.fsf@igel.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Okt 14 2020, Arvind Sankar wrote: > Commit > 815f0ddb346c ("include/linux/compiler*.h: make compiler-*.h mutually exclusive") > > neglected to copy barrier_data() from compiler-gcc.h into > compiler-clang.h. The definition in compiler-gcc.h was really to work > around clang's more aggressive optimization, so this broke > barrier_data() on clang, and consequently memzero_explicit() as well. > > For example, this results in at least the memzero_explicit() call in > lib/crypto/sha256.c:sha256_transform() being optimized away by clang. > > Fix this by moving the definition of barrier_data() into compiler.h. > > Also move the gcc/clang definition of barrier() into compiler.h, > __memory_barrier() is icc-specific (and barrier() is already defined > using it in compiler-intel.h) and doesn't belong in compiler.h. > > Signed-off-by: Arvind Sankar > Fixes: 815f0ddb346c ("include/linux/compiler*.h: make compiler-*.h mutually exclusive") This breaks build on riscv: CC [M] drivers/net/ethernet/emulex/benet/be_main.o In file included from ./include/vdso/processor.h:10, from ./arch/riscv/include/asm/processor.h:11, from ./include/linux/prefetch.h:15, from drivers/net/ethernet/emulex/benet/be_main.c:14: ./arch/riscv/include/asm/vdso/processor.h: In function 'cpu_relax': ./arch/riscv/include/asm/vdso/processor.h:14:2: error: implicit declaration of function 'barrier' [-Werror=implicit-function-declaration] 14 | barrier(); | ^~~~~~~ cc1: some warnings being treated as errors make[5]: *** [scripts/Makefile.build:283: drivers/net/ethernet/emulex/benet/be_main.o] Error 1 make[4]: *** [scripts/Makefile.build:500: drivers/net/ethernet/emulex/benet] Error 2 make[3]: *** [scripts/Makefile.build:500: drivers/net/ethernet/emulex] Error 2 make[2]: *** [scripts/Makefile.build:500: drivers/net/ethernet] Error 2 make[1]: *** [scripts/Makefile.build:500: drivers/net] Error 2 make: *** [Makefile:1799: drivers] Error 2 Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."