]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
iommufd/selftest: Fix iommufd_test_dirty() to handle <u8 bitmaps
authorJoao Martins <joao.m.martins@oracle.com>
Thu, 27 Jun 2024 11:00:56 +0000 (12:00 +0100)
committerJason Gunthorpe <jgg@nvidia.com>
Fri, 28 Jun 2024 16:12:22 +0000 (13:12 -0300)
commit9560393b830b415b2151b3dd8e065257cccbffa7
tree875e1ec707b0f2f0d649d8823276d395f77a80dd
parentec61f820a2ff07d1717583bd57d6ee45d2763a6e
iommufd/selftest: Fix iommufd_test_dirty() to handle <u8 bitmaps

The calculation returns 0 if it sets less than the number of bits per
byte. For calculating memory allocation from bits, lets round it up to
one byte.

Link: https://lore.kernel.org/r/20240627110105.62325-3-joao.m.martins@oracle.com
Reported-by: Matt Ochs <mochs@nvidia.com>
Fixes: a9af47e382a4 ("iommufd/selftest: Test IOMMU_HWPT_GET_DIRTY_BITMAP")
Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Tested-by: Matt Ochs <mochs@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/iommu/iommufd/selftest.c