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=-3.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,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 01B1DC4363A for ; Tue, 27 Oct 2020 20:30:50 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 642C221D41 for ; Tue, 27 Oct 2020 20:30:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="vi32jk5W"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Q5lrtyim" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 642C221D41 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=alum.mit.edu Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:Date:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=UT37C0oCOusNWc3/rPgreWmoUmfTRP4hQNXuBycmdFs=; b=vi32jk5Wmr9t2mLUYJSP4mulV ZoM8JLrxJWKsMl1qLmlKBydqzt7HqV1353ZtzCyyVhUCFO1adS7ukGTs2PKvSVuvH1YM4a3rTLLy0 k3o14PRsHaFLlzqlVNVn6THaKxYcK/CnDSOQgP2Gog3pVWVqQy+avEV3BDIZhu4wcSoYhbNY/es4C YXHUtR5ptqrxi2Bn2F3sQ3iE0WE3P75v7nDYDEgPWK5ejHg8+nqpCfb3cgzK+JO3XV6oFD6LCXNKr WczHXbzxSmImxEyoCEzuh/yCd7eVHnt+3v87fFVonDE6BX0NJosQV9qin6pBl+j0rPA53gYLkOPxv ql2mfnZPQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kXVbg-0002eF-W2; Tue, 27 Oct 2020 20:30:13 +0000 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kXVbZ-0002cr-Vs for linux-arm-kernel@lists.infradead.org; Tue, 27 Oct 2020 20:30:08 +0000 Received: by mail-qk1-x743.google.com with SMTP id j129so2546037qke.5 for ; Tue, 27 Oct 2020 13:30:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=pTfXLkUKJcoocwAw1MeELq2/Ah/3yvNDEolWgsyMElU=; b=Q5lrtyimNp/GH2HLr2f3gpGZrDsx/FjkIOPDACzMb7NDXOrHRTwhXxdtZrqtPZsBot /Xhsg1G0rVa9a0DxOI0bUj8yoO58aJMkrp0jdfgERpTOeEPZ3ynhtbFpKknRzAlk29zz axsL6lCyqJyuBV1f4Ica4nNXe649p79NNDqXeUVms8qszp69b4wzdNGMkW8oiEyo8df2 fxBzmwHQsAU+YXmLPT5yLOhwZbNp32k2aKJ6RR9TtT884JNrzjvQ12ea8NYXyGiMBk/F ZJtAX086HFmdxJfDNiCMEp3Tr1Onqo8PDfpBAZtOO249DxwcObr7CjJkSxXdIBKY+Lsg iB/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:date:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=pTfXLkUKJcoocwAw1MeELq2/Ah/3yvNDEolWgsyMElU=; b=N/6/qSFYh4zkU6DWtg+jl04D/1ONbLdR59BmcBeaHx7ZeBVDXeo17lEDhML7QKctuO ssR09sky1S+wLMJArXtLemWJ8iihioM7i9HHcx04DtbcrjTgZNIZteTrDH8NyWDSM4nO smp3ozBgSo9Qt/TQ2Hb/IjE9jWCmmyRjhT9d9xGjHfsWszWZqbMy50cCHIdapDVWwA9v JtbDTgQNAL/Q3KM6uDCkYFctvSGKTfWTvwBRg50banJWCOPbDSD4XxSIJOsIEz6aAR0f qst70xLRboJwXKvtja6514KaRsd+mJp2TRlltjL+cOicYOPC0SA8a4uzhhP11EbTf5Vg ocRw== X-Gm-Message-State: AOAM530zNaizDB05pOfRxxyHJRFgOuPUIY+hahxvvZw4ZTmPs7Brz1JU NNdUR7Iipq7DIT1lk3Qz5PI= X-Google-Smtp-Source: ABdhPJyVdWnZxrvjlPKa1Zli67mpvt40pZAWRVvGroOz15avhiMyv9GHvjgyCXpsLh1G9Ug6AlLQHA== X-Received: by 2002:a37:4f92:: with SMTP id d140mr3840320qkb.402.1603830603983; Tue, 27 Oct 2020 13:30:03 -0700 (PDT) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id b23sm1454393qkh.68.2020.10.27.13.30.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2020 13:30:03 -0700 (PDT) From: Arvind Sankar X-Google-Original-From: Arvind Sankar Date: Tue, 27 Oct 2020 16:30:01 -0400 To: Nick Desaulniers Subject: Re: [PATCH v6 13/29] arm64/build: Assert for unwanted sections Message-ID: <20201027203001.GA1833548@rani.riverdale.lan> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201027_163006_471299_8D4C019A X-CRM114-Status: GOOD ( 33.40 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , linux-efi , Catalin Marinas , Arvind Sankar , Ard Biesheuvel , Linux-Arch , kernel-toolchains@vger.kernel.org, Masahiro Yamada , the arch/x86 maintainers , Russell King , Ingo Molnar , clang-built-linux , Ingo Molnar , Geert Uytterhoeven , Borislav Petkov , Kees Cook , Arnd Bergmann , Josh Poimboeuf , Nathan Chancellor , Peter Collingbourne , Linux ARM , Linux Kernel Mailing List , Linux-Renesas , Miguel Ojeda , James Morse Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Oct 27, 2020 at 01:17:55PM -0700, Nick Desaulniers wrote: > 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. > > > > > (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 > > > > ? > > Put it in godbolt.org. Pretty sure it's `#pragma clang` though. > `#pragma GCC` might be supported in clang or silently ignored, but > IIRC pragmas were a bit of a compat nightmare. I think Arnd wrote > some macros to set pragmas based on toolchain. (Uses _Pragma, for > pragmas in macros, IIRC). > > -- > Thanks, > ~Nick Desaulniers https://gcc.gnu.org/onlinedocs/gcc/Function-Specific-Option-Pragmas.html#Function-Specific-Option-Pragmas #pragma GCC optimize is equivalent to the function attribute, so does that actually help? Btw, the bug mentioned in asm_volatile_goto seems like its been fixed in 4.9, so the hack could be dropped now? _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel