On Thu, Jul 17, 2025 at 07:45:51PM -0700, Nicolin Chen wrote:
> On Thu, Jul 17, 2025 at 04:15:09PM -0300, Jason Gunthorpe wrote:
> 
> > +TEST_F(iommufd_ioas, reserved_overflow)
> > +{
> > +   struct iommu_test_cmd test_cmd = {
> > +           .size = sizeof(test_cmd),
> > +           .op = IOMMU_TEST_OP_ADD_RESERVED,
> > +           .id = self->ioas_id,
> > +           .add_reserved = { .start = 6,
> > +                             .length = 0xffffffffffff8001 },
> > +   };
> > +   __u64 iova;
> > +
> > +   ASSERT_EQ(0,
> > +             ioctl(self->fd, _IOMMU_TEST_CMD(IOMMU_TEST_OP_ADD_RESERVED),
> > +                   &test_cmd));
> > +   test_err_ioctl_ioas_map(ENOSPC, buffer, 0x5000, &iova);
> 
> When:
> PAGE_SIZE=SZ_64K = 0x10000
> MOCK_PAGE_SIZE = PAGE_SIZE / 2 = 0x8000
> 
> This likely fails the alignment test, returning -EINVAL instead:
> 
> # iommufd.c:988:reserved_overflow:Expected 28 (28) == errno (22)
> # reserved_overflow: Test failed
> #          FAIL  iommufd_ioas.mock_domain_limit.reserved_overflow
> 
> So, I think we'd have to pick a number aligned to MOCK_PAGE_SIZE?
> e.g. changing to 0x18000 for example can pass.

I realized that we can't change the number as it won't reproduce
on PAGE_SIZE=4K. So, perhaps it should just SKIP other page sizes
than 4K.

Thanks
Nicolin

Reply via email to