Commit 33335584 authored by Joao Martins's avatar Joao Martins Committed by Jason Gunthorpe

iommufd/selftest: Add tests for <= u8 bitmap sizes

Add more tests for bitmaps smaller than or equal to an u8, though skip the
tests if the IOVA buffer size is smaller than the mock page size.

Link: https://lore.kernel.org/r/20240627110105.62325-4-joao.m.martins@oracle.comSigned-off-by: default avatarJoao Martins <joao.m.martins@oracle.com>
Reviewed-by: default avatarKevin Tian <kevin.tian@intel.com>
Tested-by: default avatarMatt Ochs <mochs@nvidia.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
parent 9560393b
...@@ -1727,6 +1727,12 @@ FIXTURE_SETUP(iommufd_dirty_tracking) ...@@ -1727,6 +1727,12 @@ FIXTURE_SETUP(iommufd_dirty_tracking)
void *vrc; void *vrc;
int rc; int rc;
if (variant->buffer_size < MOCK_PAGE_SIZE) {
SKIP(return,
"Skipping buffer_size=%lu, less than MOCK_PAGE_SIZE=%lu",
variant->buffer_size, MOCK_PAGE_SIZE);
}
self->fd = open("/dev/iommu", O_RDWR); self->fd = open("/dev/iommu", O_RDWR);
ASSERT_NE(-1, self->fd); ASSERT_NE(-1, self->fd);
...@@ -1779,6 +1785,18 @@ FIXTURE_TEARDOWN(iommufd_dirty_tracking) ...@@ -1779,6 +1785,18 @@ FIXTURE_TEARDOWN(iommufd_dirty_tracking)
teardown_iommufd(self->fd, _metadata); teardown_iommufd(self->fd, _metadata);
} }
FIXTURE_VARIANT_ADD(iommufd_dirty_tracking, domain_dirty8k)
{
/* half of an u8 index bitmap */
.buffer_size = 8UL * 1024UL,
};
FIXTURE_VARIANT_ADD(iommufd_dirty_tracking, domain_dirty16k)
{
/* one u8 index bitmap */
.buffer_size = 16UL * 1024UL,
};
FIXTURE_VARIANT_ADD(iommufd_dirty_tracking, domain_dirty128k) FIXTURE_VARIANT_ADD(iommufd_dirty_tracking, domain_dirty128k)
{ {
/* one u32 index bitmap */ /* one u32 index bitmap */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment