From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4BBAC4742C for ; Sun, 1 Nov 2020 17:31:11 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3875D2080A for ; Sun, 1 Nov 2020 17:31:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3875D2080A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=alum.mit.edu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 78B746B0070; Sun, 1 Nov 2020 12:31:10 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 744C56B0072; Sun, 1 Nov 2020 12:31:10 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 62A686B0080; Sun, 1 Nov 2020 12:31:10 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0176.hostedemail.com [216.40.44.176]) by kanga.kvack.org (Postfix) with ESMTP id 374456B0070 for ; Sun, 1 Nov 2020 12:31:10 -0500 (EST) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 1F879180AD811 for ; Sun, 1 Nov 2020 17:31:08 +0000 (UTC) X-FDA: 77436540216.10.door41_03103f9272a9 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin10.hostedemail.com (Postfix) with ESMTP id F272A16A0DD for ; Sun, 1 Nov 2020 17:31:07 +0000 (UTC) X-HE-Tag: door41_03103f9272a9 X-Filterd-Recvd-Size: 4938 Received: from mail-qk1-f196.google.com (mail-qk1-f196.google.com [209.85.222.196]) by imf34.hostedemail.com (Postfix) with ESMTP for ; Sun, 1 Nov 2020 17:31:07 +0000 (UTC) Received: by mail-qk1-f196.google.com with SMTP id b18so9579980qkc.9 for ; Sun, 01 Nov 2020 09:31:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5TxGQj59r4R36o8V2KKsYZ1N9+Qp4l0BQbumIvYBoMc=; b=cPnPmG0E7bjR/zOycAZX0K+YyLelbcfApFXYvWfywnp1pyGQHpwKDlMyZs6mTdTb4e RhTFV6XwZCAN4IDaAAK0JoGz04cxLEFXZ/9f3d5OtID5Ofih3x1Tw2vNHMjI6UT27/QF dZT90/9Y27y8t/Bkiqi2RmP8ua//IIeeGsI4LhQoaVZH5DAQt2v10tehZUHJuTOxE6oZ JiTpdOmMo2nyRLYuvaB6SnD0UKMbQJ5ZX1jGoDEijpPK9K3PtgUt3477dAG4QQz6/0MS NP8tJc1WpcKmEQJCvDaGLLUmVtn1DWtyprulJmghDq83WfnYLb0tZe+fHpjRseQHsDna vKzA== X-Gm-Message-State: AOAM5308QEsvWj+WGDeJv4XqV65EgQ2cw2ulH8yrMhd2v9JSadXBIO1x 3jQQIFuvt9qIOrcTqBEz8XI= X-Google-Smtp-Source: ABdhPJzQLQ9k/lY1RhAPb/81V0g5gEghldV+tV+7+1mtiyO9ZTBZNL4kvtzpCdSDmnD26O3xxlx+Vg== X-Received: by 2002:ae9:e509:: with SMTP id w9mr11105749qkf.311.1604251866893; Sun, 01 Nov 2020 09:31:06 -0800 (PST) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id t60sm784981qtd.65.2020.11.01.09.31.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Nov 2020 09:31:06 -0800 (PST) From: Arvind Sankar To: kernel test robot , linux-next@vger.kernel.org, Stephen Rothwell Cc: kbuild-all@lists.01.org, Linux Memory Management List , Nick Desaulniers , Kees Cook , Andrew Morton , stable@vger.kernel.org Subject: [PATCH] compiler.h: Move barrier() back into compiler-*.h Date: Sun, 1 Nov 2020 12:31:05 -0500 Message-Id: <20201101173105.1723648-1-nivedita@alum.mit.edu> X-Mailer: git-send-email 2.26.2 In-Reply-To: <202010312104.Dk9VQJYb-lkp@intel.com> References: <202010312104.Dk9VQJYb-lkp@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Commit b9de06783f01 ("compiler.h: fix barrier_data() on clang") moved the definition of barrier() into compiler.h. This causes build failures at least on alpha, because there are files that rely on barrier() being defined via the implicit include of compiler_types.h. Revert this portion of the commit to fix. Link: https://lore.kernel.org/linux-mm/202010312104.Dk9VQJYb-lkp@intel.co= m/ Reported-by: kernel test robot Signed-off-by: Arvind Sankar Fixes: b9de06783f01 ("compiler.h: fix barrier_data() on clang") Cc: --- include/linux/compiler-clang.h | 6 ++++++ include/linux/compiler-gcc.h | 5 +++++ include/linux/compiler.h | 3 +-- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/include/linux/compiler-clang.h b/include/linux/compiler-clan= g.h index dd7233c48bf3..230604e7f057 100644 --- a/include/linux/compiler-clang.h +++ b/include/linux/compiler-clang.h @@ -60,6 +60,12 @@ #define COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW 1 #endif =20 +/* The following are for compatibility with GCC, from compiler-gcc.h, + * and may be redefined here because they should not be shared with othe= r + * compilers, like ICC. + */ +#define barrier() __asm__ __volatile__("" : : : "memory") + #if __has_feature(shadow_call_stack) # define __noscs __attribute__((__no_sanitize__("shadow-call-stack"))) #endif diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index 50912ed00278..a572965c801a 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h @@ -15,6 +15,11 @@ # error Sorry, your version of GCC is too old - please use 4.9 or newer. #endif =20 +/* Optimization barrier */ + +/* The "volatile" is due to gcc bugs */ +#define barrier() __asm__ __volatile__("": : :"memory") + /* * This macro obfuscates arithmetic on a variable address so that gcc * shouldn't recognize the original var, and make assumptions about it. diff --git a/include/linux/compiler.h b/include/linux/compiler.h index b8fe0c23cfff..25c803f4222f 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -80,8 +80,7 @@ void ftrace_likely_update(struct ftrace_likely_data *f,= int val, =20 /* Optimization barrier */ #ifndef barrier -/* The "volatile" is due to gcc bugs */ -# define barrier() __asm__ __volatile__("": : :"memory") +# define barrier() __memory_barrier() #endif =20 #ifndef barrier_data --=20 2.26.2