Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp1109611pxa; Fri, 28 Aug 2020 04:07:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXcVzoIe/Y1MCmNpBI29g0hoiGZvhCf7+g2Fu924igbd2QTg+NhV+U4SEijSiZi5aFDnTL X-Received: by 2002:aa7:da03:: with SMTP id r3mr1201992eds.193.1598612839384; Fri, 28 Aug 2020 04:07:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598612839; cv=none; d=google.com; s=arc-20160816; b=XK9weovWZGenEhGa3sVAmPgwgSSBGmbk95qENDhSBCzyX8xc5HaGFkMnqsH2Ki/JXw v6nNWnF+nm/eDSFVGYWRsftxXP88UkexNlsrYcQHCg4lIVRpOnpZME4Jvb0dyywZ6e4X r1ytxZtpA1KwzUDKgEW0B67bAjd1rAZSIGgKVz3ui9KqiY4H+4YuS9J0x1Dmnn42N1kb /jfWTESQCCaeL6sQ76tB4xRFfA10VV0IQlZgBX4FXBX+a3KxvR3d8IYcDlll2Explqzc FzGRvQc7rFEGfevnAiDTL3d3aTCjNrXesjdC8/dTLTnIW1W8cpo9qOqjyym/p1IcFGhI LhEg== 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; bh=fhcvo1n+CsYdI8OH67mOVUpzZUMHRybLogH+vvrmtQs=; b=Fbxz9XJzSW4WcIGF8Mbcv8vpQ3CLFHCfSMPUUBtKqUp3NuhaSyIwwyxv5mNSLgS3XI KiLeDoBry+rc2ntN33gifnccMovDHUKEYGkddbAAZPbcvEAHyUTlavLw2/Yg0Y7knBzC SNBR/kITKX1sguvGGjzU8j4LmrYr2Whrz6TgBlcLtpIL/XJb6mBqHHA0PV/QdhKzi3Y4 JUM7DHXaLb/kpvnVSfq+iSC433VGjoGXE3B3aFGP/e/TaF7evB5lpGJSFqS/fTLHih+8 W1dHnVkuM7ppFxtgzX2VIN3vzVhWwQHNY9hG/lYv3LvU3bxBZJxsuH8FpEUt2Djcawwv Vm+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=FwSk+QOE; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c18si377381ejb.591.2020.08.28.04.06.56; Fri, 28 Aug 2020 04:07:19 -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=@google.com header.s=20161025 header.b=FwSk+QOE; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729191AbgH1LDU (ORCPT + 99 others); Fri, 28 Aug 2020 07:03:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729187AbgH1LBo (ORCPT ); Fri, 28 Aug 2020 07:01:44 -0400 Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 042A3C061234 for ; Fri, 28 Aug 2020 03:54:27 -0700 (PDT) Received: by mail-pf1-x443.google.com with SMTP id t9so468771pfq.8 for ; Fri, 28 Aug 2020 03:54:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=fhcvo1n+CsYdI8OH67mOVUpzZUMHRybLogH+vvrmtQs=; b=FwSk+QOEwpmwMFOoywfLT/+2bJceyMtZXet2C1AMWtwW3s6qZCMu0HjZPeY0DZ1yLk Tg96kygIN8rSOY+i7AiPT+J0042frtmo1SqBqHXKQAwzGOBip7+WoaZymZtzlWiEU55X qodqG9yf4CZsdtUGTG5Sd9fJJtT5A/Pgv/yrGGsZHI7IH676imoYcmoINtfsz6Oocr4o bC4fsuACX6jcuM4oNu0Cd5JAV5lSmby7vAx5pT1YTcGXvvrF0aobHyEJGMfJdZsecmvf lUpLfF1skl6oElBhFVfCNo62Ou82oQfUOX7adtdyJPaSEzIsaOV6OQX+PKUh8pTLTBcX d66g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fhcvo1n+CsYdI8OH67mOVUpzZUMHRybLogH+vvrmtQs=; b=WmG4MzAWpDLYl3dydE7AYab33FDmfhfAk3tKC9nOFcYUp9eA/sTHlDpUi+9v2VMiC/ /MOZ6U0cE+sI0XI6V27wh8ph3dj7n3ICUEjiUVlsA/uYmwMkVqnhRGkNPiELMVrm3F33 cyiV2OlDLidPRQomSNKDf1VyFef4O1N2bGMqFgXz6NAOqXnrB4gX6O361HiDgqoDL69s /bVqntXvJFtd3jdklBNXMObT2dfiWIWyljUrS5x2nWwpajgztwVScUYIjwOHDZHOAd5+ NhL0NK+ZDYSjuPhIcEoYsQOCMaOK++2pJYse0m7pJdlB/TQGA/GE7UTNWHuk9iNOTjFH FFtw== X-Gm-Message-State: AOAM5302ndgcUonvmUq2hX3M0TwwVsxd9aeL2cTKD7eYuQQyUpjDAYDu X2ZKNc2Lo/c/jqbgnPbwOUEIr6D19zP3ShGqLGBKgQ== X-Received: by 2002:aa7:8c0f:: with SMTP id c15mr784835pfd.135.1598612066279; Fri, 28 Aug 2020 03:54:26 -0700 (PDT) MIME-Version: 1.0 References: <20200826201420.3414123-1-ndesaulniers@google.com> <20200826214228.GB1005132@ubuntu-n2-xlarge-x86> <20200827190217.GA3610840@elver.google.com> In-Reply-To: <20200827190217.GA3610840@elver.google.com> From: Andrey Konovalov Date: Fri, 28 Aug 2020 12:54:15 +0200 Message-ID: Subject: Re: [PATCH] compiler-clang: add build check for clang 10.0.1 To: Marco Elver Cc: Nick Desaulniers , Nathan Chancellor , Andrew Morton , Sedat Dilek , Miguel Ojeda , Kees Cook , "Paul E. McKenney" , "Peter Zijlstra (Intel)" , Randy Dunlap , Ingo Molnar , Sami Tolvanen , LKML , clang-built-linux , kasan-dev 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, Aug 27, 2020 at 9:02 PM Marco Elver wrote: > > On Wed, Aug 26, 2020 at 02:42PM -0700, Nathan Chancellor wrote: > > On Wed, Aug 26, 2020 at 01:14:19PM -0700, Nick Desaulniers wrote: > > > During Plumbers 2020, we voted to just support the latest release of > > > Clang for now. Add a compile time check for this. > > > > > > Older clang's may work, but we will likely drop workarounds for older > > > versions. > > > > I think this part of the commit message is a little wishy-washy. If we > > are breaking the build for clang < 10.0.1, we are not saying "may work", > > we are saying "won't work". Because of this, we should take the > > opportunity to clean up behind us and revert/remove parts of: > > > > 87e0d4f0f37f ("kbuild: disable clang's default use of -fmerge-all-constants") > > b0fe66cf0950 ("ARM: 8905/1: Emit __gnu_mcount_nc when using Clang 10.0.0 or newer") > > b9249cba25a5 ("arm64: bti: Require clang >= 10.0.1 for in-kernel BTI support") > > 3acf4be23528 ("arm64: vdso: Fix compilation with clang older than 8") > > > > This could be a series or a part of this commit, I do not have a > > strong preference. If we are not going to clean up behind us, this > > should be a warning and not an error. > > There are also some other documentation that would go stale. We probably > have to change KASAN docs to look something like the below. > > I wish we could also remove the "but detection of out-of-bounds accesses > for global variables is only supported since Clang 11", but Clang 10 is > a vast improvement so I'm not complaining. :-) > > Acked-by: Marco Elver > > Thanks, > -- Marco > > ------ >8 ------ > > From 13d03b55c69dec813d94c1481dcb294971f164ef Mon Sep 17 00:00:00 2001 > From: Marco Elver > Date: Thu, 27 Aug 2020 20:56:34 +0200 > Subject: [PATCH] kasan: Remove mentions of unsupported Clang versions > > Since the kernel now requires at least Clang 10.0.1, remove any mention > of old Clang versions and simplify the documentation. > > Signed-off-by: Marco Elver > --- > Documentation/dev-tools/kasan.rst | 4 ++-- > lib/Kconfig.kasan | 9 ++++----- > 2 files changed, 6 insertions(+), 7 deletions(-) > > diff --git a/Documentation/dev-tools/kasan.rst b/Documentation/dev-tools/kasan.rst > index 38fd5681fade..4abc84b1798c 100644 > --- a/Documentation/dev-tools/kasan.rst > +++ b/Documentation/dev-tools/kasan.rst > @@ -13,10 +13,10 @@ KASAN uses compile-time instrumentation to insert validity checks before every > memory access, and therefore requires a compiler version that supports that. > > Generic KASAN is supported in both GCC and Clang. With GCC it requires version > -8.3.0 or later. With Clang it requires version 7.0.0 or later, but detection of > +8.3.0 or later. Any supported Clang version is compatible, but detection of > out-of-bounds accesses for global variables is only supported since Clang 11. > > -Tag-based KASAN is only supported in Clang and requires version 7.0.0 or later. > +Tag-based KASAN is only supported in Clang. > > Currently generic KASAN is supported for the x86_64, arm64, xtensa, s390 and > riscv architectures, and tag-based KASAN is supported only for arm64. > diff --git a/lib/Kconfig.kasan b/lib/Kconfig.kasan > index 047b53dbfd58..033a5bc67ac4 100644 > --- a/lib/Kconfig.kasan > +++ b/lib/Kconfig.kasan > @@ -54,9 +54,9 @@ config KASAN_GENERIC > Enables generic KASAN mode. > > This mode is supported in both GCC and Clang. With GCC it requires > - version 8.3.0 or later. With Clang it requires version 7.0.0 or > - later, but detection of out-of-bounds accesses for global variables > - is supported only since Clang 11. > + version 8.3.0 or later. Any supported Clang version is compatible, > + but detection of out-of-bounds accesses for global variables is > + supported only since Clang 11. > > This mode consumes about 1/8th of available memory at kernel start > and introduces an overhead of ~x1.5 for the rest of the allocations. > @@ -78,8 +78,7 @@ config KASAN_SW_TAGS > Enables software tag-based KASAN mode. > > This mode requires Top Byte Ignore support by the CPU and therefore > - is only supported for arm64. This mode requires Clang version 7.0.0 > - or later. > + is only supported for arm64. This mode requires Clang. > > This mode consumes about 1/16th of available memory at kernel start > and introduces an overhead of ~20% for the rest of the allocations. > -- > 2.28.0.297.g1956fa8f8d-goog > Reviewed-by: Andrey Konovalov Thanks!