From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 873B9C433E6 for ; Tue, 12 Jan 2021 15:44:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3AD6323133 for ; Tue, 12 Jan 2021 15:44:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405080AbhALPoH (ORCPT ); Tue, 12 Jan 2021 10:44:07 -0500 Received: from www62.your-server.de ([213.133.104.62]:56640 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404536AbhALPoD (ORCPT ); Tue, 12 Jan 2021 10:44:03 -0500 Received: from sslproxy03.your-server.de ([88.198.220.132]) by www62.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92.3) (envelope-from ) id 1kzLpI-000Dp0-KM; Tue, 12 Jan 2021 16:43:20 +0100 Received: from [85.7.101.30] (helo=pc-9.home) by sslproxy03.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kzLpI-000KzU-Bo; Tue, 12 Jan 2021 16:43:20 +0100 Subject: Re: [PATCH 2/2] selftests/bpf: add verifier test for PTR_TO_MEM spill To: Gilad Reti , KP Singh Cc: bpf , Shuah Khan , Alexei Starovoitov , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , linux-kselftest@vger.kernel.org, Networking , open list References: <20210112091545.10535-1-gilad.reti@gmail.com> From: Daniel Borkmann Message-ID: <60034a79-573f-125c-76b0-17e04941a155@iogearbox.net> Date: Tue, 12 Jan 2021 16:43:19 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.102.4/26047/Tue Jan 12 13:33:56 2021) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? > 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.