diff options
| author | Nicolin Chen <[email protected]> | 2025-06-24 18:00:45 +0000 |
|---|---|---|
| committer | Jason Gunthorpe <[email protected]> | 2025-06-24 18:45:12 +0000 |
| commit | 818625570558cd91082c9bafd6f2b59b73241a69 (patch) | |
| tree | ed6bcd4cdaf38c3a37c9e5dc1d6134aeba9ae140 /drivers/net/ethernet/intel/igc/igc_main.c | |
| parent | Linux 6.16-rc3 (diff) | |
| download | kernel-818625570558cd91082c9bafd6f2b59b73241a69.tar.gz kernel-818625570558cd91082c9bafd6f2b59b73241a69.zip | |
iommufd/selftest: Fix iommufd_dirty_tracking with large hugepage sizes
The hugepage test cases of iommufd_dirty_tracking have the 64MB and 128MB
coverages. Both of them are smaller than the default hugepage size 512MB,
when CONFIG_PAGE_SIZE_64KB=y. However, these test cases have a variant of
using huge pages, which would mmap(MAP_HUGETLB) using these smaller sizes
than the system hugepag size. This results in the kernel aligning up the
smaller size to 512MB. If a memory was located between the upper 64/128MB
size boundary and the hugepage 512MB boundary, it would get wiped out:
https://lore.kernel.org/all/[email protected]/
Given that this aligning up behavior is well documented, we have no choice
but to allocate a hugepage aligned size to avoid this unintended wipe out.
Instead of relying on the kernel's internal force alignment, pass the same
size to posix_memalign() and map().
Also, fix the FIXTURE_TEARDOWN() misusing munmap() to free the memory from
posix_memalign(), as munmap() doesn't destroy the allocator meta data. So,
call free() instead.
Fixes: a9af47e382a4 ("iommufd/selftest: Test IOMMU_HWPT_GET_DIRTY_BITMAP")
Link: https://patch.msgid.link/r/1ea8609ae6d523fdd4d8efb179ddee79c8582cb6.1750787928.git.nicolinc@nvidia.com
Cc: [email protected]
Suggested-by: Jason Gunthorpe <[email protected]>
Signed-off-by: Nicolin Chen <[email protected]>
Signed-off-by: Jason Gunthorpe <[email protected]>
Diffstat (limited to 'drivers/net/ethernet/intel/igc/igc_main.c')
0 files changed, 0 insertions, 0 deletions
