Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp1893592pxb; Fri, 10 Sep 2021 17:19:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8d4JpF1Sbec25CUmjUT+DwyjVynwLdEBdRtXRZDzdzX7ukbgEkGHXpLo1ozRUtAQgX31q X-Received: by 2002:a5d:9256:: with SMTP id e22mr322881iol.152.1631319588318; Fri, 10 Sep 2021 17:19:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631319588; cv=none; d=google.com; s=arc-20160816; b=LrlAhIGFCLwz8iYHDGvf0yi81fDJgE2t4a/lLr4UHjLXH+QAx6L0sU4paRBN0pUvlq eQcLSpos6GB9wzoRxm+BY95KnwrpPWVEuhtmyR8fDapNWYCBG1kYKgoXnf9Om624sUcr RmEmKGYNcSQ1xa7vmkNxEbOSHSytwlgvz7DtKAGgwe1EMpnMfVzkwCnb4/lV3fqpsace WMitHyq+nnV1GPnmJzf1z9cy8uA8O+/xVuZ0MXu/OSr1VaX00/BRhPLHjdv8ZiUT07JC 8NCnKfmAKy+RygPskP96G/zP5DM+5ldyZwmxyfyz8cqD+8DG/HEUwuIs4/y6Na7tOImG AVQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=nnxC0+uXgJWjMMOwzYEprAl8DpqU7SitvBfJvqXtAvA=; b=oGDbft9xipi6hGSTc8UHMx3Z6GRCugjcGsUSoXUeQiEZCL+fdXFjIG6UR/5y924F+B Wr3xneg8rxw4+36kid/Lm+Sxsco5bWmJF33z2+RTw1VCdNYyMUmu/mFI73lxKUFR+okl 9JZ7/PzOkvFPH0XWv1vddcIcJYl1RjSkgOy/WW3d7fmqF1KWOqZ4w+paVkHFDVxMTEFD lZED2PxJ4O4Ppfk58CEvwzdIpz5LzhtrjxldURvgF21vCWuJ4kkJc481NzDZUwQ95ghG Evxp1ZG0OhVP1TJwwCBqs345gwAMCaejPICtK+gEEcL1tVLWNnbcdofhsuyGa+RFgv6X FnGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=YKR5oBCZ; 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 n45si201537jac.79.2021.09.10.17.19.36; Fri, 10 Sep 2021 17:19:48 -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=20210112 header.b=YKR5oBCZ; 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 S234937AbhIKASJ (ORCPT + 99 others); Fri, 10 Sep 2021 20:18:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232897AbhIKARy (ORCPT ); Fri, 10 Sep 2021 20:17:54 -0400 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7CDB5C061574 for ; Fri, 10 Sep 2021 17:16:42 -0700 (PDT) Received: by mail-lf1-x131.google.com with SMTP id l10so7415576lfg.4 for ; Fri, 10 Sep 2021 17:16:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=nnxC0+uXgJWjMMOwzYEprAl8DpqU7SitvBfJvqXtAvA=; b=YKR5oBCZODSdIMSuJo9to3OJaDHwi04ayCLOqMoBUmbViJjERcAXyJJTrtmrE5YDki wISXApUrzytIbqr8U291ZReOnIVGsE0ub1UMpVCiP8CF0Dlso8Sr65erwIdVQkX1VCDz phSZtge746Vz86B4Uvv6BPViBE6Jou8UOa3NsWWqlllXijuQO5yQrmQmw0uKWZyNja1p qZkATojLiYONI/D0MIGkCujiZLIbc8eu7AwXX1VW/4LlSRGfEKNPLMU44fbYc5VRfMZ7 1DdoGStpHeR359PFxGEqayNMXKK4VpIklDRf8B5w2bDcfNHaxvNeOX1QMGmF7dcvGMa+ 6giw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nnxC0+uXgJWjMMOwzYEprAl8DpqU7SitvBfJvqXtAvA=; b=mgugnIEhRYPfJ1yYxpEVU2c5Gv4ZsWu/o+dIFBol9nhVpFu+CSqCFsrBO7J30YsJqa ICRXEhinLfYMeQ44nylDc+x6/0VCWpIVGtapJ/ykO46krRL5a2b8HXSMkkwtq2dvNxI7 BEqHK5i+Sut5fVd1/pbRDlD8ZZMwwAhquojE7cmIxd7PLdWIq1PPfyvDG/koIkXQkSdQ 0doMyGKfC31PwpIfrwNT5pxrT5zyLy9U2EJZxd49Z3nN7r6IuQ4jsIQsRHLxoXh0SzsB mia41rtHVNVTDsXNBy+QYJr1YmPJAmEzyMw5jCPTES2awA14hc1U/GC8KjW3/j1vJykt VN+A== X-Gm-Message-State: AOAM530qMMhF8ToSL2XTOYHa0TzB5CH5QmS2nq13MItHnajt0YzYX28H 6+OgFyY1X0slNiF6cCg5TevXNuTSdkXppMHsyJrDsAg+p9fK4w== X-Received: by 2002:a05:6512:139c:: with SMTP id p28mr151762lfa.523.1631319400634; Fri, 10 Sep 2021 17:16:40 -0700 (PDT) MIME-Version: 1.0 References: <20210910234047.1019925-1-ndesaulniers@google.com> <20210910234047.1019925-2-ndesaulniers@google.com> In-Reply-To: From: Nick Desaulniers Date: Fri, 10 Sep 2021 17:16:29 -0700 Message-ID: Subject: Re: [PATCH 01/10] Documentation: raise minimum supported version of GCC to 5.1 To: Nathan Chancellor Cc: Andrew Morton , Linus Torvalds , Rasmus Villemoes , Masahiro Yamada , Joe Perches , Arnd Bergmann , Stephen Rothwell , llvm@lists.linux.dev, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 10, 2021 at 4:56 PM Nathan Chancellor wrote: > > On 9/10/2021 4:40 PM, Nick Desaulniers wrote: > > commit fad7cd3310db ("nbd: add the check to prevent overflow in > > __nbd_ioctl()") > > > > raised an issue from the fallback helpers added in > > > > commit f0907827a8a9 ("compiler.h: enable builtin overflow checkers and add fallback code") > > > > Specifically, the helpers for checking whether the results of a > > multiplication overflowed (__unsigned_mul_overflow, > > __signed_add_overflow) use the division operator when > > !COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW. This is problematic for 64b > > operands on 32b hosts. > > "hosts" -> "targets" or "architectures"? Yes, will revise to "targets." > > It might be worth putting the error that Stephen found here? Doh! Yes, in v2, I'll include the following additional context: ``` The following error is observed when building for 32b powerpc: > ERROR: modpost: "__divdi3" [drivers/block/nbd.ko] undefined! As Stephen Rothwell notes: > The added check_mul_overflow() call is being passed 64 bit values. > COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW is not set for this build (see > include/linux/overflow.h). ``` > > > Also, because the macro is type agnostic, it is very difficult to write > > a similarly type generic macro that dispatches to one of: > > * div64_s64 > > * div64_u64 > > * div_s64 > > * div_u64 > > > > Raising the minimum supported versions allows us to remove all of the > > fallback helpers for !COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW, instead > > dispatching the compiler builtins. > > > > arm64 has already raised the minimum supported GCC version to 5.1, do > > this for all targets now. See the link below for the previous > > discussion. > > > > Link: https://lore.kernel.org/all/20210909182525.372ee687@canb.auug.org.au/ > > Link: https://lore.kernel.org/lkml/CAK7LNASs6dvU6D3jL2GG3jW58fXfaj6VNOe55NJnTB8UPuk2pA@mail.gmail.com/ > > Link: https://github.com/ClangBuiltLinux/linux/issues/1438 > > Reported-by: Stephen Rothwell > > Reported-by: Nathan Chancellor > > Suggested-by: Rasmus Villemoes > > Signed-off-by: Nick Desaulniers > > Reviewed-by: Nathan Chancellor > > > --- > > Documentation/process/changes.rst | 2 +- > > scripts/min-tool-version.sh | 8 +------- > > 2 files changed, 2 insertions(+), 8 deletions(-) > > > > diff --git a/Documentation/process/changes.rst b/Documentation/process/changes.rst > > index d3a8557b66a1..e35ab74a0f80 100644 > > --- a/Documentation/process/changes.rst > > +++ b/Documentation/process/changes.rst > > @@ -29,7 +29,7 @@ you probably needn't concern yourself with pcmciautils. > > ====================== =============== ======================================== > > Program Minimal version Command to check the version > > ====================== =============== ======================================== > > -GNU C 4.9 gcc --version > > +GNU C 5.1 gcc --version > > Clang/LLVM (optional) 10.0.1 clang --version > > GNU make 3.81 make --version > > binutils 2.23 ld -v > > diff --git a/scripts/min-tool-version.sh b/scripts/min-tool-version.sh > > index 319f92104f56..4edc708baa63 100755 > > --- a/scripts/min-tool-version.sh > > +++ b/scripts/min-tool-version.sh > > @@ -17,13 +17,7 @@ binutils) > > echo 2.23.0 > > ;; > > gcc) > > - # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63293 > > - # https://lore.kernel.org/r/20210107111841.GN1551@shell.armlinux.org.uk > > - if [ "$SRCARCH" = arm64 ]; then > > - echo 5.1.0 > > - else > > - echo 4.9.0 > > - fi > > + echo 5.1.0 > > ;; > > icc) > > # temporary > > -- Thanks, ~Nick Desaulniers