Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp186787pxb; Tue, 2 Feb 2021 02:35:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJwd3+GRQ4tdg6HhWlymRNYIOS79xcLizx1C+2u9PF8p//RU/5LlbLbH1GdVjkV0TaqZrR1O X-Received: by 2002:a50:9dc9:: with SMTP id l9mr22787121edk.377.1612262112001; Tue, 02 Feb 2021 02:35:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612262111; cv=none; d=google.com; s=arc-20160816; b=cNDyiLxqd0KOU/T6/++JB8AX0A2CO3LEdJUaFtPmQzEbtYBZjrVRzmV0GFN7FC/83+ 8d1oH7BkrQXUES95Zoso1sL/HRz+GtO1xED+QZ6xnb7BVO0Zivk3yfGKz8tn6rKVZUkS zfngaDLQhrUEEAOS10S3upcxcK3AsR9a/VpT1GLN4juxgSZjt71eHvxMZSQhNW4fpJfo vOO6udUGzSKEZGNhxazdFbHe8fSoOl2Vzh2asmiAfrRFni4FAytMLtKN+uNSg6lctcQA DuvHTwAcINg4YA6Y51RGpZHL8nJLJI4o57aM+UxPyiF9kR0DDcbkruBzmQ/Dg6F1gXyA gQVQ== 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=tPdWi+1T3ztUzlnN8yjB/oPmxXYXNfRoTAThbMXnPgQ=; b=O1tKNyUR5qZj6dDaKlXltLoqRZq6paOWrpq4xNkOX3B89z8cWyvkZGKEZ/mkstZTxV mHIrgoIjNZQMBEUHLMuVCAgjAsBUZZL5gL4b2kjJry01qh0L1KKMcwTHpHt74LszKWFb CGn88nY+qOZthAAMXrYV2Hc6qTmQOfk4UpGl1k8g+WU4AmuMP211QGGxI/SS+FPyNm7k FfsD49k9xmZcyfQRTtknhmsuYoffW/tI/q4crhenf32Fgk5JOfZrKU9njU2Z+EGAy+y+ A2lGsthwR4EDK8lV0P5lwAJFYBXxq9iK2MAmL1ukpO9vr7pJTrcyIfBN6ErVjsbSP08a hpTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=RRZ5Vd93; 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 24si16596158edv.406.2021.02.02.02.34.46; Tue, 02 Feb 2021 02:35:11 -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=RRZ5Vd93; 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 S229910AbhBBKcU (ORCPT + 99 others); Tue, 2 Feb 2021 05:32:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229877AbhBBKcS (ORCPT ); Tue, 2 Feb 2021 05:32:18 -0500 Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94D74C06174A for ; Tue, 2 Feb 2021 02:31:38 -0800 (PST) Received: by mail-io1-xd29.google.com with SMTP id s24so9144885iob.6 for ; Tue, 02 Feb 2021 02:31:38 -0800 (PST) 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=tPdWi+1T3ztUzlnN8yjB/oPmxXYXNfRoTAThbMXnPgQ=; b=RRZ5Vd938ncCdZoiFKgt+V4lgoyNzF751ORfRaNDfRZaM4ZZcz1kC4sSzGtuMITRzr OnHE+UZ7ErpU+qEWDMjTz/IM7QCCYRJvGM9GUUaBs8VqiF7Zw74TZl9mnhyazmILjeS5 h2aWU8ycvcb/HJQTI9uWU3mzLTz9afITIgV+hYb73xQMGvRMtnSW/8xE75jEKaWc+ANu 8fXC/99NBHmjBv7CgH+NBvYuMfLzMngcRQLJxnGpkFSrxswssITH2W7VQW963hpaeWmS rg7aIslhRyVCgW18ka8c3eXqbAgDdkINtTDN3oVTf9usVlVIaeanBsX3GTIPBV2qrz2N 6rwQ== 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=tPdWi+1T3ztUzlnN8yjB/oPmxXYXNfRoTAThbMXnPgQ=; b=EMo2H4PFbrzks7ZSLuD08BPQnNITpCa3VBEUeXLo6yRXb4MAn0L/vw6xNaUvKpbIev kafHLQB63Qr1zJUXx5RVP9QV07Z1kXvODel9zKQWkrYN1+TXkT+7JbFyI9DuOOcNL8JT cx+fB4hkipNk4YTXfJAHoHwIgNiWI+fiuWsw023sUhDIkCPKdkseqG+mdmXfMe5ihUhN 4V18OrbyYpYKtbroLsxfkdELDv2UqE20erVEaLtsfiebvxOQoWCtJMZY/cJXJucyOfZa RT0nGuWDE6AQr2Aw0pZBTi7e1WNuU3w23wKvwZsA1W0tp+FVFtDySphPWGqxmzf+njah TBfw== X-Gm-Message-State: AOAM531LnE2F6X8CWh5BC0ae43IC2MhAP1OpvWxOCtwAjfRjInWPDX1J Cai0TzzgcOHKGWGIdtGZ3ydgPp56GJhA8jgaOCleLA== X-Received: by 2002:a6b:7b06:: with SMTP id l6mr17018406iop.199.1612261897820; Tue, 02 Feb 2021 02:31:37 -0800 (PST) MIME-Version: 1.0 References: <20210201150028.2279522-1-jackmanb@google.com> In-Reply-To: From: Brendan Jackman Date: Tue, 2 Feb 2021 11:31:26 +0100 Message-ID: Subject: Re: [PATCH bpf-next v2] bpf: Propagate memory bounds to registers in atomics w/ BPF_FETCH To: Alexei Starovoitov Cc: bpf , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , KP Singh , Florent Revest , John Fastabend , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2 Feb 2021 at 00:27, Alexei Starovoitov wrote: > > On Mon, Feb 1, 2021 at 7:00 AM Brendan Jackman wrote: > > + > > +SEC("fentry/bpf_fentry_test1") > > +int BPF_PROG(sub, int x) > > +{ > > + int a = 0; > > + int b = __sync_fetch_and_add(&a, 1); > > It probably needs ENABLE_ATOMICS_TESTS ? > > Otherwise clang without -mcpu=v3 will complain: > "fatal error: error in backend: Invalid usage of the XADD return value" Ah yep of course, thanks for spotting. v3 incoming...