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=-13.2 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL autolearn=no 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 E1468C4332F for ; Thu, 9 Sep 2021 12:04:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D097960041 for ; Thu, 9 Sep 2021 12:04:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348116AbhIIMEp (ORCPT ); Thu, 9 Sep 2021 08:04:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345003AbhIIL7b (ORCPT ); Thu, 9 Sep 2021 07:59:31 -0400 Received: from mail-oi1-x22e.google.com (mail-oi1-x22e.google.com [IPv6:2607:f8b0:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F6F7C08C5DA for ; Thu, 9 Sep 2021 04:43:57 -0700 (PDT) Received: by mail-oi1-x22e.google.com with SMTP id v2so2093592oie.6 for ; Thu, 09 Sep 2021 04:43:57 -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=ge0i4MysJLg7UB+Yx2AaDOSBAP1whBCQ4nJVOdEAFfQ=; b=AM0acIeRzwZOQ8ps3Z56Nt2NWs6+nlhrzsKcVFwKMDqqa7rDx5eL5KDD0h/BaJoTnn Yyyxu9wJG75huSLycWf8IDuT7DT0EULGp5e0DvypWYxR9B4SQfPU5j8Fn4XhfFEruwLE ClKvJyFIvmnV6Km2XZLLKRVpzmuk+CmtA15esdDv1bDunZyDxFsQlEfitpESUQeSYFJp 8BTH19cQVldl2Q/Q/K063Hrw0iJTbEvdUS66oLsCqTbhNgBAq0kgnGI6EB+sd5gWro4q 6u6ZSKDtWZTSrF4AorelJKBZfPAQkJjHlymjU+m1V7QiieTyxzEwYQ0qxBYlDgPTQOni 8v9g== 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=ge0i4MysJLg7UB+Yx2AaDOSBAP1whBCQ4nJVOdEAFfQ=; b=IstbKthFiozsiYweiVFQ+GoFKBqf8G+qmmJ4OvBi9qT4LhOzTMBwBcKUxNTLtRpkEO rk3rEqce15oeAH8VOM/TAMjPsJcAczqrqi463q6zpB1/vel6Q53dQQSxkEgc5ElsbJJH OOEXy2aezi+AITcJhX+ebobuRFl4Yotu/ROM0hLyh0o9aeWWYFQZQsmGQoB7kI21oSo9 WljEj6ayNcqEyksQuMM+us3vSCACIGGK3BQQeMNx4QklYEBfhtcBxrG7VnFZZ1C+0MyB +1kqF1KQt7s/Xiv77YPEferZulF0opgjoWPpbBSUPcQupyaxDO2oDNrof0SJonj1XhUT kiGg== X-Gm-Message-State: AOAM531Pv5TDeJwxVIZLrOFRHoR0J1vDi/mpUsKoR7kzjGjBltnP2/a8 18UUk9zJwJe4RcgZoi0XX2g3lXswbJFjOLM3kAdA4A== X-Google-Smtp-Source: ABdhPJz4Mhm5+vx6TwV+94c8TrEoyJnBnwuFZl9zQWVxFkMW7/1ms65QTzG16fCfVI4XNFxP1+08u3vCaxDOvTe4liM= X-Received: by 2002:aca:4344:: with SMTP id q65mr1645122oia.70.1631187836164; Thu, 09 Sep 2021 04:43:56 -0700 (PDT) MIME-Version: 1.0 References: <20210906142615.GA1917503@roeck-us.net> <75a10e8b-9f11-64c4-460b-9f3ac09965e2@roeck-us.net> In-Reply-To: From: Marco Elver Date: Thu, 9 Sep 2021 13:43:44 +0200 Message-ID: Subject: Re: [PATCH] Enable '-Werror' by default for all kernel builds To: Arnd Bergmann Cc: Christoph Hellwig , Guenter Roeck , Nathan Chancellor , Linus Torvalds , Linux Kernel Mailing List , llvm@lists.linux.dev, Nick Desaulniers , Paul Walmsley , Palmer Dabbelt , Albert Ou , linux-riscv , Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , Andrey Konovalov , kasan-dev , =?UTF-8?Q?Christian_K=C3=B6nig?= , "Pan, Xinhui" , amd-gfx list Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 9 Sept 2021 at 13:00, Arnd Bergmann wrote: > On Thu, Sep 9, 2021 at 12:54 PM Marco Elver wrote: > > On Thu, 9 Sept 2021 at 07:59, Christoph Hellwig wrote: > > > On Wed, Sep 08, 2021 at 11:58:56PM +0200, Marco Elver wrote: > > > > It'd be good to avoid. It has helped uncover build issues with KASAN in > > > > the past. Or at least make it dependent on the problematic architecture. > > > > For example if arm is a problem, something like this: > > > > > > I'm also seeing quite a few stack size warnings with KASAN on x86_64 > > > without COMPILT_TEST using gcc 10.2.1 from Debian. In fact there are a > > > few warnings without KASAN, but with KASAN there are a lot more. > > > I'll try to find some time to dig into them. > > > > Right, this reminded me that we actually at least double the real > > stack size for KASAN builds, because it inherently requires more stack > > space. I think we need Wframe-larger-than to match that, otherwise > > we'll just keep having this problem: > > > > https://lkml.kernel.org/r/20210909104925.809674-1-elver@google.com > > The problem with this is that it completely defeats the point of the > stack size warnings in allmodconfig kernels when they have KASAN > enabled and end up missing obvious code bugs in drivers that put > large structures on the stack. Let's not go there. Sure, but the reality is that the real stack size is already doubled for KASAN. And that should be reflected in Wframe-larger-than. Either that, or we just have to live with the occasional warning (that is likely benign). But with WERROR we're now forced to make the defaults as sane as possible. If the worry is allmodconfig, maybe we do have to make KASAN dependent on !COMPILE_TEST, even though that's not great either because it has caught real issues in the past (it'll also mean doing the same for all other instrumentation-based tools, like KCSAN, UBSAN, etc.).