Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp692215pxx; Wed, 28 Oct 2020 14:40:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXtzksmp903oXOTZmWolv+HV1QcdAwTdmON29wHXpoYf12x80Te+kWCaKOwDktn7QiJfe1 X-Received: by 2002:a05:6402:c12:: with SMTP id co18mr959147edb.162.1603921207655; Wed, 28 Oct 2020 14:40:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603921207; cv=none; d=google.com; s=arc-20160816; b=A5TSGgJxzjPWfaI2cFYnhNwF9pS/CQCip+SWi1AkgNvURmaDGWdtVgsOuDm1iJksOd iczq7RX4tXLwbRBWnuGKw7OlRgC0C3E2nBNvXMGpTHLfdRpch6Tp59kggCn8o7fakpYC sievoGKbFYsN9oWe/pFDl8InLU0R3W0WvsFnheDVDRIyiL2lhixOgGf8GPhxwFjjcidD L9hEgwwrqhnvrt1Zq7bOF37joh0o6KqMDQVHsHmaYTe8YSdUHEgAoH1Vfy7FiRJ7Rxxg TRQZXLHvEBwvbnDCs6P7v7jf4/tZSFJs+p81MFKdS3rPnQfAaeTTxG9tZ37z5ErYYMQ2 x4WA== 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:dkim-signature; bh=q9O+TmXhlnfP5R6O9DpvzK2ercmawtIkUjzbxe45Iwg=; b=pFModHr3w6w9HIy1sHr+DsXjGi5Cd5HlRLLJKd5+5LUYBQkctGrFwSQKpF/RgYIbDc KINmfw4B/AsHuvuDklzvREdYThgr3qb/jkAgvG+BTkx6hFEyv6NKo5buIZKDjnHNUT6t eBeEw5BQmuSZZqgfpRPlK48J1tOLhV74TobH6o8dbEtMEs4S5z8EDOAKI1Ney0c23Qt3 AT3lWHLQAIb7FXgHA3QtbnyeLzOmg2/6eU9BUobYyMw7YHNFdijaT7aD+fij61/74ejx DY682WF+FDmscGvJ8slOUW9On0bwFdSLPYUAyYPrFkHqSY2fei5W+YtMnEeql/W+ZwfI oskw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=otD0MCq4; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b6si650472edu.343.2020.10.28.14.39.45; Wed, 28 Oct 2020 14:40: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; dkim=pass header.i=@google.com header.s=20161025 header.b=otD0MCq4; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1823312AbgJ0WiT (ORCPT + 99 others); Tue, 27 Oct 2020 18:38:19 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:40558 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2506756AbgJ0WiS (ORCPT ); Tue, 27 Oct 2020 18:38:18 -0400 Received: by mail-pg1-f194.google.com with SMTP id x13so1612367pgp.7 for ; Tue, 27 Oct 2020 15:38:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=q9O+TmXhlnfP5R6O9DpvzK2ercmawtIkUjzbxe45Iwg=; b=otD0MCq45wssDlOXzQwczNbnAOzRVOtZq8ghq/C9+xy1YHDSsCKD90mb3q8OLOqT04 AWo+bHszx+5HStkJxvJhg262Oqr0seRMbRPO2PwP29amCUZyYV6nax37AcvcQDidjX7k BoSPvpE0Go7t2cGoWmLGxZhAL195kZI4C8kSw6TZJsqHFC8MhcuKrPBQNyrgrfaeCY6f gWlRsRRvcroD3aYV82K9WS4hqzO3eDXAGVsUZ8YrybzSHF3qoqgYhZuSyvXSrp6Lh+1U ZIDUyXA0G3vT/1CkBNC7OodyLxOIBILUbnGwO70M3ujrcyA9spiw7g3ZCl6CzSshSTEv szCw== 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=q9O+TmXhlnfP5R6O9DpvzK2ercmawtIkUjzbxe45Iwg=; b=OJPrMQFRLtEWSl2aZBRUewbUPsmGQR78PiltafXJHC9vMJWIJZMnUePydlZiFsDJ8t Eo9p/8ifZpeNcaGzyH6mVd4fov0xn4TeRlPGA3TExh79eflbFvDU9n9UCrDXy7aTYD/z 60jWV9jOSN2qxH/uvRPx9iX6vVPIRj1TEfdZ8jqmkc4eXB9Rtn0cwP+Il2K0V0FeS7mQ CoXSAG7l+ohPMuvq24QkjTXMBla1m+77e2Vzgco6slVsV8PQg4BglsJYa2oggSXl1ZSY ymvIOSvvK7mZvNiBQ3f4yHUwS1UiEf6vufUcP+XPS+99Qg+IHnkuEog4261coLc34t6A 7VXg== X-Gm-Message-State: AOAM5313lPxR4GWqrbSe17zfJbg9J6G6a3O97bhcWx+48PU4oPtjgQ2C g/Fz5ljqHx7mzle8LqP10kleF7CfSTF4ylA7KFo4/g== X-Received: by 2002:a62:2905:0:b029:15b:57ef:3356 with SMTP id p5-20020a6229050000b029015b57ef3356mr3561178pfp.36.1603838297314; Tue, 27 Oct 2020 15:38:17 -0700 (PDT) MIME-Version: 1.0 References: <20201027205723.12514-1-ardb@kernel.org> In-Reply-To: From: Nick Desaulniers Date: Tue, 27 Oct 2020 15:38:06 -0700 Message-ID: Subject: Re: [PATCH] bpf: don't rely on GCC __attribute__((optimize)) to disable GCSE To: Ard Biesheuvel Cc: LKML , Network Development , bpf , Arnd Bergmann , Arvind Sankar , Randy Dunlap , Josh Poimboeuf , Thomas Gleixner , Alexei Starovoitov , Daniel Borkmann , Peter Zijlstra , Geert Uytterhoeven , Kees Cook Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 27, 2020 at 3:23 PM Ard Biesheuvel wrote: > > On Tue, 27 Oct 2020 at 23:03, Nick Desaulniers wrote: > > > > On Tue, Oct 27, 2020 at 2:50 PM Ard Biesheuvel wrote: > > > > > > On Tue, 27 Oct 2020 at 22:20, Nick Desaulniers wrote: > > > > > > > > On Tue, Oct 27, 2020 at 1:57 PM Ard Biesheuvel wrote: > > > > > > > > > > diff --git a/include/linux/compiler_types.h b/include/linux/compiler_types.h > > > > > index 6e390d58a9f8..ac3fa37a84f9 100644 > > > > > --- a/include/linux/compiler_types.h > > > > > +++ b/include/linux/compiler_types.h > > > > > @@ -247,10 +247,6 @@ struct ftrace_likely_data { > > > > > #define asm_inline asm > > > > > #endif > > > > > > > > > > -#ifndef __no_fgcse > > > > > -# define __no_fgcse > > > > > -#endif > > > > > - > > > > Finally, this is going to disable GCSE for the whole translation unit, > > > > which may be overkill. Previously it was isolated to one function > > > > definition. You could lower the definition of the preprocessor define > > > > into kernel/bpf/core.c to keep its use isolated as far as possible. > > > > > > > > > > Which preprocessor define? > > > > __no_fgcse > > > > But we can't use that, that is the whole point of this patch. Ah, right because the attribute drops other command line flags...ok, then -fno-gcse the whole translation unit it is then. Still need to avoid new warnings with clang though. -- Thanks, ~Nick Desaulniers