Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp689154pxx; Wed, 28 Oct 2020 14:34:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTPsxOmlwkq0aZse0LvkhfkhDidSqheJ/QZspPOrXJppwUPdqSu3pN9DYcIFWItAG2/RRG X-Received: by 2002:a17:906:4bc9:: with SMTP id x9mr1055602ejv.37.1603920893760; Wed, 28 Oct 2020 14:34:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603920893; cv=none; d=google.com; s=arc-20160816; b=XWUa9gjFAVo6vbGKZnDnGidQedzHW3cA4+gc5/6Kdx0J6MTeCmYNoXj802cauMKcvd zZrTJWFG/RVpnPCFs4Ji5dZifP7+0S3hQGProb6lxKPvtYj8z4hE2Yj+/vuAY3gsnZ4A TLwGCwncz4uDJ7tNUMWQyOrpaHBFOVqghANHnE27FW9cirY/GUu6OPzTmy/WeR5C87az bLHuM1AJhNd0spZQJI7fF/CbpKM/kVPkAoX7ZSQcKmeaU3OdORidb+MdubMjwfRRkEVk gxw2hiizfvb/J0Vl1W0riq44aR88w5ALbRnl0GPEQ6wx3v2tvByMzDyIyg7oc+mZ6pcl pNtg== 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:date:from:sender:dkim-signature; bh=pTfXLkUKJcoocwAw1MeELq2/Ah/3yvNDEolWgsyMElU=; b=IpcsKxoI19wYbdzdBaipzjjF5huJYRwxNV5zUNydFtj8Jx9UGf9li6p0EZIE+QZGZh Bbq+XMPuh5I03oR00T0Trg67tuCZWtwu9EeTBmzirBihBxujnkyhrhOAhUVlX4a5WKie TgJuqRBkAnsC0nrkja3k6sbg5qa/t8kf9M+4H0TkCa0ZP1U2Lav9/HvvO2abU+qIrsqd 9z6hzX/GFmLrODjLvIo9sjfELk1Fsbz6ilgRTYxgizzOQj4GAlaPVkTSfqGQ0YchnZ5s XaJsiX6Hw9C4CCYOBFO3Ds7tnEfqBT/3M6eZS16QZ5rgMj5ZTfnEdwO3tQQyuCKnLkzX btKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Q5lrtyim; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h34si584180edd.609.2020.10.28.14.34.31; Wed, 28 Oct 2020 14:34:53 -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=Q5lrtyim; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S372903AbgJ0UaH (ORCPT + 99 others); Tue, 27 Oct 2020 16:30:07 -0400 Received: from mail-qk1-f193.google.com ([209.85.222.193]:45226 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S372894AbgJ0UaG (ORCPT ); Tue, 27 Oct 2020 16:30:06 -0400 Received: by mail-qk1-f193.google.com with SMTP id 188so2519368qkk.12; Tue, 27 Oct 2020 13:30:04 -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=DO82RT2mwZ35wNqyISziQicyvHpJgxxfWzMMB56gG6V1DbsaikoInqtYUb0isdsLC8 B9/Bquzyd7zX48jFfMAeCuQs4knQuLRvKCoueIQPHJ/oNebwvk78UEH1GjuoYIN/GaTu N/mxXKaBCrwEbni/H339Ds0cKFH+0nbSg2dbbR58Ec72dYMbRYlEZ0O2LgAS51hf6PQM 5MqGQcs3/c5N7mJSeSD7Fz9MFtMf/aaezj3xhvV9jCI/hCuGrn2N96hUPH2zPfuJO3YD L1zNvpToS7CURdrVPAWPZg4RJdrLXjr/97e+QxWV56C1PGN9P5KVzora2GPm3b0DgK6Q X8Kw== X-Gm-Message-State: AOAM530GcKw+id0CtlnhD5UI1u+9u4wT1o6G/IjHjY0HRpMxXZmfYlZ7 PHQbF7lqQ+96zSE6DR7ejsU= 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) Sender: Arvind Sankar From: Arvind Sankar X-Google-Original-From: Arvind Sankar Date: Tue, 27 Oct 2020 16:30:01 -0400 To: Nick Desaulniers Cc: Ard Biesheuvel , 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: <20201027203001.GA1833548@rani.riverdale.lan> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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?