Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp806876pxu; Thu, 3 Dec 2020 13:10:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJxM2IY8vmVX4UGllg53IBEHXXXtf87QXvF/mbVknXAxMPEhclTXICdKC5Fr1CI+ucdnm0u5 X-Received: by 2002:a50:b264:: with SMTP id o91mr4631294edd.7.1607029822486; Thu, 03 Dec 2020 13:10:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607029822; cv=none; d=google.com; s=arc-20160816; b=d1/J6YpsHS+FTa7BwrpnSYZetOdIRibvfH2GJ2difsA54CYLvZQB7yi2veu3NeoCYN HkuPYfu8DO6/IQgwOb4BdB3gj18y4DHxXXc77lleZI+YbfDDVisVhL60qxE79oOKzFCs nRS8QeOcRILDfU1RbVn/U067bIGiKvQIfhrWIyjifgLvcoFpA8VHhknhfGCoDt9+rkIi m4e6HFEGP/D0EUnxbMzHoYMc1LiDrfhShaPx2ARSNu/YUHTPOz+aV/aWXT7ohGaz8ZMg QBdOtJdtfLNnguLFS2untr/RT4KDUAjowbMUlTsTeL1XTRVn2X6yR6ZM+pQJ0x1boHdH qoiA== 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=D96ntruvKNHwhJI4N9JZfzOeYobqLQ+gufOr4VkC1bk=; b=Wl2UfdZEMz6VyJNCxcbLiV74oYfX+SVmLX4V9esVByP3kDi/q0g2QQmnmOHpEGWQOo ztc27Y+lCkAHr4znkBaav07EPoxL4Bo8zcpLsKu3AmiRSx2U5UFgEX3B7IIUyabr+pdm j/hdPWtIJuRL3xwlxB5L4au7nqZXghVvfSpIyKDIhU380fo1h1BTcI38jO1YQNip4XnJ 5Oj2zjhnog/KZWbdN4++woT+85D11ta1eSqdYkf5aOEvPaSNve1uKzihTv9yn0rcljBI b/NkxJOHVD1/p/nC0PwsXXOIP0LjAa9vK31bdnK8i/GX2d/pEJZntfAlktlUCcDLU2O9 Emgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NCpz16V4; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q10si122381ejp.175.2020.12.03.13.09.12; Thu, 03 Dec 2020 13:10:22 -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=@gmail.com header.s=20161025 header.b=NCpz16V4; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727460AbgLCVDb (ORCPT + 99 others); Thu, 3 Dec 2020 16:03:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726928AbgLCVDb (ORCPT ); Thu, 3 Dec 2020 16:03:31 -0500 Received: from mail-yb1-xb44.google.com (mail-yb1-xb44.google.com [IPv6:2607:f8b0:4864:20::b44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F152DC061A4F; Thu, 3 Dec 2020 13:02:44 -0800 (PST) Received: by mail-yb1-xb44.google.com with SMTP id k65so3344136ybk.5; Thu, 03 Dec 2020 13:02:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=D96ntruvKNHwhJI4N9JZfzOeYobqLQ+gufOr4VkC1bk=; b=NCpz16V4A8mC4sxO+He2ZjqFqMJwgbrNEba7nwUjJarpcGXTuxgGds3FHa19cKYz8l Z3KiO9kQRWoZO+wvT3w2txPm1P1P01jIhtcFdphQ5QV5WLwDr0SRYrFdPz5VMBvojRT9 xUtmg7UXISeP+wC7FeuRUAA6JoOtzw5kRmMsZVqwxa4PXCGAKQW0kCelfW4pZDfYb2qz jo9abkq3ESsni4Q/2CgTZ7tk5TiJ/EUa7XjW+tvEX/uSgXKQODMqLcyotAEJAIDxKlqM e/mvRGXpRXfFGTp7I1PlKrPvXM3uiMnPnXx75AhwX+kaihn0f95cM/9dmjdxkXJzE89b EPnA== 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=D96ntruvKNHwhJI4N9JZfzOeYobqLQ+gufOr4VkC1bk=; b=OjWDCuhpu8M1fpKM8M/VUZPBAROQowxXzPH2IWX2ZHpd+wxtgU1EmLCrTjOKRz32Yc xP2yo35J87P+Ke6AzT7Zi6JcNP07eMN2brRAA7xKRxhJ+6KTGNCmyHgTw6/zgfv+VEV4 iP7BdX4cn1piAVqbZ8/NVWgvfHvM9GmJzzP8jJB3JN5/vZjIL/TMx6B6bVCF8gYLjrak +6memyEPqvug0asKIkIr6UT77h8HC0RAyP62Q+h9ahLBa9ElI6xCOi/3EKkb7uCW9HFf A6yAQzdGHqesgJetve2sNRd5Q36y0j3m+tRYMItiiOnaxA8ibS101BziWPCPJAw36RxY iTpw== X-Gm-Message-State: AOAM532feGcB8tP9eibPv18EVkzpexmdcAoi3McV/RAyFD2HPc2ekumx 3r9Y4lHxGpDRoeiTWKCv6IUOvYXLW73d4adPTzU= X-Received: by 2002:a25:2845:: with SMTP id o66mr1540517ybo.260.1607029364337; Thu, 03 Dec 2020 13:02:44 -0800 (PST) MIME-Version: 1.0 References: <20201203160245.1014867-1-jackmanb@google.com> <20201203160245.1014867-12-jackmanb@google.com> In-Reply-To: <20201203160245.1014867-12-jackmanb@google.com> From: Andrii Nakryiko Date: Thu, 3 Dec 2020 13:02:33 -0800 Message-ID: Subject: Re: [PATCH bpf-next v3 11/14] tools build: Implement feature check for BPF atomics in Clang To: Brendan Jackman Cc: bpf , Alexei Starovoitov , Yonghong Song , Daniel Borkmann , KP Singh , Florent Revest , open list , Jann Horn , Arnaldo Carvalho de Melo , Jiri Olsa , Quentin Monnet , "Frank Ch. Eigler" , Stephane Eranian , Namhyung Kim , Thomas Hebb Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 3, 2020 at 8:08 AM Brendan Jackman wrote: > > Change-Id: Ia15bb76f7152fff2974e38242d7430ce2987a71e > See recent discussion on KP's patch set. There needs to be a commit message, even if it's just a copy/paste of subject line. But see also my other reply, I'm not sure it's worth it to do it this way for selftests. > Cc: Arnaldo Carvalho de Melo > Cc: Jiri Olsa > Cc: Quentin Monnet > Cc: "Frank Ch. Eigler" > Cc: Stephane Eranian > Cc: Namhyung Kim > Cc: Thomas Hebb > Change-Id: Ie2c3832eaf050d627764071d1927c7546e7c4b4b > Signed-off-by: Brendan Jackman > --- > tools/build/feature/Makefile | 4 ++++ > tools/build/feature/test-clang-bpf-atomics.c | 9 +++++++++ > 2 files changed, 13 insertions(+) > create mode 100644 tools/build/feature/test-clang-bpf-atomics.c > > diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile > index cdde783f3018..81370d7fa193 100644 > --- a/tools/build/feature/Makefile > +++ b/tools/build/feature/Makefile > @@ -70,6 +70,7 @@ FILES= \ > test-libaio.bin \ > test-libzstd.bin \ > test-clang-bpf-co-re.bin \ > + test-clang-bpf-atomics.bin \ > test-file-handle.bin \ > test-libpfm4.bin > > @@ -331,6 +332,9 @@ $(OUTPUT)test-clang-bpf-co-re.bin: > $(CLANG) -S -g -target bpf -o - $(patsubst %.bin,%.c,$(@F)) | \ > grep BTF_KIND_VAR > > +$(OUTPUT)test-clang-bpf-atomics.bin: > + $(CLANG) -S -g -target bpf -mcpu=v3 -Werror=implicit-function-declaration -o - $(patsubst %.bin,%.c,$(@F)) 2>&1 > + > $(OUTPUT)test-file-handle.bin: > $(BUILD) > > diff --git a/tools/build/feature/test-clang-bpf-atomics.c b/tools/build/feature/test-clang-bpf-atomics.c > new file mode 100644 > index 000000000000..8b5fcdd4ba6f > --- /dev/null > +++ b/tools/build/feature/test-clang-bpf-atomics.c > @@ -0,0 +1,9 @@ > +// SPDX-License-Identifier: GPL-2.0 > +// Copyright (c) 2020 Google > + > +int x = 0; > + > +int foo(void) > +{ > + return __sync_val_compare_and_swap(&x, 1, 2); > +} > -- > 2.29.2.454.gaff20da3a2-goog >