AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/7] enable switching to new gpu index for hibernate on SRIOV.
@ 2025-05-08  5:09 Samuel Zhang
  2025-05-08  5:09 ` [PATCH v4 1/7] drm/amdgpu: update XGMI info on resume Samuel Zhang
                   ` (6 more replies)
  0 siblings, 7 replies; 14+ messages in thread
From: Samuel Zhang @ 2025-05-08  5:09 UTC (permalink / raw)
  To: amd-gfx
  Cc: victor.zhao, haijun.chang, guoqing.zhang, Christian.Koenig,
	Alexander.Deucher, Owen.Zhang2, Qing.Ma

On SRIOV and VM environment, customer may need to switch to new vGPU indexes
after hibernate and then resume the VM. For GPUs with XGMI, `vram_start` will 
change in this case, the FB aperture gpu address of VRAM BOs will also change.
These gpu addresses need to be updated when resume. But these addresses are all
over the KMD codebase, updating each of them is error-prone and not acceptable. 

The solution is to use pdb0 page table to cover both vram and gart memory and
use pdb0 virtual gpu address instead. When gpu indexes change, the virtual gpu 
address won't change.

For psp and smu, pdb0's gpu address does not work, so the original FB aperture
gpu address is used instead. They need to be updated when resume with changed vGPUs.

v4: 
- remove gmc_v9_0_mc_init() call and `refresh` update. 
- do not set `fb_start` in mmhub_v1_8_get_fb_location() when pdb0 enabled.

Samuel Zhang (7):
  drm/amdgpu: update XGMI info on resume
  drm/amdgpu: update GPU addresses for SMU and PSP
  drm/amdgpu: enable pdb0 for hibernation on SRIOV
  drm/amdgpu: remove cached gpu addr: amdgpu_firmware.fw_buf_mc
  drm/amdgpu: remove cached gpu addr: ta_mem_context.shared_mc_addr
  drm/amdgpu: remove cached gpu addr: psp_context.tmr_mc_addr
  drm/amdgpu: remove cached gpu addr: psp_context.cmd_buf_mc_addr

 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 24 +++++++++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c    | 32 ++++++++++----
 drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h    |  1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 20 +++++++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.h |  1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c    | 49 +++++++++++++++-------
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h    |  3 --
 drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c  | 12 +++---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h  |  1 -
 drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.h   |  4 ++
 drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c   |  2 +-
 drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c      | 19 +++++++--
 drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c    |  6 ++-
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c  | 17 ++++++++
 14 files changed, 153 insertions(+), 38 deletions(-)

-- 
2.43.5


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2025-05-09  4:22 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-08  5:09 [PATCH v4 0/7] enable switching to new gpu index for hibernate on SRIOV Samuel Zhang
2025-05-08  5:09 ` [PATCH v4 1/7] drm/amdgpu: update XGMI info on resume Samuel Zhang
2025-05-08  8:12   ` Lazar, Lijo
2025-05-08 10:03     ` Zhang, GuoQing (Sam)
2025-05-08 10:56     ` Christian König
2025-05-09  4:22       ` Zhang, GuoQing (Sam)
2025-05-08  9:27   ` Christian König
2025-05-08 10:03     ` Zhang, GuoQing (Sam)
2025-05-08  5:09 ` [PATCH v4 2/7] drm/amdgpu: update GPU addresses for SMU and PSP Samuel Zhang
2025-05-08  5:09 ` [PATCH v4 3/7] drm/amdgpu: enable pdb0 for hibernation on SRIOV Samuel Zhang
2025-05-08  5:09 ` [PATCH v4 4/7] drm/amdgpu: remove cached gpu addr: amdgpu_firmware.fw_buf_mc Samuel Zhang
2025-05-08  5:09 ` [PATCH v4 5/7] drm/amdgpu: remove cached gpu addr: ta_mem_context.shared_mc_addr Samuel Zhang
2025-05-08  5:09 ` [PATCH v4 6/7] drm/amdgpu: remove cached gpu addr: psp_context.tmr_mc_addr Samuel Zhang
2025-05-08  5:09 ` [PATCH v4 7/7] drm/amdgpu: remove cached gpu addr: psp_context.cmd_buf_mc_addr Samuel Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox