diff options
| author | Donggeun Yoo <donggeunyoo.kernel@gmail.com> | 2026-09-29 12:14:02 +0900 |
|---|---|---|
| committer | Jason Gunthorpe <jgg@nvidia.com> | 2026-10-14 21:16:12 -0300 |
| commit | 1e67cca28490f897788c128c650a6f2cbb565403 (patch) | |
| tree | e79cb090eb4bc85d1ae44c1728bdf541fad35b1c /scripts/basic/split-include.c | |
| parent | 54dadb030c7e2350957855d3995de05ae02c2e66 (diff) | |
| download | linux-next-1e67cca28490f897788c128c650a6f2cbb565403.tar.gz linux-next-1e67cca28490f897788c128c650a6f2cbb565403.zip | |
iommufd: Keep reserved IOVA ranges when a replace within one IOAS fails
iommufd_device_do_replace() installs the group's reserved IOVA ranges in
the new hwpt's IOAS only when it differs from the old hwpt's IOAS. If the
replace fails in iommufd_device_do_replace() or
iommufd_group_do_replace_reserved_iova(), the error paths remove the
ranges from the new hwpt's IOAS whether or not the IOAS is shared
between the old and new hwpt, which removes the ranges that the old hwpt
still needs.
For example, on x86 with intel-iommu, after a replace within a shared
IOAS fails with -ENODEV, IOMMU_IOAS_IOVA_RANGES goes from
0x0-0xfedfffff
0xfef00000-0xffffffffffff
to
0x0-0xffffffffffff
and IOMMU_IOAS_MAP at 0xfee00000 succeeds.
Remove the ranges on failure only when the replace installed them, and
look up the old hwpt_paging before the replace so that the error path
can compare the IOAS.
Fixes: e88d4ec154a8 ("iommufd: Add iommufd_device_replace()")
Assisted-by: LLM
Signed-off-by: Donggeun Yoo <donggeunyoo.kernel@gmail.com>
Link: https://patch.msgid.link/20260929031402.1998253-1-donggeunyoo.kernel@gmail.com
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'scripts/basic/split-include.c')
0 files changed, 0 insertions, 0 deletions
