summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorJonathan Kim <jonathan.kim@amd.com>2025-05-26 15:39:45 -0400
committerAlex Deucher <alexander.deucher@amd.com>2025-12-10 17:34:44 -0500
commitcf356fe11dd42fb91f3a3f9b990cf237a3ce9841 (patch)
tree70c9f4b899a3ee1b4ba8312d0996cacbc4c94f8f /drivers/gpu
parent8e0187aec67a9f71e5b3726c1979e1d68db552ca (diff)
downloadlinux-cf356fe11dd42fb91f3a3f9b990cf237a3ce9841.tar.gz
linux-cf356fe11dd42fb91f3a3f9b990cf237a3ce9841.zip
drm/amdkfd: disable shader message vgpr deallocation on gc 12.1
Shader messages to deallocate VGPRs prior to shader end can prevent the trap handler from saving context, making debugging and core dumps unreliable. VGPR deallocations for performance gain is negligible. GC 12.1 will NOP shader VGPR deallocation messages via HW settings on driver boot. Signed-off-by: Jonathan Kim <jonathan.kim@amd.com> Acked-by: Harish Kasiviswanathan <harish.kasiviswanathan@amd.com> Reviewed-by: Felix Kuehling <felix.kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c b/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c
index 447395d36a3e..2ef0fce10067 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c
@@ -1362,6 +1362,11 @@ static void gfx_v12_1_xcc_init_compute_vmid(struct amdgpu_device *adev,
data = RREG32_SOC15(GC, GET_INST(GC, xcc_id), regSPI_GDBG_PER_VMID_CNTL);
data = REG_SET_FIELD(data, SPI_GDBG_PER_VMID_CNTL, TRAP_EN, 1);
WREG32_SOC15(GC, GET_INST(GC, xcc_id), regSPI_GDBG_PER_VMID_CNTL, data);
+
+ /* Disable VGPR deallocation instruction for each KFD vmid. */
+ data = RREG32_SOC15(GC, GET_INST(GC, xcc_id), regSQ_DEBUG);
+ data = REG_SET_FIELD(data, SQ_DEBUG, DISABLE_VGPR_DEALLOC, 1);
+ WREG32_SOC15(GC, GET_INST(GC, xcc_id), regSQ_DEBUG, data);
}
soc_v1_0_grbm_select(adev, 0, 0, 0, 0, GET_INST(GC, xcc_id));
mutex_unlock(&adev->srbm_mutex);