diff options
author | Steve Sistare <steven.sistare@oracle.com> | 2023-01-31 08:58:06 -0800 |
---|---|---|
committer | Alex Williamson <alex.williamson@redhat.com> | 2023-02-09 11:39:14 -0700 |
commit | 90fdd158a695d70403163f9a0e4efc5b20f3fd3e (patch) | |
tree | cfe5b2d217348c33f9d12502cb3dba052c00839c /tools/perf/scripts/python/event_analyzing_sample.py | |
parent | 18e292705ba21cc9b3227b9ad5b1c28973605ee5 (diff) |
vfio/type1: restore locked_vm
When a vfio container is preserved across exec or fork-exec, the new
task's mm has a locked_vm count of 0. After a dma vaddr is updated using
VFIO_DMA_MAP_FLAG_VADDR, locked_vm remains 0, and the pinned memory does
not count against the task's RLIMIT_MEMLOCK.
To restore the correct locked_vm count, when VFIO_DMA_MAP_FLAG_VADDR is
used and the dma's mm has changed, add the dma's locked_vm count to
the new mm->locked_vm, subject to the rlimit, and subtract it from the
old mm->locked_vm.
Fixes: c3cbab24db38 ("vfio/type1: implement interfaces to update vaddr")
Cc: stable@vger.kernel.org
Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/1675184289-267876-5-git-send-email-steven.sistare@oracle.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'tools/perf/scripts/python/event_analyzing_sample.py')
0 files changed, 0 insertions, 0 deletions