Skip to content

iommupt: fix zero-length unmap causing a full IOTLB flush

YeeLi linux-iommu 1 version Applied

Status from this message: Applied, thanks

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 2 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/2iommupt: fix full IOTLB flush from a zero length unmapdrivers/iommu/generic_pt/iommu_pt.h+6 -11 reply
2/2iommupt: add a KUnit test for unmapping an empty rangedrivers/iommu/generic_pt/kunit_iommu_pt.h+31 -00 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchLu Baolu
1/2R-b
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] iommupt: fix zero-length unmap causing a full IOTLB flush

From: yeeli <[email protected]>

This series fixes an unmap that removes nothing from being turned into a full-domain IOTLB flush, and adds a KUnit test for it.

Disclosure of tool use: the bug analysis and the initial drafts of both patches were produced with the help of an AI coding assistant (DeepSeek-V4.1-Flash, running in OpenCode). The prompts were a review of the Intel IOMMU generic_pt integration, followed by requests to reproduce, fix and test the empty unmap behaviour found there. The assistant reviewed the iommupt unmap path and proposed the len guard in gather_range_pending() plus the KUnit test; the code, commit messages and test were then reviewed by the submitter. The submitter also verified the behaviour independently: KUnit on the vtdss format, where the new test fails without the fix and passes with it (full
vtdss_iommu_test: 63 tests, 60 passed, 3 skipped, 0 failed), and an out-of-tree module on an Intel VT-d system observed with the cache_tag_flush_range and qi_submit tracepoints. Everything that was attempted could be built and tested. The submitter takes responsibility for the submission.

yeeli (2):
iommupt: fix full IOTLB flush from a zero length unmap
iommupt: add a KUnit test for unmapping an empty range

 drivers/iommu/generic_pt/iommu_pt.h       |  7 ++++-
 drivers/iommu/generic_pt/kunit_iommu_pt.h | 31 +++++++++++++++++++++++
 2 files changed, 37 insertions(+), 1 deletion(-)
Signature · 1 line
2.34.1