Skip to content

Commit 3333558

Browse files
jpemartinsjgunthorpe
authored andcommitted
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/[email protected] Signed-off-by: Joao Martins <[email protected]> Reviewed-by: Kevin Tian <[email protected]> Tested-by: Matt Ochs <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 9560393 commit 3333558

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tools/testing/selftests/iommu/iommufd.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1727,6 +1727,12 @@ FIXTURE_SETUP(iommufd_dirty_tracking)
17271727
void *vrc;
17281728
int rc;
17291729

1730+
if (variant->buffer_size < MOCK_PAGE_SIZE) {
1731+
SKIP(return,
1732+
"Skipping buffer_size=%lu, less than MOCK_PAGE_SIZE=%lu",
1733+
variant->buffer_size, MOCK_PAGE_SIZE);
1734+
}
1735+
17301736
self->fd = open("/dev/iommu", O_RDWR);
17311737
ASSERT_NE(-1, self->fd);
17321738

@@ -1779,6 +1785,18 @@ FIXTURE_TEARDOWN(iommufd_dirty_tracking)
17791785
teardown_iommufd(self->fd, _metadata);
17801786
}
17811787

1788+
FIXTURE_VARIANT_ADD(iommufd_dirty_tracking, domain_dirty8k)
1789+
{
1790+
/* half of an u8 index bitmap */
1791+
.buffer_size = 8UL * 1024UL,
1792+
};
1793+
1794+
FIXTURE_VARIANT_ADD(iommufd_dirty_tracking, domain_dirty16k)
1795+
{
1796+
/* one u8 index bitmap */
1797+
.buffer_size = 16UL * 1024UL,
1798+
};
1799+
17821800
FIXTURE_VARIANT_ADD(iommufd_dirty_tracking, domain_dirty128k)
17831801
{
17841802
/* one u32 index bitmap */

0 commit comments

Comments
 (0)