Hi Jason, I noticed a few minor nits that might be worth addressing in a future revision. On Mon, Jun 16, 2025 at 03:06:18PM -0300, Jason Gunthorpe wrote: > This intends to have high coverage of the page table format functions and > the IOMMU implementation itself, exercising the various corner cases. > > The kunit can be run in the kunit framework, using commands like: The kunit tests can be run... > > tools/testing/kunit/kunit.py run --build_dir build_kunit_arm64 --arch arm64 --make_options LLVM=-19 --kunitconfig ./drivers/iommu/generic_pt/.kunitconfig > tools/testing/kunit/kunit.py run --build_dir build_kunit_uml --kunitconfig ./drivers/iommu/generic_pt/.kunitconfig --kconfig_add CONFIG_WERROR=n --kconfig_add CONFIG_UML_PCI_OVER_VIRTIO_DEVICE_ID=100 > tools/testing/kunit/kunit.py run --build_dir build_kunit_x86_64 --arch x86_64 --kunitconfig ./drivers/iommu/generic_pt/.kunitconfig > tools/testing/kunit/kunit.py run --build_dir build_kunit_i386 --arch i386 --kunitconfig ./drivers/iommu/generic_pt/.kunitconfig > tools/testing/kunit/kunit.py run --build_dir build_kunit_i386pae --arch i386 --kunitconfig ./drivers/iommu/generic_pt/.kunitconfig --kconfig_add CONFIG_X86_PAE=y > > There are several interesting corner cases on the 32 bit platforms that > need checking. > > Like the generic test they are run on the formats configuration list using how about "Like the generic tests, these are..." > kunit "params". This also checks the core iommu parts of the page table > code as it enters the logic through a mock iommu_domain. > > The following are checked: > - PT_FEAT_DYNAMIC_TOP properly adds levels one by oen s/oen/one > - Evey page size can be iommu_map()'d, and mapping creates that size s/Evey/Every > - iommu_iova_to_phys() works with every page size > - Test converting OA -> non present -> OA when the two OAs overlap and > free table levels > - Test that unmap stops at holes, unmap doesn't split, and unmap returns > the right values for partial unmap requests > - Randomly map/unmap. Checks map with random sizes, that map fails when > hitting collions doing nothing, unmap/map with random intersections and s/collions/collisions > full unmap of random sizes. Also checked iommu_iova_to_phys() with random s/checked/checks Thanks, -Ankit > -- > 2.43.0 >