Received: by 2002:a05:6a10:87d6:0:0:0:0 with SMTP id g22csp1145544pxr; Mon, 11 Apr 2022 16:37:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZ3smTuVWt/L1Rxl4a2wxRT5svWjRLD3CqikDIBws3SpZwJCcsF7CeUkyxK+dXWR4CpKMR X-Received: by 2002:a17:907:7e8c:b0:6e8:92df:1656 with SMTP id qb12-20020a1709077e8c00b006e892df1656mr7068060ejc.386.1649720245040; Mon, 11 Apr 2022 16:37:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649720245; cv=none; d=google.com; s=arc-20160816; b=rbZjpdmky2cKOU8c6j9vJBKC7FzGGKkeWbRIZePumDfSVJ/511iTe6i0Jf/ODSFS0Q 57G6WPl+7rW/3TAY/vz8kOwMZ+d0LnLmw+5ojANOk/hdyJ3uzlirdnTZcRB5jx1vKXhb L/1ONQVOO8C7xjaNLzgDIEJNwmCaL/bcqGLEK1BRdXKF0Sy0jTax0mMFUZdItHlV/zX5 aBf60v13VHgjRbT7lrva6jwJ6b7J2kbAPwaAzT2TuWYs39WCM4KDGKcmJR8nJHzzVnqa SQga7kSXOO3ctCgDGSV7MDKANcSdP3aKTaFia8laY89/b4hYDTsyhTTc5Hr/KcYrJlLb 322w== 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=/UM0a9Ip3D6RdnaIa3xh2eGdIk2IGdD4yqLErApCSxM=; b=a3pez0kny6d25dg1NKLONoEf4u87zW3+JiDtVgzm8/SHwNQL+pKAcejBCGyqAiEWKf YsS9fzaHvXZqcbtftjNa/2EVu2kMu5JngeY0T5THDsU7oxkL9RXU2Z5R2yZjYRIz4Iz6 GPWzgJX4nVvstFOSlaQ/3wHTFAGX124VRzb6iLFMJkpxdmF6twoEmbTNjl3If4mQT9gC l441dSQzw2IgFoJKA6eExBfBVWnuAhaLWjLAoVJDRpxT5cq1/exi4pJlR3PBRztE+e+2 QKb30X/QXuVvy4MOVGX0nLmE0nt5ZuE005l74BbCoueSznZ2hnr5058qP76FfdOtzz0h czBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="CI/CYvGT"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jg10-20020a170907970a00b006dfa8e11aa0si7844108ejc.792.2022.04.11.16.36.58; Mon, 11 Apr 2022 16:37:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="CI/CYvGT"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S239419AbiDHULR (ORCPT + 99 others); Fri, 8 Apr 2022 16:11:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239405AbiDHULO (ORCPT ); Fri, 8 Apr 2022 16:11:14 -0400 Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 345FC1A777B for ; Fri, 8 Apr 2022 13:09:01 -0700 (PDT) Received: by mail-lj1-x22f.google.com with SMTP id c15so12837381ljr.9 for ; Fri, 08 Apr 2022 13:09:01 -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=/UM0a9Ip3D6RdnaIa3xh2eGdIk2IGdD4yqLErApCSxM=; b=CI/CYvGTarILQMchP5s65Nb1hnUDQsMrJh6w+c+dkUl2F0BUOL2kuCeFcTeCQbJYjI yGMOzFWpjq2/2dCurKDzl4jWsQWHpb2kim/he4cP+VpQJ0ZUStRZGBNXrdgeYq6+Tfcu HjaA3//xCR8FdmJPvzvsB8Ewe4ysqg6aLbknQWkkmP6TJjHR3vNr+HzAxJJOsvVYFhqe DmwZKjCy0D1h/BU8V9rycAcdezkBXyYJ37skY+HbruIkrt7zeynpUygEOMwl2hyy8C0g wByJvNnOaCJ+Uita54VhBO6KQ5POwGmjgBjBNZO9b95Q/C+Pm4W3XcqpBs23OKtumbWW UFXw== 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=/UM0a9Ip3D6RdnaIa3xh2eGdIk2IGdD4yqLErApCSxM=; b=CnjC3tQFLUgjDAOpYgM6uLOoFcVG4366juIskf9fC0YM04zb6Ph+qhlNUAwZQoj6Go Q1L9sXtCijmBv+sYJppTjWpZ2QP1c6fMVTwWK2+VVQ5dP2CeuSxpBK6OjONylE9bCUNB JVNaYeH67V4iLjAjo/eTWicGV+xUgffLZudB/mGO+7xdWNdeEJeD4HsCSc+2bR6ZYV/k E9EjYjqQXxAARNxjf9IH1eOYz75pklY+op2ulw5J2zpH76WKCgsFyUlw+Tg0xmvzpeiO QEMk1ekYZiH0rGVnUzZ60Iire4Hvas7a0nZTox/8oY0nmU+79iVl/+LVp0fdrC4VLkLN oXFw== X-Gm-Message-State: AOAM5336KSkyfKZlX2SwIbwRA+MtthIa70OIM+vCoKgAn2KzoSB7dul8 r0W8IeAUOpusSRwq88DLsQUB21WQvtytyxH1yTBdeA== X-Received: by 2002:a05:651c:555:b0:24b:15b7:74ad with SMTP id q21-20020a05651c055500b0024b15b774admr12406043ljp.239.1649448539126; Fri, 08 Apr 2022 13:08:59 -0700 (PDT) MIME-Version: 1.0 References: <7fad83ecde03540e65677959034315f8fbb3755e.1649434832.git.jpoimboe@redhat.com> In-Reply-To: From: Nick Desaulniers Date: Fri, 8 Apr 2022 13:08:47 -0700 Message-ID: Subject: Re: [PATCH] kbuild: Remove CONFIG_DEBUG_SECTION_MISMATCH To: Peter Zijlstra , Masahiro Yamada , Josh Poimboeuf Cc: Michal Marek , Linux Kernel Mailing List , Linux Kbuild mailing list , Sam Ravnborg , X86 ML , Arnd Bergmann , Changbin Du , linux-toolchains@vger.kernel.org, clang-built-linux Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Lore thread start for newly cc'ed ML readers: https://lore.kernel.org/lkml/7fad83ecde03540e65677959034315f8fbb3755e.1649434832.git.jpoimboe@redhat.com/ On Fri, Apr 8, 2022 at 12:14 PM Peter Zijlstra wrote: > > On Sat, Apr 09, 2022 at 03:29:21AM +0900, Masahiro Yamada wrote: > > Is [2] caused by dead code that was not optimized out > > due to the unusual inlining decisions by the compiler ? > > The complaint is due to SMAP validation; objtool will scream if there's > a CALL in between STAC/CLAC. The thinking is that since they open a > security window, we want tight code between them. We also very much > don't want tracing and other funnies to happen there. As such, any CALL > is dis-allowed. Just indirect calls, which might be manipulated, or static calls, too? > > This weird option is having us upgrade quite a few 'inline' to > '__always_inline'. As is, the assumption that __init functions only call other __init functions or __always_inline is a brittle house of cards that leads to a "what color is your function" [0] scenario, and leads to code that happens to not emit warnings for compiler X (or compiler X version Y). There's also curious exceptions in modpost that look like memory leaks to me. We already have such toolchain portability issues for different toolchains and different configs; warnings from section mismatches, and objtool STAC/CLAC checks. I feel that Josh's patch would sweep more of those under the rug, so I'm not in favor of it, but could be convinced otherwise. TBH, I kind of think that we could use a C extension to permit __attribute__((always_inline)) to additionally be a statement attribute, rather than just a function attribute because of cases like this; we need the flexibility to make one call site __always_inline without necessarily forcing ALL callsites to be __always_inline'd. void y (void); void x (void) { __attribute__((always_inline)) y(); }; (This is already expressable in LLVM IR; not (yet) in C. I'm not sure yet _why_ this was added to LLVM; whether a different language front end can express this, if C can and I'm mistaken, or whether it's only used for optimizations). I think that would give developers maximal flexibility to defer as much to the compiler's inlining decisions when they don't care, and express precisely what they need when they do [care]. [0] https://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function/ -- Thanks, ~Nick Desaulniers