Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp692271pxx; Wed, 28 Oct 2020 14:40:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwSI7fMdKZFaG02Vbk7U81GY2Om5m4G5wWEB7qnszOHpfyRZTI/iiN7btVagclSyyWSVTUi X-Received: by 2002:a17:907:42d2:: with SMTP id ng2mr1103262ejb.124.1603921212278; Wed, 28 Oct 2020 14:40:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603921212; cv=none; d=google.com; s=arc-20160816; b=YruaWhzQeQ8cbfEnOrSUzxN3jamcZoYmLw2mtr96RnPrneRrTVHbe5frMwcLIqUpnN jnAPakQTLdAlsbMXTBzuzuP3hLMUZ/29iUIuf6SYXcrf7l3vvNWEaitbWcUHxdyZOpxq +0XNGWiQIBtY6cpRZoudR/YiW607toxeXLQObC3K6t8JmZj8zniAnrLPImYMs104z1GE 565BQbKb33Hzp8Q981Uzk4+1jT8/o3gw02PMNuWSTpgW/LY2NWCSwGjTgXCze9aTUIYV O1tqQsQcfAgFbbJv3plgpGlZP6oTnvumGKMprb+is+aQeQv1IAYqVjarDwD/g5yI7v5q q4uw== 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=BIgA23QX48XZ046Ge9ljl2tKSIQwwh1UxXCcpF43RtQ=; b=mlJZegQwXgONsUUgkCqHKhxW6Bvd22ww4Y3GSMCFSHouukikMHw9AOF8MLOdsCwqcc 1Js9C/5kJph9GA5i5hie5juiK3thN7+UPZnb5t6+8XNYGzyDRSTV/7JEqmoxNo3Hpa6C ZKsC/9cK2Op+8wkvIG/U+xyrDLlGgk01Rsd3OfH1JYYGykCfVfNRU4iEJgM6WAaH5QLm V7njToXvQlco1hIxicawCgVC52l+B8TzrizvTJAesyk6yrsdi3WASUeT+OK0BtBe/4za ijJwReOBfn/Z0B0c4hF3BDCPdish0YMsNbNfMUo21d7rr0Nd13EYQMc8sfNCI4FD7XwV CCrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=DQ4QYs8m; 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 z10si375845eje.564.2020.10.28.14.39.50; Wed, 28 Oct 2020 14:40:12 -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=DQ4QYs8m; 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 S1832146AbgJ0WDo (ORCPT + 99 others); Tue, 27 Oct 2020 18:03:44 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:45704 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760112AbgJ0WDo (ORCPT ); Tue, 27 Oct 2020 18:03:44 -0400 Received: by mail-pf1-f196.google.com with SMTP id e7so1707994pfn.12 for ; Tue, 27 Oct 2020 15:03:43 -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=BIgA23QX48XZ046Ge9ljl2tKSIQwwh1UxXCcpF43RtQ=; b=DQ4QYs8mm70+rmT6lRf4l6/moOr/APcehE0qI2sTetrRpD0rKQcuE06shQpHs4ISpv +xskUF2josJN6OZ7d1A7Szw1vnt+kuUpFQR9AMXT1EDP+t9+TC0zAGPXYCQYI2F+v573 ncdjsWm5Lk/qtYVSspLjcRFflT9AVKO93yQwXSpZpqGOZKI8TOiMPnggSNISM68S9udt G/QCm6BtoytS6FFs4Cib7tax4L4ONjrZI1HVW00ZAS1uygE38BcNPpv+dzMtTzFMC0ss +BqJM6oJmL3i3yTBUH/czr/Y7LWL8D5KjZVFlF+xNlOG+YauJn6iVtG0d7sgAr1HwTVy UYZQ== 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=BIgA23QX48XZ046Ge9ljl2tKSIQwwh1UxXCcpF43RtQ=; b=mFW9KuM+weFR98vQhCP+0QxlrNG5Pg3jwNoRN4MW2tW4vItp+oOlYTdShAp3lPIrpS CqaADxyz4xY67nSU7lOAY186OPX+e7layK8s6qJUGWt4XA27ocLSjvavXzlUsWg5YiLP DV8tf+BoITnIG7InvQtYr/22StrJLkfFMlV0nxEPEdQG79PinDo+8dk6fvqdJjdV7lyS XhuBdSlSIFhJknAlomjQ2Nqo1lNZd0BaOFOkwxN+dL4UTEVoJVwLVlTY2LJI+PgKRB2/ x8dITnbecQGF25uHPHWQHIhTq/XCj/FjTD0KW28OZ8Wtn4qJLD2BTPzIIF6ar+AZdE3c jgMA== X-Gm-Message-State: AOAM5327wQMcAm3bMdbh/SBvJbsZYhf1ybIO+Op0KERbOjwKvQeeLuTc eDiy8BR82wRflT9V20W77Y1sm4VdbzvDlT5oMcdOT8H6gYg= X-Received: by 2002:a62:ce41:0:b029:160:c0c:e03d with SMTP id y62-20020a62ce410000b02901600c0ce03dmr4426890pfg.15.1603836222920; Tue, 27 Oct 2020 15:03:42 -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:03:31 -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 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 > > > I'm fine with either approach, but we should avoid new warnings for > > clang. Thanks for the patch! -- Thanks, ~Nick Desaulniers