[PATCH v2 00/23] Amdgpu plugin cleanups and fixes

Tvrtko Ursulin <[email protected]> Fri, 10 Apr 2026 19:54:51 +0100
Newsgroups dev.linux.lists.criu
Message-ID <[email protected]>
This series is a subset of previously posted as RFC:
https://lore.kernel.org/criu/CAEWA0a4ghpPeQjg1ETiQysGj5agfWwJRvMbWzhrYL5r8WZ5H7Q@mail.gmail.com/T/#mfb4ab4866a0cb440961be7170d0e107fab7eedf2

And as v1 cleanups only:
https://lore.kernel.org/criu/[email protected]/T/#md4284ded141876b7d7b942d2d449d6100bd20a2e

It still only contains the fixes and cleanups with the render node hacks
removed.

All patches have now been reviewed, although from v1 to v2 it was a difficult
rebase do upstream movement that happened in the meantime. So I think it would
be good to smoke test it in an environemnt other than where I tested using my
amd_criu IGT.

Two patches have been dropped from the series:

  plugins/amdgpu: Check images were opened successfully
  plugins/amdgpu: Fix error handling in amdgpu_plugin_drm_restore_file()

The same fixes have since been implemented in upstream at least in:

  611af0188dfe ("plugin/amdgpu: add open_img_file error handling")
  16b252ee21a8 ("plugin/amdgpu: add missing xzalloc() NULL checks in drm")

Fingers crossed I have not messed up anything in this relatively extensive
rebase and ideally we can merge this sooner rather than later and carry on
working on top.

Cc: Andrei Vagin <[email protected]>
Cc: Radostin Stoyanov <[email protected]>
Cc: David Francis <[email protected]>

v2:
 * Dropped some patches due upstream replicating them etc.
 * Heavy rebase due above.
 * Handled one more incorrect pr_perror.
 * Added newlines to pr_err after the pr_perror conversion.
 * Return error when adding plugin to inventory.

Tvrtko Ursulin (23):
  plugins/amgdpu: Fix one error message
  plugins/amdgpu: Remove unused current_pid global variable
  plugins/amdgpu: Remove unused new_minor from struct vma_metadata
  plugins/amdgpu: Fix drm pages size header
  plugins/amdgpu: Fix logging of failures to open files during restore
    init
  plugins/amdgpu: Propagate failure to save buffer object content
  plugins/amdgpu: Close the directory when image probing fails
  plugins/amdgpu: Close dma-buf image file if the read fails
  plugins/amdgpu: Flatten amdgpu_restore_init a bit
  plugins/amdgpu: Add error handling for seek operations
  plugins/amdgpu: Consolidate vm_info collection
  plugins/amdgpu: Remove plugin_log_msg()
  plugins/amdgpu: Reduce amount of debug logging a little bit
  plugins/amdgpu: Do not eat the errno in kmtIoctl
  plugins/amdgpu: Fix open_drm_render_device()
  plugins/amdgpu: Check sdma operation type early and once
  plugins/amdgpu: Add plugin to inventory even if process has no vmas
  plugins/amdgpu: Move drm file dump and restore into helpers
  plugins/amdgpu: Use the load_img helper in drm file restore
  plugins/amdgpu: Convert away from libc buffered file IO
  plugins/amdgpu: Use save_vma_updates for all call sites
  plugins/amdgpu: amdgpu_plugin_drm_restore_file() does not need to use
    libdrm
  plugins/amdgpu: Fix remaining wrong usages of pr_perror

 plugins/amdgpu/amdgpu_plugin.c          | 769 ++++++++++++------------
 plugins/amdgpu/amdgpu_plugin_dmabuf.c   |  17 +-
 plugins/amdgpu/amdgpu_plugin_drm.c      | 122 ++--
 plugins/amdgpu/amdgpu_plugin_drm.h      |   3 +-
 plugins/amdgpu/amdgpu_plugin_topology.c |  21 +-
 plugins/amdgpu/amdgpu_plugin_util.c     | 109 ++--
 plugins/amdgpu/amdgpu_plugin_util.h     |  17 +-
 7 files changed, 527 insertions(+), 531 deletions(-)

-- 
2.52.0