Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp689728pxx; Wed, 28 Oct 2020 14:35:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2c1c7vzsRXjAXsFglEVrT3ek0zE1j143NVwMjkPDLaPoysE2hH/EP9EKttvd0NXNQ8t+j X-Received: by 2002:a17:906:364f:: with SMTP id r15mr1074464ejb.388.1603920954270; Wed, 28 Oct 2020 14:35:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603920954; cv=none; d=google.com; s=arc-20160816; b=p6oJzntfMe6zohkuBYnA2tu03kdsrSnlM8Zp/lylKDLwCbwnxAWWaLopa9x4FVMD3U 4YHucu1QcnQvQt835JeFK1nWdjKaveCk+WGXJYFmzp6g2Yu3ibhlJ6mIBurKefXzEIQk 6+7H7iJtgm5u0q8HrZ60S2Xm27XV4AupTrdisUUvYInKbTgqfa1nT4b2SFEQ54UbVskk eNDHH6yVJg7+BSpNQmqf22RyC1hd4C37jQPnvyt6Qo8jnCu2oXJKYUkkaaHf6ILL35X1 NpgAAc7x9c6j7z3BsBxxu4EJvc5CiSCDP3xDzgfSgyfJMKeu9uDOjvZEk4H/nwoG74qE TrSw== 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=Di9gaxycAvCzdd+1U70ke+MNBud05H2WT/Fy4axR490=; b=pXMciobF/4wksC8rNMNK5k/jbux/59aM6NwIIDOhqEEPZCz7ZlK/RNsSETzgb9Eou3 WHDnraaPdUZfwmziC05fmHu3f1V5r83qhbSs4Zy5t/mVXb+RYEniy21qXL139CH/2ga+ AJfW2qvAAbng1I9le2xpH6MRHN94ElLAScKsZwODazR4D72EDfkcFp3aGfEr3LlUCWHm lMPuQkaWgpDFYWmH/F3HwT7NKKFr8pfY0vwQUHu/xepb65NnAJlOWOic4wuVGStkGgqs GTKN2YINXrG67wo6uvIlEOI8BZHDNY4F2uTqEdEWFUIh8/Fl5lkUPCV76qFu9hiOFenB Vl3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IWaX040E; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x13si543518edq.569.2020.10.28.14.35.32; Wed, 28 Oct 2020 14:35:54 -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=@kernel.org header.s=default header.b=IWaX040E; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1831099AbgJ0UPb (ORCPT + 99 others); Tue, 27 Oct 2020 16:15:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:37924 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2505120AbgJ0UPb (ORCPT ); Tue, 27 Oct 2020 16:15:31 -0400 Received: from mail-ot1-f52.google.com (mail-ot1-f52.google.com [209.85.210.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BE8EC222D9; Tue, 27 Oct 2020 20:15:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603829729; bh=k99urQCr5bqqGQYEIYyO+VH8YrhpcEKq73v6441UE7E=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=IWaX040EfBp7TebZkcfbUksBN8XtVdYgnEVHmZaYAY02WQ2XsCLrDZSnMY8NTwLfw 29Xj2XIoDU5At1lafmVHCvyXrNl5TJ8neeDVQZCTKdJ3shSzeNCaRpQscn7uS4g8a/ icj/n6/unORecRU2RUNh1YeVkNIyT1p6hQerClQY= Received: by mail-ot1-f52.google.com with SMTP id h62so2283860oth.9; Tue, 27 Oct 2020 13:15:29 -0700 (PDT) X-Gm-Message-State: AOAM532Za5nymo6Lt8EjiNntzXmEKH1pn7eF1kbC0bCgA55rk5EfuA0s vu8Rl/9gZMV5J/DFfuMlj5khXpqUAKyrC1Q+psg= X-Received: by 2002:a9d:2daa:: with SMTP id g39mr2896564otb.77.1603829728869; Tue, 27 Oct 2020 13:15:28 -0700 (PDT) MIME-Version: 1.0 References: <20200821194310.3089815-1-keescook@chromium.org> <20200821194310.3089815-14-keescook@chromium.org> In-Reply-To: From: Ard Biesheuvel Date: Tue, 27 Oct 2020 21:15:17 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v6 13/29] arm64/build: Assert for unwanted sections To: Nick Desaulniers 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 , kernel-toolchains@vger.kernel.org, Miguel Ojeda Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > (I feel the same about there > being an empty asm(); statement in the definition of asm_volatile_goto > for compiler-gcc.h). Might be time to "fix the compiler." > > (It sounds like Arvind is both in agreement with my sentiment, and has > the root cause). > I agree that the __no_fgcse hack is terrible. Does Clang support the following pragmas? #pragma GCC push_options #pragma GCC optimize ("-fno-gcse") #pragma GCC pop_options ?