From patchwork Sun Nov 1 17:31:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Sankar X-Patchwork-Id: 11872309 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B6AAA139F 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 6F44A20874 for ; Sun, 1 Nov 2020 17:31:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6F44A20874 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) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 744C56B0072; Sun, 1 Nov 2020 12:31:10 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org 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-Original-To: linux-mm@kvack.org 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-Spam-Summary: 1,0,0,ead8efb9b211b5ed,d41d8cd98f00b204,niveditas98@gmail.com,,RULES_HIT:41:355:379:541:800:960:967:973:988:989:1260:1311:1314:1345:1359:1437:1515:1534:1542:1711:1730:1747:1777:1792:2194:2199:2393:2525:2553:2559:2563:2682:2685:2859:2902:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3353:3865:3866:3867:3868:3871:3872:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4250:4321:4605:5007:6119:6261:7875:7903:8660:9025:10004:11026:11473:11658:11914:12043:12296:12297:12438:12517:12519:12555:12679:12895:12986:13148:13221:13229:13230:13894:14096:14181:14394:14721:21080:21444:21451:21627:21749:21811:21939:30003:30054:30064:30090,0,RBL:209.85.222.196:@gmail.com:.lbl8.mailshell.net-62.18.0.100 66.100.201.100;04yrbfcc59hfximocbp5fo1h9ywezoc648ei77ps75y3754kz79xxazgsqp7qfo.xknn96daqwex17kro1i7ajands87c34hbrbix9eane3xfzqsejswpqog71wawug.4-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bul k,SPF:fp 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 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.com/ 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-clang.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 +/* The following are for compatibility with GCC, from compiler-gcc.h, + * and may be redefined here because they should not be shared with other + * 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 +/* 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, /* Optimization barrier */ #ifndef barrier -/* The "volatile" is due to gcc bugs */ -# define barrier() __asm__ __volatile__("": : :"memory") +# define barrier() __memory_barrier() #endif #ifndef barrier_data