All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pranjal Shrivastava <praan@google.com>
To: Mostafa Saleh <smostafa@google.com>
Cc: iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, robin.murphy@arm.com,
	will@kernel.org, joro@8bytes.org, jgg@ziepe.ca,
	Jason Gunthorpe <jgg@nvidia.com>
Subject: Re: [PATCH v4 4/4] iommu/io-pgtable-arm-selftests: Use KUnit
Date: Tue, 23 Sep 2025 19:34:52 +0000	[thread overview]
Message-ID: <aNL2XFd4Mb_dvaMy@google.com> (raw)
In-Reply-To: <20250922090003.686704-5-smostafa@google.com>

On Mon, Sep 22, 2025 at 08:59:28AM +0000, Mostafa Saleh wrote:
> Integrate the selftests as part of kunit.
> 
> Now instead of the test only being run at boot, it can run:
> 
> - With CONFIG_IOMMU_IO_PGTABLE_LPAE_KUNIT_TEST=y
>   It will automatically run at boot as before.
> 
> - Otherwise with CONFIG_IOMMU_IO_PGTABLE_KUNIT_TEST=m:
>   1) on module load:
>      Once the module load the self test will run
>      # modprobe io-pgtable-arm-selftests
> 
>   2) debugfs
>      With CONFIG_KUNIT_DEBUGFS=y You can run the test with
>      # echo 1 > /sys/kernel/debug/kunit/io-pgtable-arm-test/run
> 
>   3) Using kunit.py
>      You can also use the helper script which uses Qemu in the background
> 
>      # ./tools/testing/kunit/kunit.py run --build_dir build_kunit_arm64 --arch arm64 \
>        --make_options LLVM=1 --kunitconfig ./kunit/kunitconfig
>       [18:01:09] ============= io-pgtable-arm-test (1 subtest) ==============
>       [18:01:09] [PASSED] arm_lpae_do_selftests
>       [18:01:09] =============== [PASSED] io-pgtable-arm-test ===============
>       [18:01:09] ============================================================
> 
> Suggested-by: Jason Gunthorpe <jgg@ziepe.ca>
> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
> Signed-off-by: Mostafa Saleh <smostafa@google.com>
> ---
>  drivers/iommu/Kconfig                    | 11 ++--
>  drivers/iommu/Makefile                   |  2 +-
>  drivers/iommu/io-pgtable-arm-selftests.c | 82 +++++++++++++-----------
>  3 files changed, 51 insertions(+), 44 deletions(-)
> 

Reviewed-by: Pranjal Shrivastava <praan@google.com>

Moving the io-pgtable selftests out of the main driver code and
the integration with the KUnit framework looks good to me.

I was able to apply, build and test the series with multiple configs on
QEMU virt. 

   # arm_lpae_do_selftests: selftest: pgsize_bitmap 0x20010000, IAS 40 OAS 44
   # arm_lpae_do_selftests: selftest: pgsize_bitmap 0x20010000, IAS 42 OAS 44
   # arm_lpae_do_selftests: selftest: pgsize_bitmap 0x20010000, IAS 44 OAS 44
   # arm_lpae_do_selftests: selftest: pgsize_bitmap 0x20010000, IAS 32 OAS 48
   # arm_lpae_do_selftests: selftest: pgsize_bitmap 0x20010000, IAS 36 OAS 48
   # arm_lpae_do_selftests: selftest: pgsize_bitmap 0x20010000, IAS 40 OAS 48
   # arm_lpae_do_selftests: selftest: pgsize_bitmap 0x20010000, IAS 42 OAS 48
   # arm_lpae_do_selftests: selftest: pgsize_bitmap 0x20010000, IAS 44 OAS 48
   # arm_lpae_do_selftests: selftest: pgsize_bitmap 0x20010000, IAS 48 OAS 48
   # arm_lpae_do_selftests: selftest: completed with 63 PASS 0 FAIL
   ok 1 arm_lpae_do_selftests
 ok 1 io-pgtable-arm-test

Thanks,
Praan


      reply	other threads:[~2025-09-23 19:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-22  8:59 [PATCH v4 0/4] Move io-pgtable-arm selftest to KUnit Mostafa Saleh
2025-09-22  8:59 ` [PATCH v4 1/4] iommu/io-pgtable-arm: Simplify error prints for selftests Mostafa Saleh
2025-09-22 13:30   ` Jason Gunthorpe
2025-09-23 19:02   ` Pranjal Shrivastava
2025-09-22  8:59 ` [PATCH v4 2/4] iommu/io-pgtable-arm: Move selftests to a separate file Mostafa Saleh
2025-09-22 13:30   ` Jason Gunthorpe
2025-09-23 19:04   ` Pranjal Shrivastava
2025-09-22  8:59 ` [PATCH v4 3/4] iommu/io-pgtable-arm-selftests: Modularize the test Mostafa Saleh
2025-09-23 19:05   ` Pranjal Shrivastava
2025-09-22  8:59 ` [PATCH v4 4/4] iommu/io-pgtable-arm-selftests: Use KUnit Mostafa Saleh
2025-09-23 19:34   ` Pranjal Shrivastava [this message]

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=aNL2XFd4Mb_dvaMy@google.com \
    --to=praan@google.com \
    --cc=iommu@lists.linux.dev \
    --cc=jgg@nvidia.com \
    --cc=jgg@ziepe.ca \
    --cc=joro@8bytes.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=smostafa@google.com \
    --cc=will@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.