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=-4.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 465E9C55178 for ; Tue, 27 Oct 2020 20:15:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F02BB2225E for ; Tue, 27 Oct 2020 20:15:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603829733; bh=k99urQCr5bqqGQYEIYyO+VH8YrhpcEKq73v6441UE7E=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=BGt3+ghfUPx79iYhX2kpHnOEENCQtgfJZ50/M49tAXY5cBquit+C1n2oq1VubH0Fd EeiI9zq/2T5R/DEX7mGnkjSf2w38at52NKjkM3DKOGUE4/qJg+mpm6BTCbDHMymL8G 6NOoYnXpAhBOb3GMwE2GYUr/CNwFzdOW9BC+fFi8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1831103AbgJ0UPb (ORCPT ); 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-Google-Smtp-Source: ABdhPJz7OiekGW/gRYpC7hC2i5PrYMFhEwtbtysJSgICs5C8iOPhqCdhUlX41my68uZsg6m0UncvoboW4ZUHXG8A8cs= 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 ?