criu/plugins/amdgpu
David Yat Sin 2095de9f03 criu/plugin: Fix for FDs not allowed to mmap
On newer kernel's (> 5.13), KFD & DRM drivers will only allow the
/dev/renderD* file descriptors that were used during the CRIU_RESTORE
ioctl when calling mmap for the vma's.
During restore, after opening /dev/renderD*, amdgpu_plugin keeps the
FDs opened and instead returns a copy of the FDs to CRIU. The same FDs
are then returned during the UPDATE_VMAMAP hooks so that they can be
used by CRIU to call mmap. Duplicated FDs created using dup are
references to the same struct file inside the kernel so they are also
allowed to mmap.
To prevent the opened FDs inside amdgpu_plugin from conflicting with
FDs used by the target restore application, we make sure that the
lowest-numbered FD that amdgpu_plugin will use is greater than the
highest-numbered FD that is used by the target application.

Signed-off-by: David Yat Sin <david.yatsin@amd.com>
2022-04-28 17:53:52 -07:00
..
tests criu/plugin: Add unit tests for GPU remapping 2022-04-28 17:53:52 -07:00
amdgpu_plugin.c criu/plugin: Fix for FDs not allowed to mmap 2022-04-28 17:53:52 -07:00
amdgpu_plugin_topology.c criu/plugin: Fix for FDs not allowed to mmap 2022-04-28 17:53:52 -07:00
amdgpu_plugin_topology.h criu/plugin: Read and write BO contents in parallel 2022-04-28 17:53:52 -07:00
criu-amdgpu.proto criu/plugin: Restore libhsakmt shared memory files 2022-04-28 17:53:52 -07:00
kfd_ioctl.h criu/plugin: Initialize AMD KFD header 2022-04-28 17:53:52 -07:00
Makefile criu/plugin: Fix for FDs not allowed to mmap 2022-04-28 17:53:52 -07:00