Skip to content

Commit f6cd8a7

Browse files
committed
iommufd/selftest: Add tests for <= u8 bitmap sizes
JIRA: https://issues.redhat.com/browse/RHEL-40162 Upstream Status: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git commit 3333558 Author: Joao Martins <joao.m.martins@oracle.com> Date: Thu Jun 27 12:00:57 2024 +0100 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.com 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> (cherry picked from commit 3333558) Signed-off-by: Jerry Snitselaar <jsnitsel@redhat.com>
1 parent 46e0505 commit f6cd8a7

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)