diff options
| author | Abdifatah Suruur <suruurism@gmail.com> | 2026-09-29 12:48:46 +0300 |
|---|---|---|
| committer | Alex Williamson <alex@shazbot.org> | 2026-09-29 13:31:06 -0600 |
| commit | c9e9ecb94f09aadc813c9640512495ba0c314726 (patch) | |
| tree | b57a5b7705949f7f2ceaa35ce5e7854e8246e44e /tools/perf/scripts/python/stackcollapse.py | |
| parent | a9ce237e1a1b3123ca75bd94308572f088fa43d8 (diff) | |
| download | linux-next-c9e9ecb94f09aadc813c9640512495ba0c314726.tar.gz linux-next-c9e9ecb94f09aadc813c9640512495ba0c314726.zip | |
vfio/fsl-mc: keep logical vm_pgoff in MMIO region mmap
vfio_fsl_mc_mmap_mmio() overwrites vma->vm_pgoff with the physical
frame number of the MMIO region and passes it to remap_pfn_range().
The VMA is inserted into the device file's mapping->i_mmap interval
tree keyed by vm_pgoff, which VFIO expects to be the logical file
offset: the core links every device mmap to the device inode's
i_mapping precisely so that unmap_mapping_range() can revoke all
mappings associated with a device (see vfio_device_cdev_open()).
With a raw PFN in vm_pgoff the interval tree entry lands in the wrong
coordinate space and unmap_mapping_range() cannot find the VMA,
leaving stale MMIO mappings behind any revocation attempt. Keep
vm_pgoff in the logical VFIO offset space, as vfio-pci does, and pass
the physical PFN to remap_pfn_range() explicitly.
This is defensive hygiene: none of vfio-platform, vfio/fsl-mc and
vfio/cdx call unmap_mapping_range() today, so no reachable
stale-mapping issue exists. Keeping vm_pgoff logical preserves the
VFIO core contract for any future revocation path.
Reviewed-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Abdifatah Suruur <suruurism@gmail.com>
Link: https://lore.kernel.org/r/20260929094848.7439-6-suruurism@gmail.com
Signed-off-by: Alex Williamson <alex@shazbot.org>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions
