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 GART aperture gpu address instead. When gpu indexes change, the GART 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. Samuel Zhang (3): drm/amdgpu: update XGMI physical node id and GMC configs on resume drm/amdgpu: update GPU addresses for SMU and PSP drm/amdgpu: enable pdb0 for hibernation on SRIOV drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 25 ++++++++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 46 ++++++++++++++++------ drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h | 2 + drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 18 +++++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_object.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 22 +++++++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 3 ++ drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c | 2 +- drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 21 ++++++++-- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 17 ++++++++ 10 files changed, 140 insertions(+), 17 deletions(-) -- 2.43.5