]> Gentwo Git Trees - linux/.git/commit
iommu/io-pgtable-arm-selftests: Use KUnit
authorMostafa Saleh <smostafa@google.com>
Mon, 3 Nov 2025 12:33:52 +0000 (12:33 +0000)
committerJoerg Roedel <joerg.roedel@amd.com>
Thu, 13 Nov 2025 15:25:32 +0000 (16:25 +0100)
commit7e06063a43d317c1ca9278b6662555f687f43f03
treeb0299e265f7d11fa288df0245e722dcc84e1b2f9
parenta3c24b6d7cd6047fb9e234586e484391be335b4f
iommu/io-pgtable-arm-selftests: Use KUnit

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_LPAE_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>
Reviewed-by: Pranjal Shrivastava <praan@google.com>
Signed-off-by: Mostafa Saleh <smostafa@google.com>
Acked-by: Will Deacon <will@kernel.org>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
drivers/iommu/Kconfig
drivers/iommu/Makefile
drivers/iommu/io-pgtable-arm-selftests.c