aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorJoao Martins <[email protected]>2022-10-25 20:31:14 +0100
committerAlex Williamson <[email protected]>2022-11-09 16:42:02 -0700
commitf38044e5ef58ad0346fdabd7027ea5c1e1a3b624 (patch)
tree46c4e4dd795c65292f69cf9bbdea6f1e792dcccf /tools/perf/scripts/python
parentea00d4ededcd8639f9e814513426cfeccdd3aaf0 (diff)
vfio/iova_bitmap: Fix PAGE_SIZE unaligned bitmaps
iova_bitmap_set() doesn't consider the end of the page boundary when the first bitmap page offset isn't zero, and wrongly changes the consecutive page right after. Consequently this leads to missing dirty pages from reported by the device as seen from the VMM. The current logic iterates over a given number of base pages and clamps it to the remaining indexes to iterate in the last page. Instead of having to consider extra pages to pin (e.g. first and extra pages), just handle the first page as its own range and let the rest of the bitmap be handled as if it was base page aligned. This is done by changing iova_bitmap_mapped_remaining() to return PAGE_SIZE - pgoff (on the first bitmap page), and leads to pgoff being set to 0 on following iterations. Fixes: 58ccf0190d19 ("vfio: Add an IOVA bitmap support") Reported-by: Avihai Horon <[email protected]> Tested-by: Avihai Horon <[email protected]> Signed-off-by: Joao Martins <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alex Williamson <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions