Re: [PATCH 0/2] vfio: selftests: Fix MMIO test failures in iommufd compat mode

From: Lai, Yi

Date: Sun Mar 22 2026 - 20:37:59 EST


On Fri, Mar 20, 2026 at 10:43:54AM -0700, David Matlack wrote:
> On Thu, Mar 19, 2026 at 9:03 PM Yi Lai <yi1.lai@xxxxxxxxx> wrote:
> >
> > This series fixes two issues in the vfio_dma_mapping_mmio_test selftest when
> > running in iommufd compat mode.
> >
> > The first patch fixes a segmentation fault caused by an uninitialized list head
> > when __iommu_map() fails (as expected for MMIO regions in iommufd).
> >
> > The second patch fixes a test assertion failure by aligning the check for the
> > __iommu_unmap() return value based on the iommufd mode (native vs. compat).
>
> Alex Mastro also sent a fix for these issues here:
>
> https://lore.kernel.org/kvm/20260303-fix-mmio-test-v1-1-78b4a9e46a4e@xxxxxx/
>
> Can you take a look and see if it looks ok to you? I think I prefer
> Alex's fix. We shouldn't even be calling __iommu_unmap() after
> __iommu_map() fails.

Yes, just remove calling __iommu_unmap() is a more direct fix for the
two issues I encoutered. Agree with the fix.