Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp779915ybz; Wed, 15 Apr 2020 18:53:54 -0700 (PDT) X-Google-Smtp-Source: APiQypJBMhSuWwzv0RWDg7LzCN+8rJqIHvFY0sLjpSc27VpFUmuLKM8RwHrDRh+IXkmaz/PIWtDY X-Received: by 2002:a17:906:2410:: with SMTP id z16mr7628004eja.1.1587002034708; Wed, 15 Apr 2020 18:53:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587002034; cv=none; d=google.com; s=arc-20160816; b=rUFf3a1NlHKbvT/5ROFx4ZECqL+p50jj3GDSec6CSz8F1fIS8opaaH/j/qlGeCom1s HwqV00eEWehj5qSQymfXbc1t2q98Wm4gaFrHLoed1iwaYrobra+2t+5YSTkyD3XORx3V hR4iV9kb6ptXL+oF9As311CYxmJIxrf9Bo6TB90dvxI065w+Hj3RX86f/1/onpzlaLZf PtroNRh6bg0mUN9kRhKsuyJtN35VhMWeoPg9MK4qTuAM90gRUEQXxr+wTn62Ur/Tfs1t p/MpdyGWp5EgHuD5DqqFD+Vq6fqwvf0d3nEzH2ZBYtDAMLtHrwGiUGbSeaMmKtKuvWpb vA1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature:dkim-filter; bh=TGORWEVV9JU/a8b7dPxPrCBb0+qo0qmf1iyasgy2yYM=; b=vIA6+iCCFb08WhA45ZBM8bHE5phpV8udwdgJIL01mda7uVf9rx295i+tFP3j9O87/b 9kHGFyu86wfHR54/Eyva1i8xII96XKLY1RTsR4HulXx1bQUiEaT0CPduGmz1v29UncwY yiEyPnu1uxv65nKSFxahlFbpp0cqhx9WwA1FIAxST9s/pK3tAC6H2axOiDDOnlKFPx3N qhPjicEqVSrT+yt+Vr1yLieN0j8mtFkmYqMpmoI4WOu7d9hDasTIAWSmEA2QthDgxVoD VK6gP52/1ENa1EK4fjSXjREfxoHd/pd+t39gZ0VgW2tbixPv3GrkYidnzWh5JvzAFcQV m+Fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=fmvusO6Z; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n15si10970044ejk.225.2020.04.15.18.53.31; Wed, 15 Apr 2020 18:53:54 -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=@nifty.com header.s=dec2015msa header.b=fmvusO6Z; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2410866AbgDORVh (ORCPT + 99 others); Wed, 15 Apr 2020 13:21:37 -0400 Received: from conssluserg-01.nifty.com ([210.131.2.80]:16887 "EHLO conssluserg-01.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2410844AbgDORV3 (ORCPT ); Wed, 15 Apr 2020 13:21:29 -0400 Received: from mail-vs1-f42.google.com (mail-vs1-f42.google.com [209.85.217.42]) (authenticated) by conssluserg-01.nifty.com with ESMTP id 03FHKijl024678; Thu, 16 Apr 2020 02:20:44 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-01.nifty.com 03FHKijl024678 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1586971245; bh=TGORWEVV9JU/a8b7dPxPrCBb0+qo0qmf1iyasgy2yYM=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=fmvusO6ZeNrZor8/By+628dDxGrOMFdo1ogCH4r8MTOI3jUCrZ7zGhUqaYJTXw4BP Z+YTt07uUCQLMVGq50OKCfn/n+NR7tvK8YEZtappPGHnfY5e01oa4idtWmIZogw+0V /tuTwTT7bqFPxyVJWT6SRPsqjGyO+snZP11NfN8eSPJ8RL/8g/K8iltTDtsn0YsgKI ImFVn+koPmZfvrCat+Th+M5ri12+crKktE5TEtJnPTtGM4tTp38HH4vwdb3DNQBymz p6C7e5MCmHS0ihk5uDkIMIJV5h8bH7qfs6CoCmxqPgjhnWjlSZug1+j4/a/16fcYHP wbeQfXri7ZhNA== X-Nifty-SrcIP: [209.85.217.42] Received: by mail-vs1-f42.google.com with SMTP id g184so386593vsc.0; Wed, 15 Apr 2020 10:20:44 -0700 (PDT) X-Gm-Message-State: AGi0PuZuEDeD9+9tiE1ELC+ZmX3jhFDJmmL6TeZuwTk+6BTd6x/Xcxib lrvOTeJyoz6eaoviSofKviu/OCioV0ib39R1Lzk= X-Received: by 2002:a05:6102:2007:: with SMTP id p7mr5485487vsr.181.1586971243575; Wed, 15 Apr 2020 10:20:43 -0700 (PDT) MIME-Version: 1.0 References: <20200415165218.20251-1-will@kernel.org> <20200415165218.20251-2-will@kernel.org> In-Reply-To: <20200415165218.20251-2-will@kernel.org> From: Masahiro Yamada Date: Thu, 16 Apr 2020 02:20:07 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 01/12] compiler/gcc: Emit build-time warning for GCC prior to version 4.8 To: Will Deacon Cc: Linux Kernel Mailing List , linux-arch , "Cc: Android Kernel" , Michael Ellerman , Peter Zijlstra , Linus Torvalds , Segher Boessenkool , Christian Borntraeger , Luc Van Oostenryck , Arnd Bergmann , Peter Oberparleiter , Nick Desaulniers Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 16, 2020 at 1:52 AM Will Deacon wrote: > > Prior to version 4.8, GCC may miscompile READ_ONCE() by erroneously > discarding the 'volatile' qualifier: > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58145 > > We've been working around this using some nasty hacks which make > READ_ONCE() both horribly complicated and also prevent us from enforcing > that it is only used on scalar types. Since GCC 4.8 is pretty old for > kernel builds now, emit a warning if we detect it during the build. This patch is unneeded since you will remove GCC 4.8 support in 11/12. Please move 11/12 to the head of this series, and remove all noise changes. Thanks. > Suggested-by: Linus Torvalds > Cc: Peter Zijlstra > Cc: Michael Ellerman > Cc: Arnd Bergmann > Cc: Christian Borntraeger > Cc: Masahiro Yamada > Signed-off-by: Will Deacon > --- > init/Kconfig | 4 ++-- > scripts/Kconfig.include | 9 +++++++++ > 2 files changed, 11 insertions(+), 2 deletions(-) > > diff --git a/init/Kconfig b/init/Kconfig > index 9e22ee8fbd75..816b8b4a5e9e 100644 > --- a/init/Kconfig > +++ b/init/Kconfig > @@ -9,11 +9,11 @@ config DEFCONFIG_LIST > default "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)" > > config CC_IS_GCC > - def_bool $(success,$(CC) --version | head -n 1 | grep -q gcc) > + def_bool $(cc-is-gcc) > > config GCC_VERSION > int > - default $(shell,$(srctree)/scripts/gcc-version.sh $(CC)) if CC_IS_GCC > + default $(gcc-version) if CC_IS_GCC > default 0 > > config LD_VERSION > diff --git a/scripts/Kconfig.include b/scripts/Kconfig.include > index c264da2b9b30..5261e9d6b50b 100644 > --- a/scripts/Kconfig.include > +++ b/scripts/Kconfig.include > @@ -54,3 +54,12 @@ $(error-if,$(success, $(LD) -v | grep -q gold), gold linker '$(LD)' not supporte > cc-option-bit = $(if-success,$(CC) -Werror $(1) -E -x c /dev/null -o /dev/null,$(1)) > m32-flag := $(cc-option-bit,-m32) > m64-flag := $(cc-option-bit,-m64) > + > +# gcc version including patch level > +gcc-version := $(shell,$(srctree)/scripts/gcc-version.sh $(CC)) > + > +# Return y if the compiler is GCC, n otherwise > +cc-is-gcc := $(success,$(CC) --version | head -n 1 | grep -q gcc) > + > +# Warn if the compiler is GCC prior to 4.8 > +$(warning-if,$(if-success,[ $(gcc-version) -lt 40800 ],$(cc-is-gcc),n),"Your compiler is old and may miscompile the kernel due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58145 - please upgrade it.") > -- > 2.26.0.110.g2183baf09c-goog > -- Best Regards Masahiro Yamada