Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp689120pxx; Wed, 28 Oct 2020 14:34:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz0+sH7bXdDhqUz/BsjfRJno17Bqsc4ZAJn/MF+52v7p8cF19/b4jmi1m17iy4HMFtTq/4K X-Received: by 2002:a17:906:4bc2:: with SMTP id x2mr1058343ejv.525.1603920889267; Wed, 28 Oct 2020 14:34:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603920889; cv=none; d=google.com; s=arc-20160816; b=zMro5riBx9LU0se9vjDh5qzAEZp2Lf8Nf4myeSXNQzXxBFwVuxhUgXuw2e1mWYbEOE qB9HTzjWAqb4PVd/zdNk29Maj+FHpd4STrMxzO9+XyD4gBN/ETprdyoycKc+nXtjAEYW +++t993hYAymBXYV55/5UCsw0KBKFfg6n4r0PDmVVlxzFYjXGAkOCbzaUthT/Yae3cf0 xCmXPf7ee2TBz1lSFMKf/aRmFS5rRn/LTQaTQylo5G3dFVg56QuqvhtOFy4AQL/KcsjV LlthL00ijMDFttA0wEp7qZ6sZCsaYBgHb5/bB1JvEaMjxPbbEmc2TpIqt5FIwS/+lLiB 6pMg== 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=3vH0jRuNNXMpR78OFAIDC7FB9qzF1hw7amK8Jt/4qu8=; b=l0gBaRLcW9hs3yXjccfmSQiWDHN3/U0GWU6ltdjeGUNROqbwkBJiyJUba+/+t4GDFL m17pZ16VIs+4t3GojHmEQtk2n6EIq4y7VfMV/d+cNYSCXFY5kcdNaI1CokDyNjRG5w2O yWrwLT3uoDPCrrqXP0IxCVYhUn5spUPRxtQbo4gQ3DdrYBFNDoESJqZUChdpmRMhi4D6 gY9+oTaP6YSqo6fj498SuCnHlwYTMFYcsFCjhGjwvb8kkdM1iBscSRw3pxFWoBOZG5mR SOV4laTs5EwRQKF9vAK+7HiH4MnIYVovixyOLDYurow6nJvwq2qtmmxEX8OBYfV+9hlq I2Eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=VXmwLNHk; 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 d4si607873edo.178.2020.10.28.14.34.23; Wed, 28 Oct 2020 14:34:49 -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=VXmwLNHk; 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 S372843AbgJ0U2R (ORCPT + 99 others); Tue, 27 Oct 2020 16:28:17 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:46792 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S372837AbgJ0U2Q (ORCPT ); Tue, 27 Oct 2020 16:28:16 -0400 Received: by mail-pl1-f194.google.com with SMTP id x10so1358325plm.13 for ; Tue, 27 Oct 2020 13:28:14 -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=3vH0jRuNNXMpR78OFAIDC7FB9qzF1hw7amK8Jt/4qu8=; b=VXmwLNHkl1EQMa3ojhAOzOZ1iCXl1R0QLtIn5hFJWYUl1BY1w1EjDDacbbwVF2fbFV 1jtKFk1JIx4U0zv05G+t6hzW/0UvF/d3Fu7tBVQud1Qm1aR2LBe0UMmY3v4DsSo6prOY p1GjHdRLZJZ/wZtM5IF/CC2SQmPpHuDgoqQG2+AtYQ2RFFokVeKDbV8YPskCuRfqdD2z 5oKrHpJLmiK9jcEH24Fqe64u3TgRdHyqXvPx7KH/LmTce8SPunhfV/rw7HsCHjFilGHK fuKigJutJyb3OE5ZFmUIUMVigMq0aNYvfWQb9YeQnriQbq1oen9xjESap/Q6vNOH1ryI vg/w== 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=3vH0jRuNNXMpR78OFAIDC7FB9qzF1hw7amK8Jt/4qu8=; b=Wt8A39+gplAtoqi9M11fkz+2RS4noSWzhjpKkl/+l0+cujB0zlOGXI8P8Ogq6AFdSs v/3wnSDuuyC/v+OYwM7pebamI0/+zXoiUr00b/d6pfMsjvpYBZanPRIBXZmgD+jHYWSc duuQaayMS6VKEAfgM/5tVXSJEEZAnBK4t4NN7xasv7pxzq7S0flSSMNPwXC+5tIlI99b Zi12YZEoIQEb2HZinkv5y7IMYs70geV2Adk2CQkI+GzRUC9r5LkH2i6Ckh347S8b3mCa qH5EulXS07nckEnBYjPLxSQzdI64Axc/0YskXnCMiZ7HX6cl4qgRUGlxrhUw/LS3fOeg l75Q== X-Gm-Message-State: AOAM5311ympDDHeq+HN9RViq5jYNoBvk+hAw+T7rFdUph0YivyEqvG4k 4152jQ3BeI7hcLEU8yvtUL2bveS3/dhL/WU1Tef9vg== X-Received: by 2002:a17:902:db82:b029:d6:3fe4:9825 with SMTP id m2-20020a170902db82b02900d63fe49825mr3848830pld.29.1603830494061; Tue, 27 Oct 2020 13:28:14 -0700 (PDT) MIME-Version: 1.0 References: <20200821194310.3089815-1-keescook@chromium.org> <20200821194310.3089815-14-keescook@chromium.org> In-Reply-To: From: Nick Desaulniers Date: Tue, 27 Oct 2020 13:28:02 -0700 Message-ID: Subject: Re: [PATCH v6 13/29] arm64/build: Assert for unwanted sections To: Ard Biesheuvel Cc: Geert Uytterhoeven , Kees Cook , Ingo Molnar , Catalin Marinas , Mark Rutland , Peter Collingbourne , James Morse , Borislav Petkov , Ingo Molnar , Russell King , Masahiro Yamada , Arvind Sankar , Nathan Chancellor , Arnd Bergmann , "the arch/x86 maintainers" , clang-built-linux , Linux-Arch , linux-efi , Linux ARM , Linux Kernel Mailing List , Linux-Renesas , Josh Poimboeuf , Miguel Ojeda , linux-toolchains@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org (+ right linux-toolchains mailing list, apologies for adding the wrong one, I'm forever doomed to have gmail autocomplete to the wrong one now that I've sent to it before) On Tue, Oct 27, 2020 at 1:15 PM Ard Biesheuvel wrote: > > On Tue, 27 Oct 2020 at 21:12, Nick Desaulniers wrote: > > > > On Tue, Oct 27, 2020 at 12:25 PM Geert Uytterhoeven > > wrote: > > > > > > Hi Nick, > > > > > > CC Josh > > > > > > On Mon, Oct 26, 2020 at 6:49 PM Nick Desaulniers > > > wrote: > > > > On Mon, Oct 26, 2020 at 10:44 AM Geert Uytterhoeven > > > > wrote: > > > > > On Mon, Oct 26, 2020 at 6:39 PM Ard Biesheuvel wrote: > > > > > > On Mon, 26 Oct 2020 at 17:01, Geert Uytterhoeven wrote: > > > > > > > On Mon, Oct 26, 2020 at 2:29 PM Geert Uytterhoeven wrote: > > > > > > > > On Mon, Oct 26, 2020 at 1:29 PM Geert Uytterhoeven wrote: > > > > > > > > > I.e. including the ".eh_frame" warning. I have tried bisecting that > > > > > > > > > warning (i.e. with be2881824ae9eb92 reverted), but that leads me to > > > > > > > > > commit b3e5d80d0c48c0cc ("arm64/build: Warn on orphan section > > > > > > > > > placement"), which is another red herring. > > > > > > > > > > > > > > > > kernel/bpf/core.o is the only file containing an eh_frame section, > > > > > > > > causing the warning. > > > > > > > > When I see .eh_frame, I think -fno-asynchronous-unwind-tables is > > > > missing from someone's KBUILD_CFLAGS. > > > > But I don't see anything curious in kernel/bpf/Makefile, unless > > > > cc-disable-warning is somehow broken. > > > > > > I tracked it down to kernel/bpf/core.c:___bpf_prog_run() being tagged > > > with __no_fgcse aka __attribute__((optimize("-fno-gcse"))). > > > > > > Even if the function is trivially empty ("return 0;"), a ".eh_frame" section > > > is generated. Removing the __no_fgcse tag fixes that. > > > > That's weird. I feel pretty strongly that unless we're working around > > a well understood compiler bug with a comment that links to a > > submitted bug report, turning off rando compiler optimizations is a > > terrible hack for which one must proceed straight to jail; do not pass > > go; do not collect $200. But maybe I'd feel differently for this case > > given the context of the change that added it. (Ard mentions > > retpolines+orc+objtool; can someone share the relevant SHA if you have > > it handy so I don't have to go digging?) > > commit 3193c0836f203a91bef96d88c64cccf0be090d9c > Author: Josh Poimboeuf > Date: Wed Jul 17 20:36:45 2019 -0500 > > bpf: Disable GCC -fgcse optimization for ___bpf_prog_run() > > has > > Fixes: e55a73251da3 ("bpf: Fix ORC unwinding in non-JIT BPF code") > > and mentions objtool and CONFIG_RETPOLINE. Thanks for the context. It might be time to revisit the above commit. If I revert it (small conflict that's easy to fixup), kernel/bpf/core.o builds cleanly with defconfig+GCC-9.3, so maybe obtool did get smart enough to handle that case? Probably regresses the performance of that main dispatch loop for BPF, but not sure what folks are expecting when retpolines are enabled. -- Thanks, ~Nick Desaulniers