Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp1165253lqb; Thu, 18 Apr 2024 01:55:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVed/wcVZ1m6rAmAnzsVJ+RgWXCvyDLRiFpWkXre+twvL4MGMDt2262SHN+7wsY/BUk5vOPD0GN1OBomHaJCQSP91lXZgMISp0vjtLahw== X-Google-Smtp-Source: AGHT+IF+2EE1Z4IkaCPnPivqctr7nnDRNNfLmo7EbIdJfABrU3qC6ft4PU1OEZznwGUYdbrQ3Vqr X-Received: by 2002:a17:902:76c9:b0:1e5:3d8a:75fd with SMTP id j9-20020a17090276c900b001e53d8a75fdmr1986221plt.69.1713430555188; Thu, 18 Apr 2024 01:55:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713430555; cv=pass; d=google.com; s=arc-20160816; b=bn5NcuCJJy35JvSI8MIogQUL7qzWHjW3BRLghj85ovPihhAbhiN28tezEzGU3V9Y1x wMepZXngsQ+kEAHc8Psv/wGDTfYDmI4L2ODavJdn3n5jg7hyzo/RtfpxlMaJIregQa01 BRG10lZ02cdZpI1asBbGd4Xrp91/aZ3EpOXUmyunEb6cHBvmBP5PTsF9mnCIv2ARplsy ujkDafZ4k6bz7JjZb7JEKbUpDDRBrv6DqJMTaNjnZKctewVmho1GHuJ04BwgxKgrGUc3 eq9ul9c8p08+0skZHq0NfWg7GoS7TAhZSbLs1PXYSCF+LfpcdlwXDoesDfNJljv21K4L iTFw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=4YlIQQIdea0zY9K7SGuaix12g/A/bXwMZDxEbsfa9Qo=; fh=6RJGrRVR5IrReaFAZOld7pSxzoty3CGuoVpxlSdWrOE=; b=Uoytm/WiwNT2cuI4m3Z5dlvKKC0DzEU9KRon3XgtRtxZqLe0MkH7CJxJtdZX1fnSPC 9RZYXm0QI4PEWclwFEzkpbNTEN1yWw/10g+cjWMMZR0zBFpdQXdxDaNxOXzKeMiMrFbP V1lOTtyzkHu2QtpP7/asuAwxosQtWNnH+ys3v7bn/3OGfF/CdKuBy1AMt+6QU75qQhDp 2NPNORjkde1iCqdTBz3xk146XRrnT9UX7ZGcrFNbDKeLkiPQ2AFKub22Xkwjzf/kjSMo C8HO+LsxL60TDotwzSsgcOL9xnz06MNJNVPbcDDBfr5XuIOCtf9UpZqLIAtPp1X5V2ft xVtQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Bij8uIww; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-149753-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-149753-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id q9-20020a17090311c900b001e549d0b2c8si1044021plh.230.2024.04.18.01.55.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 01:55:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-149753-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Bij8uIww; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-149753-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-149753-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id C9F9F2828D8 for ; Thu, 18 Apr 2024 08:55:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EFCA015AABC; Thu, 18 Apr 2024 08:55:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Bij8uIww" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BFC2D15AABD for ; Thu, 18 Apr 2024 08:55:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713430529; cv=none; b=N1nA+RbRTC65um3GVxxk+qaEgOxY44WO/LgmN9XrtX/n1q/AsXbSpq9wLSKHTSmkzO5t6EZm/ZV4WgYZvuoM8kazzBgxB20ZUnEIdYvM9cuL/soPU0OqFJaY7a1nq2dkRAkZRd6Mzc5smSwDfOY5w1bvRaBDao7AZtJDYUVVgDM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713430529; c=relaxed/simple; bh=/tb4QbVu8c2QRsgW5XBC6GGQL9b2y9oos5e54hq7gZs=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=PuboodJuYXzj0GhoQS3HvunfZsx6vi1ncTB+Amq/p0UxNtBn+VktgU6BzP9c6++dZXjTpxjT1AeOUqDun/cPbSnUUdWPfr3/3Gyo0sUqUQV66zI/jLmVu71dg92dIN3x25IZNo1trpZUw+kntg4x4FqQb16XRFa6/dwdGj9QHW0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Bij8uIww; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1713430526; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4YlIQQIdea0zY9K7SGuaix12g/A/bXwMZDxEbsfa9Qo=; b=Bij8uIwwNBNiHMR6O+FRre2z71cJC/yzmozHpGBGCay6QZooWzuNFooiKtRHIptOPxWMe6 cybF0DOcAgF39Ubu3lpfYoIgf7AHWRLwEGdzGXZTGbLp/vv9PyYfxFwtKHfo37UYRnmejy 1X74KTnYOJyY2LpjSPlZ19qU2OZLAD8= Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-122-UYqEIVMdObuDwH6FZ2IYyg-1; Thu, 18 Apr 2024 04:55:25 -0400 X-MC-Unique: UYqEIVMdObuDwH6FZ2IYyg-1 Received: by mail-ed1-f69.google.com with SMTP id 4fb4d7f45d1cf-56fd91d9ec0so352236a12.1 for ; Thu, 18 Apr 2024 01:55:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713430524; x=1714035324; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4YlIQQIdea0zY9K7SGuaix12g/A/bXwMZDxEbsfa9Qo=; b=CqHLFAV2gQabsK62WNbYB3SBXPUG976MXrK2iGlzOkJv3t8Os0iVQc8TedEuJ62kWa GDCgj8i7fcexq+27nPhmjfSGKh8bqVKJVn2EQCRmXdWYr8iMXaujF3Irr61ZxUfIaHMF P4zuhcE0UoQ7vZO3TH8wLxTD1gKl9sutHr3iZN1hMYYBdy3xDWpd72VfWdMgMbdLaxv/ FWrB+kE4eWUS8EptOZA4TDTNzobGer8rQYTCgjFq5rau7DebuA35Z64pHD43NPntj/9d mLwRNjXXP4omldvAo0h/aZGUk3SZoaZSXMv2QonjmGZl4zDboAr/qh/AUsxpmekbP7Xj 3Vmw== X-Forwarded-Encrypted: i=1; AJvYcCX+zTkLzhmeZ6A/NAxEpnaIGOWXU7aKeeATqGll0zH5mvqGiLQHqUT9v9/B8iB+RVM/WnDRLylWYdZ7UADUZaekQeV6Cidrrhqv4U1+ X-Gm-Message-State: AOJu0Yx34IhH/VUEOcufqwm1F1iETULbViRkSMVXWcnUsA0NEIHpHDwf QobeL0Zj0au8eHxgIniOcyOWDknijs2vG7Rx32nCoM3wjqcL1ZTJxE58W3zf2RsbYWQaFg6KVmf DgK9GkQ95ffLuieUJ3h5tOWsQCJ2DkY6HruhVs671PhgvwuiJt47dqILcx26bj8VIowft577YwP AAnrrgKyvW1zQJoxMzykgo+WjmJJvAsR+b6/3p X-Received: by 2002:a50:d70b:0:b0:566:d333:45e8 with SMTP id t11-20020a50d70b000000b00566d33345e8mr1330884edi.20.1713430524385; Thu, 18 Apr 2024 01:55:24 -0700 (PDT) X-Received: by 2002:a50:d70b:0:b0:566:d333:45e8 with SMTP id t11-20020a50d70b000000b00566d33345e8mr1330856edi.20.1713430523993; Thu, 18 Apr 2024 01:55:23 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240416-bpf_wq-v1-0-c9e66092f842@kernel.org> <20240416-bpf_wq-v1-16-c9e66092f842@kernel.org> In-Reply-To: From: Benjamin Tissoires Date: Thu, 18 Apr 2024 10:55:11 +0200 Message-ID: Subject: Re: [PATCH bpf-next 16/18] selftests/bpf: add checks for bpf_wq_set_callback() To: Song Liu Cc: Benjamin Tissoires , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Mykola Lysenko , Shuah Khan , bpf@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Apr 18, 2024 at 5:25=E2=80=AFAM Song Liu wrote: > > On Tue, Apr 16, 2024 at 7:11=E2=80=AFAM Benjamin Tissoires wrote: > [...] > > > +SEC("?tc") > > +__log_level(2) > > +__failure > > +/* check that the first argument of bpf_wq_set_callback() > > + * is a correct bpf_wq pointer. > > + */ > > +__msg("mark_precise: frame0: regs=3Dr1 stack=3D before") > > This line and some other "mark_precise" lines are causing issues for > test_progs-no_alu32 in the CI. I can reproduce it in my local tests. > Indeed. I can also reproduce locally. Here, it only happens for test_wq_init_nomap() and test_wq_init_wrong_map(). TBH, I'm not sure what "precise" means, I just copied the checks from timer_failures.c. > > I am not quite sure what is the best fix. Maybe we can just > remove it. Given that most of the code is shared with timer, but given that we are working with kfuncs, we are not using the same r0 registers. So yeah, I would think we could rely on the timer tests for precise, and drop them here... Cheers, Benjamin > > > Thanks, > Song > > > +__msg(": (85) call bpf_wq_set_callback_impl#") /* anchor message */ > > +__msg("off 1 doesn't point to 'struct bpf_wq' that is at 0") > > +long test_wrong_wq_pointer_offset(void *ctx) > > +{ > > + int key =3D 0; > > + struct bpf_wq *wq; > > + > > + wq =3D bpf_map_lookup_elem(&array, &key); > > + if (!wq) > > + return 1; > > + > > + if (bpf_wq_init(wq, &array, 0)) > > + return 2; > > + > > + if (bpf_wq_set_callback((void *)wq + 1, wq_cb_sleepable, 0)) > > + return 3; > > + > > + return -22; > > +} > > > > -- > > 2.44.0 > > >