[PATCH] drm/amdkfd: Fix race in gfx10 context restore handler

2019-09-25 Thread Cornwall, Jay
Missing synchronization with VGPR restore leads to intermittent VGPR trashing in the user shader. Signed-off-by: Jay Cornwall --- drivers/gpu/drm/amd/amdkfd/cwsr_trap_handler.h | 139 +++-- .../gpu/drm/amd/amdkfd/cwsr_trap_handler_gfx10.asm | 1 + 2 files changed, 71 insert

[PATCH] drm/amdkfd: Swap trap temporary registers in gfx10 trap handler

2019-09-12 Thread Cornwall, Jay
ttmp[4:5] hold information useful to the debugger. Use ttmp[14:15] instead, aligning implementation with gfx9 trap handler. Signed-off-by: Jay Cornwall --- drivers/gpu/drm/amd/amdkfd/cwsr_trap_handler.h | 6 +++--- drivers/gpu/drm/amd/amdkfd/cwsr_trap_handler_gfx10.asm | 10 +-

[PATCH 3/3] drm/amdkfd: Save/restore vcc on gfx10

2019-07-29 Thread Cornwall, Jay
VCC moved out of user SGPR allocation in gfx10. It's now stored in SGPRs 106-107. Also fixes incorrect SGPR read offsets. Cc: Shaoyun Liu Signed-off-by: Jay Cornwall --- drivers/gpu/drm/amd/amdkfd/cwsr_trap_handler.h | 452 ++--- .../gpu/drm/amd/amdkfd/cwsr_trap_handler_gfx

[PATCH 1/3] drm/amdkfd: Fix gfx10 wave64 VGPR context restore

2019-07-29 Thread Cornwall, Jay
Copy/paste error, first 4 VGPRs are separated by 64 dwords (256 bytes). Cc: Shaoyun Liu Signed-off-by: Jay Cornwall --- drivers/gpu/drm/amd/amdkfd/cwsr_trap_handler.h | 6 +++--- drivers/gpu/drm/amd/amdkfd/cwsr_trap_handler_gfx10.asm | 6 +++--- 2 files changed, 6 insertions(+), 6 delet

[PATCH 2/3] drm/amdkfd: Save/restore flat_scratch_lo/hi on gfx10

2019-07-29 Thread Cornwall, Jay
These moved from SGPRs in gfx9 to HWREG in gfx10. Cc: Shaoyun Liu Signed-off-by: Jay Cornwall --- drivers/gpu/drm/amd/amdkfd/cwsr_trap_handler.h | 56 +- .../gpu/drm/amd/amdkfd/cwsr_trap_handler_gfx10.asm | 14 ++ 2 files changed, 48 insertions(+), 22 deletions(-) d

[PATCH 2/2] drm/amdkfd: Remove dead code from gfx8/gfx9 trap handlers

2019-07-24 Thread Cornwall, Jay
Signed-off-by: Jay Cornwall --- .../gpu/drm/amd/amdkfd/cwsr_trap_handler_gfx8.asm | 395 + .../gpu/drm/amd/amdkfd/cwsr_trap_handler_gfx9.asm | 375 +-- 2 files changed, 5 insertions(+), 765 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/cwsr_trap_handl

[PATCH 1/2] drm/amdkfd: Use SQC when TCP would fail in gfx9 context save.

2019-07-23 Thread Cornwall, Jay
When a wavefront raises TRAPSTS.XNACK_ERROR with STATUS.ALLOW_REPLAY=0 subsequent memory instructions have undefined behavior. In practice SQC stores continue to work but TCP stores do not. Context save is permitted to fail after XNACK error because the wavefront will be halted and subsequently te

[PATCH 2/2] drm/amdkfd: Fix lost single step exceptions in gfx9 trap handler

2019-07-23 Thread Cornwall, Jay
If the trap is entered due to MODE.DEBUG_EN=1 and SAVECTX is raised concurrently the handler cannot identify the source of the exception. This causes the debugger to lose single step exception notification when a context save request arrives at the same time. When MODE.DEBUG_EN=1 and STATUS.HALT=0