[PATCH v2 3/3] iommu/io-pgtable-arm-selftests: Use KUnit
Mostafa Saleh
smostafa at google.com
Wed Sep 17 13:31:22 PDT 2025
On Wed, Sep 17, 2025 at 04:44:54PM -0300, Jason Gunthorpe wrote:
> On Wed, Sep 17, 2025 at 07:11:40PM +0000, Mostafa Saleh wrote:
> > Integrate the selftests as part of kunit, this makes the test
> > available through debugfs.
> >
> > Suggested-by: Jason Gunthorpe <jgg at ziepe.ca>
> > Signed-off-by: Mostafa Saleh <smostafa at google.com>
> > ---
> > drivers/iommu/Kconfig | 2 +-
> > drivers/iommu/io-pgtable-arm-selftests.c | 93 +++++++++++++-----------
> > 2 files changed, 51 insertions(+), 44 deletions(-)
> >
> > diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig
> > index 553522ef3ca9..f7e6d1db6ce6 100644
> > --- a/drivers/iommu/Kconfig
> > +++ b/drivers/iommu/Kconfig
> > @@ -42,7 +42,7 @@ config IOMMU_IO_PGTABLE_LPAE
> >
> > config IOMMU_IO_PGTABLE_LPAE_SELFTEST
>
> This should probably be renamed to xxx_KUNIT_TEST
Will do.
>
> > tristate "LPAE selftests"
> > - depends on IOMMU_IO_PGTABLE_LPAE
> > + depends on IOMMU_IO_PGTABLE_LPAE && KUNIT
>
> I wonder if it should be:
>
> select IOMMU_IO_PGTABLE_LPAE
> depends on KUNIT
> default KUNIT_ALL_TESTS
>
> ?
>
> At least the default should be there
Makes sense, will do.
>
> > help
> > Enable self-tests for LPAE page table allocator. This performs
> > a series of page-table consistency checks during boot.
>
> "kunit tests" here as well
Will do.
>
> > -subsys_initcall(arm_lpae_do_selftests);
>
> Oh so it does drop the initcall, the coverletter is a bit confusing then.
Yes, I will reword the cover letter.
Thanks,
Mostafa
>
> Reviewed-by: Jason Gunthorpe <jgg at nvidia.com>
>
> Jason
More information about the linux-arm-kernel
mailing list