linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Gabriele Paoloni <gpaoloni@redhat.com>
Cc: shuah@kernel.org, linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org, corbet@lwn.net,
	linux-doc@vger.kernel.org, linux-mm@kvack.org,
	safety-architecture@lists.elisa.tech, acarmina@redhat.com,
	kstewart@linuxfoundation.org, chuckwolber@gmail.com
Subject: Re: [RFC v2 PATCH 3/3] selftests/devmem: initial testset
Date: Tue, 21 Oct 2025 09:35:05 +0200	[thread overview]
Message-ID: <2025102151-distill-operate-a748@gregkh> (raw)
In-Reply-To: <20250910170000.6475-4-gpaoloni@redhat.com>

On Wed, Sep 10, 2025 at 07:00:00PM +0200, Gabriele Paoloni wrote:
> From: Alessandro Carminati <acarmina@redhat.com>
> 
> This patch introduces a new series of tests for devmem.
> Test cases are mapped against the tested Function's expectations
> defined in /drivers/char/mem.c.

Cool, but:

> 
> Signed-off-by: Alessandro Carminati <acarmina@redhat.com>
> ---
>  tools/testing/selftests/Makefile         |   1 +
>  tools/testing/selftests/devmem/Makefile  |  13 +
>  tools/testing/selftests/devmem/debug.c   |  25 +
>  tools/testing/selftests/devmem/debug.h   |  14 +
>  tools/testing/selftests/devmem/devmem.c  | 200 ++++++++
>  tools/testing/selftests/devmem/ram_map.c | 250 ++++++++++
>  tools/testing/selftests/devmem/ram_map.h |  38 ++
>  tools/testing/selftests/devmem/secret.c  |  46 ++
>  tools/testing/selftests/devmem/secret.h  |  13 +
>  tools/testing/selftests/devmem/tests.c   | 569 +++++++++++++++++++++++
>  tools/testing/selftests/devmem/tests.h   |  45 ++
>  tools/testing/selftests/devmem/utils.c   | 379 +++++++++++++++
>  tools/testing/selftests/devmem/utils.h   | 119 +++++

That's a lot of files for a "simple" test.  Doesn't LTP have tests for
this api already?  Why not use that here instead?

Also, this is userspace testing, not kunit testing, right, is that
intentional?  You are documenting internal apis and then writing
userspace tests for those apis, which feels a bit odd.

Also /dev/mem should not be used on "modern" systems, so how was this
tested?

> +// SPDX-License-Identifier: GPL-2.0+

Are you _sure_ you want GPLv2+?  I have to ask, sorry.

> +/*
> + * devmem test debug.c
> + *
> + * Copyright (C) 2025 Red Hat, Inc. All Rights Reserved.
> + * Written by Alessandro Carminati (acarmina@redhat.com)
> + */
> +
> +#include <stdio.h>
> +#include <stdarg.h>
> +
> +#define DEBUG_FLAG 0
> +int pdebug = DEBUG_FLAG;

That's a funny define that is never used elsewhere.  I'm guessing this
was cut/pasted from some other userspace code somewhere?

> +
> +void deb_printf(const char *fmt, ...)

Who is "deb"?  You have more letters, always use them :)

Also, why debugging for just this one set of tests?  Don't kselftests
already have debugging logic?  if not, why is this unique to require it?

And am I missing something, or does this new tool not tie into the
kselftest framework properly?  I see lots of printing to output, but not
in the proper test framework format, am I just missing that somewhere?

thanks,

greg k-h


  reply	other threads:[~2025-10-21  7:35 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-10 16:59 [RFC PATCH v2 0/3] Add testable code specifications Gabriele Paoloni
2025-09-10 16:59 ` [RFC v2 PATCH 1/3] Documentation: add guidelines for writing " Gabriele Paoloni
2025-09-15 22:33   ` Jonathan Corbet
2025-09-17 15:24     ` Gabriele Paoloni
2025-10-20 19:35     ` David Hildenbrand
2025-10-20 20:54       ` Chuck Wolber
2025-10-20 21:02       ` Chuck Wolber
2025-10-21 15:37         ` David Hildenbrand
2025-10-21 16:27           ` Gabriele Paoloni
2025-10-21 16:34             ` David Hildenbrand
2025-10-21 16:43               ` Gabriele Paoloni
2025-09-10 16:59 ` [RFC v2 PATCH 2/3] /dev/mem: Add initial documentation of memory_open() and mem_fops Gabriele Paoloni
2025-09-15 22:39   ` Jonathan Corbet
2025-09-16  7:29     ` Chuck Wolber
2025-09-17 15:38     ` Gabriele Paoloni
2025-09-10 17:00 ` [RFC v2 PATCH 3/3] selftests/devmem: initial testset Gabriele Paoloni
2025-10-21  7:35   ` Greg KH [this message]
2025-10-21 17:40     ` Alessandro Carminati
2025-10-21  7:35 ` [RFC PATCH v2 0/3] Add testable code specifications Greg KH
2025-10-21  9:42   ` Gabriele Paoloni
2025-10-21 16:46     ` Greg KH
2025-10-22 14:06       ` Gabriele Paoloni
2025-10-22 17:13         ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2025102151-distill-operate-a748@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=acarmina@redhat.com \
    --cc=chuckwolber@gmail.com \
    --cc=corbet@lwn.net \
    --cc=gpaoloni@redhat.com \
    --cc=kstewart@linuxfoundation.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=safety-architecture@lists.elisa.tech \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).