Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp3186901pxb; Tue, 12 Jan 2021 08:22:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJx8vesCvXr1bIYIw9ySoPBpp+bsoNtRW5xukKUjWkqRNq8K+YvhvPy9iahhymUkD20I9u5c X-Received: by 2002:a17:906:7804:: with SMTP id u4mr3819092ejm.97.1610468573386; Tue, 12 Jan 2021 08:22:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610468573; cv=none; d=google.com; s=arc-20160816; b=WhbLhiITbrWbcvg8PtC01qs/m9c9eHv0nVn4+d4ViI5UQTlDuLZDlk8CrG5hcjZUZQ M+VnutYvKAcNEH8jgjxcYAgmDRnBFuznRicAbR9BUNxnkLYq41sGb/Zr0uI9zsUimLDs wpMDrp1r//VnoBm8MQXGShoJj2gE6e1VC+m27jXLP6FOuiaphSjW8lwncLQHGlN3slb/ MJ5e7MOyoHBiFv36tzkqrGr37uwn49Mws3HHWor4s52KHBwN/wQCpPvNUvJx3y3pQlys jHqfr0oRrQgm+k0lDSDmiBoCKhxTBlFjOGffShz0hbE6FRn1hPPSZvplGVkKFiWWRhyA Z6hg== 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=CoI1g52qNIryGpFWepCTL4prXOBxmbo4WiGrzxRBQlA=; b=uqJyXtN96g7JRQSMRFbTZ+rJA26BKm8AqRXFGzRxV5joiDjt/C42DgvN+cbind7V/E L553ksp5Cm71GH4/Cgf7sHEJE0jGH9GzJ844fSt2Jk/GkozdC6wpzcxyuSaqBJSEudCw qDxPW4naZO4HNdB2nRNoVj4MYTAoNvHLbjy6wKdyFa4kgatUhHI5hMZBikPPLjBw3dVD lywKVMV7mjRyoxe5Y5XBlh8sDNs5Bk1/Hh5R5jF5bhMFg7V+J927mh3YGKej7Tv7Vsd0 Ig5WotqxIs+290SNlHYD9aY8ShjJJL2IACYszk3QbSfacZiyrNUQQrIM6Q6xo/YF+I0o TRRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JJVzSHdg; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d92si1596189edd.33.2021.01.12.08.22.29; Tue, 12 Jan 2021 08:22:53 -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=@kernel.org header.s=k20201202 header.b=JJVzSHdg; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406509AbhALQSc (ORCPT + 99 others); Tue, 12 Jan 2021 11:18:32 -0500 Received: from mail.kernel.org ([198.145.29.99]:53618 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406511AbhALQSU (ORCPT ); Tue, 12 Jan 2021 11:18:20 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id A9E0523121 for ; Tue, 12 Jan 2021 16:17:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1610468260; bh=CoI1g52qNIryGpFWepCTL4prXOBxmbo4WiGrzxRBQlA=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=JJVzSHdgO1ws6H/D24wVXlrgHNqXtP+dlwOmTRrVvjDaJMavwKl00ORf0Sq7tdDtE n8oulnveMEUZ7FWxrvEbctTohR2Z9hE85YJGMYRYUnkOSTVTPkNSGg7A1NYNAXIvcB O2deKc9s5kBQF7ouaaTvie2lytEIXJ4OENfHkrtNxPHZoXU4NP3ncDwIy9s5ZfMhOy TdsVLPYFJniq2pEuDIvMFUgZO2Hj13yEO4h73mr+gQCt2uN3mBbG1WRRGyLsT5VuWA 3R8AEoUCzrwzD7GA2NM9EgeR3t24E5TEGLeZyMkT3H49kBAA82wZt/CLk8NRwdIMOB cUM4L64Fj1wvg== Received: by mail-lf1-f41.google.com with SMTP id s26so4195398lfc.8 for ; Tue, 12 Jan 2021 08:17:39 -0800 (PST) X-Gm-Message-State: AOAM532mo2kvQAM/fFG3LKPaPLA4EOrj34r4uWbJOwIaPz2UQQlBGLEG uYRPcWn9WPF16cLF9zxKgTup/IbrSLpt0o5xLIJuOQ== X-Received: by 2002:a19:cbd8:: with SMTP id b207mr2542971lfg.550.1610468257650; Tue, 12 Jan 2021 08:17:37 -0800 (PST) MIME-Version: 1.0 References: <20210112091545.10535-1-gilad.reti@gmail.com> <60034a79-573f-125c-76b0-17e04941a155@iogearbox.net> In-Reply-To: <60034a79-573f-125c-76b0-17e04941a155@iogearbox.net> From: KP Singh Date: Tue, 12 Jan 2021 17:17:26 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 2/2] selftests/bpf: add verifier test for PTR_TO_MEM spill To: Daniel Borkmann Cc: Gilad Reti , bpf , Shuah Khan , Alexei Starovoitov , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , linux-kselftest@vger.kernel.org, Networking , open list Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 12, 2021 at 4:43 PM Daniel Borkmann wrote: > > On 1/12/21 4:35 PM, Gilad Reti wrote: > > On Tue, Jan 12, 2021 at 4:56 PM KP Singh wrote: > >> On Tue, Jan 12, 2021 at 10:16 AM Gilad Reti wrote: > >>> > >>> Add test to check that the verifier is able to recognize spilling of > >>> PTR_TO_MEM registers. > >> > >> It would be nice to have some explanation of what the test does to > >> recognize the spilling of the PTR_TO_MEM registers in the commit > >> log as well. > >> > >> Would it be possible to augment an existing test_progs > >> program like tools/testing/selftests/bpf/progs/test_ringbuf.c to test > >> this functionality? > > How would you guarantee that LLVM generates the spill/fill, via inline asm? Yeah, I guess there is no sure-shot way to do it and, adding inline asm would just be doing the same thing as this verifier test. You can ignore me on this one :) It would, however, be nice to have a better description about what the test is actually doing./ > > > It may be possible, but from what I understood from Daniel's comment here > > > > https://lore.kernel.org/bpf/17629073-4fab-a922-ecc3-25b019960f44@iogearbox.net/ > > > > the test should be a part of the verifier tests (which is reasonable > > to me since it is > > a verifier bugfix) > > Yeah, the test_verifier case as you have is definitely the most straight > forward way to add coverage in this case.