Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp138162pxx; Wed, 28 Oct 2020 21:13:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJOLabIMrcHUrKMTrQi+TdZKxY8MyynMP52eqx1hJfnfDO70YKLmfGC9kZyS9XJqmTCN2N X-Received: by 2002:a17:906:edc8:: with SMTP id sb8mr2148510ejb.241.1603944787122; Wed, 28 Oct 2020 21:13:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603944787; cv=none; d=google.com; s=arc-20160816; b=zVlhjVFX7g+0sdPn88GxR6XrnUceHewoqf/i17dj1ll08KYzs227gxIPi9W1kNRYHM DJRjNMWtL4Uksb/feOXF7xbi2BNJ0zKhBMH8FW4SKVBWEVTFTDtMJqSdJMu49Ly7p0Vr m6jmPZ2RubUCYOTZLZuwxMilnmsOIUFYiOKkRXlZE7t3cbazKVgwlmbNmYIWVPYpv8CE HFjQ2+R12D+SyQYsAxsu89ulPQpSqlaGAuPbqtmqRctolCgTW28IWDK9MRRP1DIlcmhs wC5j2o5gUyuigu1OR6XBDtag2VUs1kzA08ljrpRvmf2x6IyGbMWxNo6/HUxcXUFd1qPt 0EWQ== 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; bh=dm29FGJ3HmM/IlgprUU1WrHRYzNgHTCNIAv/rcKqb3E=; b=Yo024c93hSnYzBGW875YDypvYdl9uCzhtya9Ez9jHHxxVaAFJcRGSxQsayAH4X2wBN ziZR7PpPDw0RiWkGZm9xYDkX5Wpx+eCYl3ppJ9YLP2/3lljdwVsM4XmVkpQLsYMsnGJo HE+SLujWmp9joT/zAYyz10r3QTCx4i3oV2u2/+/121U3XEYcghKTvU0GGaeMmVsGeeLT 4dOD1QwcMv8D8jslSR2rjc+poJAmsEP1Tjj/sWSzklp25ord5eIheJ0SwlJpLS+YaNOq TO0fC/uA632BwOmlrQjQiqX9tPZctizIybvna+DSrBfDOAGyoSRo19NoD0PPsqAkbCB1 dpyg== ARC-Authentication-Results: i=1; mx.google.com; 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 a5si1117711edl.454.2020.10.28.21.12.07; Wed, 28 Oct 2020 21:13:07 -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; 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 S1726661AbgJ1VfK (ORCPT + 99 others); Wed, 28 Oct 2020 17:35:10 -0400 Received: from mail-ot1-f66.google.com ([209.85.210.66]:34437 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726694AbgJ1VfF (ORCPT ); Wed, 28 Oct 2020 17:35:05 -0400 Received: by mail-ot1-f66.google.com with SMTP id k3so539594otp.1; Wed, 28 Oct 2020 14:35:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=dm29FGJ3HmM/IlgprUU1WrHRYzNgHTCNIAv/rcKqb3E=; b=B2LxXgI1ogF0WFOJCxCq3Hxyf3TKRVpH2mAubeklbKWFSVuJmDy5g18jCdArVR+DcZ HvWKI44eYHvr/R83MgiBPBhAiBpRN2+2Jq3dwum5+byv/xQP83TZMtuh1DIzXl6Ic6fv PJ3fW2ZY5Yf5Mp/2/wW0893vbUlqdZdMlHT43MEX2zVbTjIBeANH6Nr26cBPaRZDfFjA su+Bs6iFBRew8SjCYILlq6ACQYpkhMT1yeTQ6dwR7INEsreZRgvURvVr67OqOHCIawJE 9glllvegRQ8LWrso1soCrJj7ufoBpoalnn8EZ7yEUueX2GoevgiAKT5YS343LLJQmmMt LA2A== X-Gm-Message-State: AOAM532Bwv0AUEijQC+ckAShqVz59wxAd/xiaU5FTjbSgqT3RCU0ZYXp WZmCINeXDjxXSL8keBaI61psi+c4IfONjdxQ1XBZQ8iAPtowqQ== X-Received: by 2002:a9d:5e14:: with SMTP id d20mr4090804oti.107.1603873848080; Wed, 28 Oct 2020 01:30:48 -0700 (PDT) MIME-Version: 1.0 References: <20201027205723.12514-1-ardb@kernel.org> In-Reply-To: <20201027205723.12514-1-ardb@kernel.org> From: Geert Uytterhoeven Date: Wed, 28 Oct 2020 09:30:37 +0100 Message-ID: Subject: Re: [PATCH] bpf: don't rely on GCC __attribute__((optimize)) to disable GCSE To: Ard Biesheuvel Cc: Linux Kernel Mailing List , netdev , bpf , Arnd Bergmann , Nick Desaulniers , Arvind Sankar , Randy Dunlap , Josh Poimboeuf , Thomas Gleixner , Alexei Starovoitov , Daniel Borkmann , Peter Zijlstra , Kees Cook Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Ard, On Tue, Oct 27, 2020 at 9:57 PM Ard Biesheuvel wrote: > Commit 3193c0836f203 ("bpf: Disable GCC -fgcse optimization for > ___bpf_prog_run()") introduced a __no_fgcse macro that expands to a > function scope __attribute__((optimize("-fno-gcse"))), to disable a > GCC specific optimization that was causing trouble on x86 builds, and > was not expected to have any positive effect in the first place. > > However, as the GCC manual documents, __attribute__((optimize)) > is not for production use, and results in all other optimization > options to be forgotten for the function in question. This can > cause all kinds of trouble, but in one particular reported case, > it causes -fno-asynchronous-unwind-tables to be disregarded, > resulting in .eh_frame info to be emitted for the function > inadvertently. > > This reverts commit 3193c0836f203, and instead, it disables the -fgcse > optimization for the entire source file, but only when building for > X86. > > Cc: Nick Desaulniers > Cc: Arvind Sankar > Cc: Randy Dunlap > Cc: Josh Poimboeuf > Cc: Thomas Gleixner > Cc: Alexei Starovoitov > Cc: Daniel Borkmann > Cc: Peter Zijlstra (Intel) > Cc: Geert Uytterhoeven > Cc: Kees Cook > Fixes: 3193c0836f203 ("bpf: Disable GCC -fgcse optimization for ___bpf_prog_run()") > Signed-off-by: Ard Biesheuvel Thanks, this gets rid of the following warning, which you may want to quote in the patch description: aarch64-linux-gnu-ld: warning: orphan section `.eh_frame' from `kernel/bpf/core.o' being placed in section `.eh_frame' Tested-by: Geert Uytterhoeven Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds