diff options
| author | Jason Gunthorpe <jgg@nvidia.com> | 2026-10-14 21:38:40 -0300 |
|---|---|---|
| committer | Jason Gunthorpe <jgg@nvidia.com> | 2026-10-15 13:56:22 -0300 |
| commit | 04bcf84613346b973a8cc0c59238b6b5bc902688 (patch) | |
| tree | 72df1a646b5b49834f8cbe7374b8c1dd20b233b3 /scripts/basic/split-include.c | |
| parent | e21952d72b4740f08a272d694cca223b6b0099ca (diff) | |
| download | linux-next-04bcf84613346b973a8cc0c59238b6b5bc902688.tar.gz linux-next-04bcf84613346b973a8cc0c59238b6b5bc902688.zip | |
iommupt: Do not allow PTEs to be split when dirty logging
If a single PTE cannot be stored in the current bitmap that should be a
failure and reported back to userspace. Allowing a PTE to be split creates
a possibility that dirty memory will be reported as clean.
The gather must also cover the entire PTE that is being cleaned, not just
the part that fits within the bitmap.
Fix both issues by computing the full IOVA range of every PTE and using
that to update the bitmap and the gather. The bitmap code now rejects
ranges that don't fit in it, and the gather always combined ranges.
The selftest quietly relied on a bug where the CONT was split, that is why
the half page size for the mock domain saw alternating dirties. Increase
the dirty test page size to PAGE_SIZE so it still works as intended.
Cc: stable@vger.kernel.org
Fixes: 4a00f9434891 ("iommupt: Add read_and_clear_dirty op")
Reported-by: Samarth Narang <samarth.colleges@gmail.com>
Closes: https://lore.kernel.org/all/20261013165814.309255
Link: https://patch.msgid.link/r/0-v1-5bb926ff73ec+576-iommufd_dirty_jgg@nvidia.com
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'scripts/basic/split-include.c')
0 files changed, 0 insertions, 0 deletions
