Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp262632pxx; Thu, 29 Oct 2020 01:53:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgivGJtLxFLvOfnCtRjYebH+swelmd/WIvMdCvstrIyKJ2wmsWDXXHpx1VDBx4PnXvvztF X-Received: by 2002:a17:906:3bc9:: with SMTP id v9mr2969042ejf.340.1603961605500; Thu, 29 Oct 2020 01:53:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603961605; cv=none; d=google.com; s=arc-20160816; b=MzXCKEFZ7HJNKD0y4sHA+jYIK4r5MnGXdmzPqMoYsHDnOjz9d1ANF3jSlHep8hbdOO mMuaOczq0flepcN5vZgdT7g94MR7hHRx6u5liZrw6JJ+rt0wRE5QakQfHaJz6YN+GUFd tXBRG37NnumoTMMsveX9PT5MnhO5VXfn25khElJNwd8qDV2kxiXFJK2ZKsFYWKwZQ6Xv eLezNdYLU8q/ymq7gCXjyE3ggueh6ZkPqgBiEw0dQzrIEijWSrM/aq8V/nbZx9YJ4bQy MYQbBf1EDGXrC+LoEPx6N71F/o+JxjOuK0kR1fwunr5zGJMXYJ98HCCCfhdqj/YWb1yn VdxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=w1z4WmWcLWyyqsDJon/u9K8bQjOmOpYyTbSE3GXlbcE=; b=TkXEFwCETrtKbzJbHDuD/FVL1jehWUbcDDScYkme7xhth9pBbdj1p6hcnOXSHogssg NB6hnyVEEQWqApqhfXg62GadrwtBRtPwwCrirwmm/8aJ7+VnbugUJKPC/QKzeX/HG+zx ylYwj+mBRBTsSr6+jDilavzp574JTiemt2wb+iHLxmxFuvUHvBOxhaSRbSk1u4IAj6J1 /1gzEoRG8vCwxafpbkXEUIAYOCv+oXA21YQn/xiv15NtzW2UurLTTk4MwA1HeI832xvD oA/ZM0bUNIC6pOejao6rK1UjDq2j84QSPt519XVPpr9107qWzLICno8XKhSw5f756Jm3 6Tng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KmnzLyn6; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w1si1370151edf.49.2020.10.29.01.53.03; Thu, 29 Oct 2020 01:53:25 -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=@gmail.com header.s=20161025 header.b=KmnzLyn6; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387686AbgJ2CMJ (ORCPT + 99 others); Wed, 28 Oct 2020 22:12:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726821AbgJ1Vgb (ORCPT ); Wed, 28 Oct 2020 17:36:31 -0400 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3287C0613CF; Wed, 28 Oct 2020 14:36:30 -0700 (PDT) Received: by mail-pf1-x441.google.com with SMTP id j18so558159pfa.0; Wed, 28 Oct 2020 14:36:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=w1z4WmWcLWyyqsDJon/u9K8bQjOmOpYyTbSE3GXlbcE=; b=KmnzLyn6+i47a2oCXFfbgt2Tl8Pl3YHx/z1ecMXZptZN4+33a97ws0FeT7y7jVKJOV JkZrCjLxHhLLjhAObO34l1ZOruX9V27jywR7gnnYUyENTcDmOFnHqs17aihRwsZCin92 WBmDtijEWJEifi1t8tBx8Ox4uhm/3p+ZrnbKqjs8eVcrZROtMAjXBdYVV6OqpxKaebr5 4yf+pklO5ndbVUsQwkvo9hqWmfV+pkzJ2HnHyHDOE6Yb5rjoe8pYoM7FK97ileQiaS6t zQnbU14uXJfXVT2cqwSXYdHjFcUQRZc7SanlIjeBTz9uOTVyv0kREmVrfrxVtq6a0nrP e4Jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=w1z4WmWcLWyyqsDJon/u9K8bQjOmOpYyTbSE3GXlbcE=; b=jZ1+G0s5fDIHAM1T4xx6AzuzqNQR+DbQOulcwZonrhBx+wwBDGiV8g3pCXi2ksWOOj jOiTqkHTC/ktKDPETJJ0tz1jGNWa5hOZPmNnq2mlEtRL/cv3FyFMwAcYMkZyLUGqejxH 54ab2fDe+y2RTasa4GZ3wRE49G80ciNLseJ985fzxesyvSeVhF7NZURNe+l9x9VwKKYI E/U0EB9h3oO58es2tisCMgo/Z3gqZPRD1doSYEfGY59E91XVOOMk2OZmvlNSU5KeTU5B HlHaUVrUFSeIQa1BhpT1GCnyCb42ditzkAO3DsVK7BIIJMIY8gHZpKyufaA4kClab+D6 3K8g== X-Gm-Message-State: AOAM53358mIZqQTHA3g1YMbaeP1rUWVLXRKPxkGE7lyx20rMGaZMmMwN 5EvXE7VjNaOVirTaMc8U4zk= X-Received: by 2002:a17:90b:1043:: with SMTP id gq3mr873181pjb.213.1603920990427; Wed, 28 Oct 2020 14:36:30 -0700 (PDT) Received: from ast-mbp.dhcp.thefacebook.com ([2620:10d:c090:400::4:1c8]) by smtp.gmail.com with ESMTPSA id 189sm511557pfw.215.2020.10.28.14.36.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Oct 2020 14:36:29 -0700 (PDT) Date: Wed, 28 Oct 2020 14:36:14 -0700 From: Alexei Starovoitov To: Ard Biesheuvel Cc: Nick Desaulniers , 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 Subject: Re: [PATCH v6 13/29] arm64/build: Assert for unwanted sections Message-ID: <20201028213614.kqk7atvk6fcjely4@ast-mbp.dhcp.thefacebook.com> References: <20200821194310.3089815-14-keescook@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 27, 2020 at 09:15:17PM +0100, 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") That commit is broken. I had this patch in my queue: -#define __no_fgcse __attribute__((optimize("-fno-gcse"))) +#define __no_fgcse __attribute__((optimize("-fno-gcse,-fno-omit-frame-pointer"))) Sounds like you want to add -fno-asynchronous-unwind-tables to the above list? > 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 That will work too, but optimize("-fno...,-fno..,-fno..") is imo cleaner.