Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2301696pxu; Mon, 7 Dec 2020 03:04:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJwzI8vy36L4mXVWRvd8xt5k581PfFpRA/Xfjq6TLTz0IhKjyneeZtvxms3u/dhPbWmMQz+N X-Received: by 2002:a05:6402:d0a:: with SMTP id eb10mr19641681edb.305.1607339044323; Mon, 07 Dec 2020 03:04:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607339044; cv=none; d=google.com; s=arc-20160816; b=JsxXKg/Nhk+wTMrSOcviTd23ZVGDEVKqSQJUe2riDnls4gg/aAKJJBXpSjkVzQXaBw 4wIp3anZ4KqVVcEHj2JKLSxhmL7yLfHejRu6XstSWHm98IiOQvSp6yvIcn8HRjjaJHH2 NMcN8lEO+vW9SWzX3MBkmO13S5KsUAjowkB40+odjIif0i8J1XNCtB7zCCMbANUvXuex e36ugCt3wW6LbSBTUAUX9ka4MONS/9kK1j5frOOo/sOpU1DasNTC9zA7G18Bhdu5tYBm H+2EX2HAFRzKst/PeRrUqxSqKS9zb1e/ijKjYIZM1AV9b8dXpEnn2iIqBJONc+gPCt3p 8xIA== 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:from:date:dkim-signature; bh=Of1GuHMcacZDGavR17lWzfhPO8aTLH8wtw5w1WkEg9o=; b=U6BY9isNd3zQuyIcURoSWr2GU34KQ34qyVX41A5cqwgPKPU098m9ixCSdk6oXdkz8s vZ7O+2oADOe8PK5pYC8XqT06FRqNJzOrv+/ZqO4et2pZTQevMddbMkL3KZLPWwMtMzqH HDx4DwY+AsdTGn5zMBKcj/nqsXWg0L4qicYfH+HiQhSEiNvhQKMxeoC54HihzU1HILZE HYmJMCKranO/mJ2ztog9h8teIRA2c9P7wVKxHulEhsE6QNgtOE884pydL4R4SenqrVuQ uEsyE9WYnDS3oGy2BSMyTtH131LSdXg05jf+/aXjHzMNYBRenkHQQ8JDbqnHFi3nmmiP vVSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=k6q6RJ7s; 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 t6si5930538ejr.116.2020.12.07.03.03.41; Mon, 07 Dec 2020 03:04:04 -0800 (PST) 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=k6q6RJ7s; 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 S1726468AbgLGLBB (ORCPT + 99 others); Mon, 7 Dec 2020 06:01:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725842AbgLGLBA (ORCPT ); Mon, 7 Dec 2020 06:01:00 -0500 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22B96C0613D0 for ; Mon, 7 Dec 2020 03:00:20 -0800 (PST) Received: by mail-wr1-x441.google.com with SMTP id l9so3175170wrt.13 for ; Mon, 07 Dec 2020 03:00:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Of1GuHMcacZDGavR17lWzfhPO8aTLH8wtw5w1WkEg9o=; b=k6q6RJ7sx6u0IFHGYe2vKIzMETe6DHIaz1Kof74EDPeou+CDRGX+hbJRk3sp0JBPYF dkVr80dVeWeDj7oa7wAWYCXvPntVHXrKGfSUkKB1W2lbLuzMy1blmizUyG6iM6RScldV x2qjf3B5jtnRjsS/iD6dNc5voF1y/3gp198Hb1H/vzmYBwvyvf2cQTrbMVH97hmsK3K8 fCZ0MYw694cycyaQ3SfAtSRpSX59L58X0TazgGXZeaK4M/8DvVUjXYZhRdulwbkFTT+r GBXimEUMTcyRshSZwdIXCgbGQUYyNwho7pJLjcUhs1nh/AgyziAvdVRT0goGozmvlBl1 VvgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Of1GuHMcacZDGavR17lWzfhPO8aTLH8wtw5w1WkEg9o=; b=NndzluWtlh2SFloSNg22evYcFWwztQHcKRyuRDeFGViQU3L2CMexVhk21jUQIoCkTW PvH+nZwgQ24yUZMYPeiLzTDE1/SRBZJfZo2PnEEz9CcW3hs1PH9guxncRnNJT35C+9fE UmBgUBpwo+Qfulh0AUNXeT397f2lGUep166SDW4dCguZ5/40LQ9/PKoBlc1A3CMDDG4k TXrySeRetcrfmcgrDJiDogpIo5Ff+LDohawZFuGECSbHm8Dar+YqkzBqdJ+lB9Lx1VKZ FuCJXn8oX797vAw4J7n4RffRfqV93Pyb7VvQ754ATxG1Kw/77U34lNcqOTbRJrvrlZWO O+WA== X-Gm-Message-State: AOAM532alTdYGHS5B6Gk4/wj1+FOMR0uQNuiLGXkcUzPIJUuuBiWy5vf paLjCFZOWEz6UsThQgx1xhQBaw== X-Received: by 2002:adf:c986:: with SMTP id f6mr12341682wrh.361.1607338818674; Mon, 07 Dec 2020 03:00:18 -0800 (PST) Received: from google.com (203.75.199.104.bc.googleusercontent.com. [104.199.75.203]) by smtp.gmail.com with ESMTPSA id z8sm13066080wmg.17.2020.12.07.03.00.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Dec 2020 03:00:17 -0800 (PST) Date: Mon, 7 Dec 2020 11:00:13 +0000 From: Brendan Jackman To: Andrii Nakryiko Cc: bpf , Alexei Starovoitov , Yonghong Song , Daniel Borkmann , KP Singh , Florent Revest , open list , Jann Horn Subject: Re: [PATCH bpf-next v3 12/14] bpf: Pull tools/build/feature biz into selftests Makefile Message-ID: References: <20201203160245.1014867-1-jackmanb@google.com> <20201203160245.1014867-13-jackmanb@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 04, 2020 at 11:00:24AM -0800, Andrii Nakryiko wrote: > On Fri, Dec 4, 2020 at 1:41 AM Brendan Jackman wrote: > > > > On Thu, Dec 03, 2020 at 01:01:27PM -0800, Andrii Nakryiko wrote: > > > On Thu, Dec 3, 2020 at 8:07 AM Brendan Jackman wrote: > > > > > > > > This is somewhat cargo-culted from the libbpf build. It will be used > > > > in a subsequent patch to query for Clang BPF atomics support. > > > > > > > > Change-Id: I9318a1702170eb752acced35acbb33f45126c44c > > > > > > Haven't seen this before. What's this Change-Id business? > > > > Argh, apologies. Looks like it's time for me to adopt a less error-prone > > workflow for sending patches. > > > > (This is noise from Gerrit, which we sometimes use for internal reviews) > > > > > > Signed-off-by: Brendan Jackman > > > > --- > > > > tools/testing/selftests/bpf/.gitignore | 1 + > > > > tools/testing/selftests/bpf/Makefile | 38 ++++++++++++++++++++++++++ > > > > 2 files changed, 39 insertions(+) > > > > > > All this just to detect the support for clang atomics?... Let's not > > > pull in the entire feature-detection framework unnecessarily, > > > selftests Makefile is complicated enough without that. > > > > Then the test build would break for people who haven't updated Clang. > > Is that acceptable? > > > > I'm aware of cases where you need to be on a pretty fresh Clang for > > tests to _pass_ so maybe it's fine. > > I didn't mean to drop any detection of this new feature. I just didn't > want a new dependency on tools' feature probing framework. See > IS_LITTLE_ENDIAN and get_sys_includes, we already have various feature > detection-like stuff in there. So we can do this with a one-liner. I > just want to keep it simple. Thanks. Ah right gotcha. Then yeah I think we can do this: BPF_ATOMICS_SUPPORTED = $(shell \ echo "int x = 0; int foo(void) { return __sync_val_compare_and_swap(&x, 1, 2); }" \ | $(CLANG) -x cpp-output -S -target bpf -mcpu=v3 - -o /dev/null && echo 1 || echo 0)