Upstream debugger feature for GFX v9.4.3
Subsystems (3)
cover Upstream debugger feature for GFX v9.4.3
Eric Huang (1):
drm/amdkfd: add xcc instance for debugger APIs
Jonathan Kim (4):
drm/amdgpu: add debugger support for GC v9.4.3 drm/amdkfd: add multi-process debugging support for GC v9.4.3 drm/amdkfd: restore debugger additional info for gfx v9_4_3 drm/amdkfd: enable watch points globally for gfx943
.../drm/amd/amdgpu/amdgpu_amdkfd_aldebaran.c | 13 +- .../drm/amd/amdgpu/amdgpu_amdkfd_aldebaran.h | 30 ++++ .../drm/amd/amdgpu/amdgpu_amdkfd_gc_9_4_3.c | 150 +++++++++++++++++- .../drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10.c | 6 +- .../drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10.h | 6 +- .../drm/amd/amdgpu/amdgpu_amdkfd_gfx_v11.c | 6 +- .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c | 6 +- .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.h | 6 +- drivers/gpu/drm/amd/amdkfd/kfd_debug.c | 18 ++- drivers/gpu/drm/amd/amdkfd/kfd_debug.h | 5 +- drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 10 +- drivers/gpu/drm/amd/amdkfd/kfd_topology.h | 3 + .../gpu/drm/amd/include/kgd_kfd_interface.h | 6 +- 13 files changed, 237 insertions(+), 28 deletions(-) create mode 100644 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_aldebaran.h
Signature · 1 line
2.34.1
PATCH 1/5 drm/amdgpu: add debugger support for GC v9.4.3
From: Jonathan Kim <[email protected]>
Implement the similarities as GC v9.4.2, and the difference for GC v9.4.3 HW spec.
--- .../drm/amd/amdgpu/amdgpu_amdkfd_aldebaran.c | 7 +- .../drm/amd/amdgpu/amdgpu_amdkfd_aldebaran.h | 30 ++++ .../drm/amd/amdgpu/amdgpu_amdkfd_gc_9_4_3.c | 146 +++++++++++++++++- 3 files changed, 179 insertions(+), 4 deletions(-) create mode 100644 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_aldebaran.h
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_aldebaran.c +4 -3
@@ -23,6 +23,7 @@#include "amdgpu_amdkfd.h" #include "amdgpu_amdkfd_arcturus.h" #include "amdgpu_amdkfd_gfx_v9.h" +#include "amdgpu_amdkfd_aldebaran.h" #include "gc/gc_9_4_2_offset.h" #include "gc/gc_9_4_2_sh_mask.h" #include <uapi/linux/kfd_ioctl.h>
@@ -36,7 +37,7 @@* initialize the debug mode registers after it has disabled GFX off during the * debug session. */ -static uint32_t kgd_aldebaran_enable_debug_trap (struct amdgpu_device *adev, +uint32_t kgd_aldebaran_enable_debug_trap (struct amdgpu_device *adev,bool restore_dbg_registers,uint32_t vmid) {
@@ -50,7 +51,7 @@ static uint32_t kgd_aldebaran_enable_debug_trap(struct amdgpu_device *adev, }/* returns TRAP_EN, EXCP_EN and EXCP_REPLACE. */ -static uint32_t kgd_aldebaran_disable_debug_trap (struct amdgpu_device *adev, +uint32_t kgd_aldebaran_disable_debug_trap (struct amdgpu_device *adev,bool keep_trap_enabled,uint32_t vmid) {
@@ -107,7 +108,7 @@ static uint32_t kgd_aldebaran_set_wave_launch_trap_override(struct amdgpu_devicereturn data; } -static uint32_t kgd_aldebaran_set_wave_launch_mode (struct amdgpu_device *adev, +uint32_t kgd_aldebaran_set_wave_launch_mode (struct amdgpu_device *adev,uint8_t wave_launch_mode,uint32_t vmid) {
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_aldebaran.h new file +30 -0
@@ -0,0 +1,30 @@ +/* +* Copyright 2021 Advanced Micro Devices, Inc. +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR +* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +* OTHER DEALINGS IN THE SOFTWARE. +*/ +uint32_t kgd_aldebaran_enable_debug_trap (struct amdgpu_device *adev, +bool restore_dbg_registers, +uint32_t vmid); +uint32_t kgd_aldebaran_disable_debug_trap (struct amdgpu_device *adev, +bool keep_trap_enabled, +uint32_t vmid); +uint32_t kgd_aldebaran_set_wave_launch_mode (struct amdgpu_device *adev, +uint8_t wave_launch_mode, +uint32_t vmid);
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gc_9_4_3.c +145 -1
168 lines not on this page · raw message
Signature · 1 line
2.34.1
RE: [PATCH 1/5] drm/amdgpu: add debugger support for GC v9.4.3
[Public]
Quoted 7 lines
-----Original Message-----
From: Huang, JinHuiEric <[email protected]>
Sent: Wednesday, June 28, 2023 5:23 PM
To: [email protected]
Cc: Kim, Jonathan <[email protected]>; Kim, Jonathan <[email protected]>; Huang, JinHuiEric <[email protected]>
Subject: [PATCH 1/5] drm/amdgpu: add debugger support for GC v9.4.3
This patch doesn't add support but defines the KGD callbacks required for support.
Quoted 70 lines
From: Jonathan Kim <[email protected]>
Implement the similarities as GC v9.4.2, and the difference for GC v9.4.3 HW spec.
Signed-off-by Jonathan Kim <[email protected]>Signed-off-by Eric Huang <[email protected]>--- .../drm/amd/amdgpu/amdgpu_amdkfd_aldebaran.c | 7 +- .../drm/amd/amdgpu/amdgpu_amdkfd_aldebaran.h | 30 ++++ .../drm/amd/amdgpu/amdgpu_amdkfd_gc_9_4_3.c | 146 +++++++++++++++++- 3 files changed, 179 insertions(+), 4 deletions(-) create mode 100644
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_aldebaran.hdrivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_aldebaran.c +2
-1@@ -23,6 +23,7 @@#include "amdgpu_amdkfd.h" #include "amdgpu_amdkfd_arcturus.h" #include "amdgpu_amdkfd_gfx_v9.h" +#include "amdgpu_amdkfd_aldebaran.h" #include "gc/gc_9_4_2_offset.h" #include "gc/gc_9_4_2_sh_mask.h" #include <uapi/linux/kfd_ioctl.h> @@ -36,7 +37,7 @@* initialize the debug mode registers after it has disabled GFX off during the * debug session. */ -static uint32_t kgd_aldebaran_enable_debug_trap (struct amdgpu_device *adev, +uint32_t kgd_aldebaran_enable_debug_trap (struct amdgpu_device *adev,bool restore_dbg_registers,uint32_t vmid){
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_aldebaran.c +1
-1@@ -50,7 +51,7 @@ static uint32_t kgd_aldebaran_enable_debug_trap(struct amdgpu_device *adev, }/* returns TRAP_EN, EXCP_EN and EXCP_REPLACE. */ -static uint32_t kgd_aldebaran_disable_debug_trap(struct amdgpu_device *adev, +uint32_t kgd_aldebaran_disable_debug_trap(struct amdgpu_device *adev, bool keep_trap_enabled,uint32_t vmid){
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_aldebaran.c +0
-0@@ -107,7 +108,7 @@ static uint32_tkgd_aldebaran_set_wave_launch_trap_override(struct
amdgpu_devicereturn data;}
-static
uint32_tkgd_aldebaran_set_wave_launch_mode(structamdgpu_device*adev,
+uint32_t kgd_aldebaran_set_wave_launch_mode(structamdgpu_device*adev,uint8_t wave_launch_mode, uint32_t vmid){
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_aldebaran.h new file +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_aldebaran.h line 2
Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_aldebaran.h new file +2
-0@@ -0,0 +1,30 @@ +/* +* Copyright 2021 Advanced Micro Devices, Inc.
Should be dated 2023.
Quoted 129 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_aldebaran.h new file +9
-0+* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_aldebaran.h new file +7
-0+uint32_t kgd_aldebaran_enable_debug_trap (struct amdgpu_device *adev, +bool restore_dbg_registers, +uint32_t vmid); +uint32_t kgd_aldebaran_disable_debug_trap (struct amdgpu_device *adev, +bool keep_trap_enabled, +uint32_t vmid); +uint32_t kgd_aldebaran_set_wave_launch_mode(struct amdgpu_device*adev,
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_aldebaran.h new file +2
-0+uint8_t wave_launch_mode, + uint32_t vmid);drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gc_9_4_3.c +30
-0@@ -22,6 +22,7 @@#include "amdgpu.h" #include "amdgpu_amdkfd.h" #include "amdgpu_amdkfd_gfx_v9.h" +#include "amdgpu_amdkfd_aldebaran.h" #include "gc/gc_9_4_3_offset.h" #include "gc/gc_9_4_3_sh_mask.h" #include "athub/athub_1_8_0_offset.h" @@ -32,6 +33,7 @@#include "soc15.h" #include "sdma/sdma_4_4_2_offset.h" #include "sdma/sdma_4_4_2_sh_mask.h" +#include <uapi/linux/kfd_ioctl.h> static inline struct v9_sdma_mqd *get_sdma_mqd (void *mqd) {@@ -361,6 +363,139 @@ static int kgd_gfx_v9_4_3_hqd_load(struct amdgpu_device *adev, void *mqd, return 0; } +static int kgd_gfx_v9_4_3_validate_trap_override_request ( +struct amdgpu_device *adev, +uint32_t trap_override, +uint32_t *trap_mask_supported) +{ + *trap_mask_supported &=KFD_DBG_TRAP_MASK_FP_INVALID | +KFD_DBG_TRAP_MASK_FP_INPUT_DENORMAL | +KFD_DBG_TRAP_MASK_FP_DIVIDE_BY_ZERO | +KFD_DBG_TRAP_MASK_FP_OVERFLOW | +KFD_DBG_TRAP_MASK_FP_UNDERFLOW | +KFD_DBG_TRAP_MASK_FP_INEXACT | +KFD_DBG_TRAP_MASK_INT_DIVIDE_BY_ZERO | +KFD_DBG_TRAP_MASK_DBG_ADDRESS_WATCH | +KFD_DBG_TRAP_MASK_DBG_MEMORY_VIOLATION | +KFD_DBG_TRAP_MASK_TRAP_ON_WAVE_START | +KFD_DBG_TRAP_MASK_TRAP_ON_WAVE_END ; + +if (trap_override !=KFD_DBG_TRAP_OVERRIDE_OR && + trap_override !=KFD_DBG_TRAP_OVERRIDE_REPLACE ) +return -EPERM ; + +return 0 ; +} + +static uint32_t trap_mask_map_sw_to_hw (uint32_t mask) +{ +uint32_t trap_on_start = (mask &KFD_DBG_TRAP_MASK_TRAP_ON_WAVE_START ) ?1 :0 ; + uint32_t trap_on_end = (mask &
KFD_DBG_TRAP_MASK_TRAP_ON_WAVE_END) ? 1 : 0;drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gc_9_4_3.c +7
-0+uint32_t excp_en = mask & (KFD_DBG_TRAP_MASK_FP_INVALID | +KFD_DBG_TRAP_MASK_FP_INPUT_DENORMAL | +KFD_DBG_TRAP_MASK_FP_DIVIDE_BY_ZERO | +KFD_DBG_TRAP_MASK_FP_OVERFLOW | +KFD_DBG_TRAP_MASK_FP_UNDERFLOW | +KFD_DBG_TRAP_MASK_FP_INEXACT | + KFD_DBG_TRAP_MASK_INT_DIVIDE_BY_ZERO|
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gc_9_4_3.c +5
-0+KFD_DBG_TRAP_MASK_DBG_ADDRESS_WATCH | + KFD_DBG_TRAP_MASK_DBG_MEMORY_VIOLATION); +uint32_t ret; + + ret = REG_SET_FIELD(0, SPI_GDBG_PER_VMID_CNTL, EXCP_EN,
excp_en);
+ ret = REG_SET_FIELD(ret,SPI_GDBG_PER_VMID_CNTL,TRAP_ON_START,trap_on_start);
+ ret = REG_SET_FIELD(ret,SPI_GDBG_PER_VMID_CNTL,TRAP_ON_END,trap_on_end);drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gc_9_4_3.c +7
-0+ +return ret; +} + +static uint32_t trap_mask_map_hw_to_sw (uint32_t mask) +{ + uint32_t ret = REG_GET_FIELD(mask, SPI_GDBG_PER_VMID_CNTL,
EXCP_EN);drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gc_9_4_3.c +2
-0+ + if (REG_GET_FIELD(mask, SPI_GDBG_PER_VMID_CNTL,
TRAP_ON_START))drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gc_9_4_3.c +3
-0+ ret |=KFD_DBG_TRAP_MASK_TRAP_ON_WAVE_START ; + + if (REG_GET_FIELD(mask, SPI_GDBG_PER_VMID_CNTL,
TRAP_ON_END))
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gc_9_4_3.c static int kgd_gfx_v9_4_3_hqd_load(struct amdgpu_device *adev, void *mqd, · line 425
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gc_9_4_3.c +6
-0+ ret |=KFD_DBG_TRAP_MASK_TRAP_ON_WAVE_END ; + +return ret; +} + +/* returns TRAP_EN, EXCP_EN and EXCP_RPLACE. */
Typo. EXCP_RPLACE should be EXCP_REPLACE.
Quoted 86 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gc_9_4_3.c +13
-0+static uint32_t kgd_gfx_v9_4_3_set_wave_launch_trap_override ( +struct amdgpu_device *adev, +uint32_t vmid, +uint32_t trap_override, +uint32_t trap_mask_bits, +uint32_t trap_mask_request, +uint32_t *trap_mask_prev, +uint32_t kfd_dbg_trap_cntl_prev) + +{ +uint32_t data =0 ; + + *trap_mask_prev =
trap_mask_map_hw_to_sw(kfd_dbg_trap_cntl_prev);drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gc_9_4_3.c +6
-0+ + data = (trap_mask_bits & trap_mask_request) | + (*trap_mask_prev & ~trap_mask_request); + data =trap_mask_map_sw_to_hw (data); + + data = REG_SET_FIELD(data, SPI_GDBG_PER_VMID_CNTL, TRAP_EN,1);
+ data = REG_SET_FIELD(data,SPI_GDBG_PER_VMID_CNTL,EXCP_REPLACE,trap_override);drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gc_9_4_3.c +5
-0+ +return data; +} + +#define TCP_WATCH_STRIDE (regTCP_WATCH1_ADDR_H -
regTCP_WATCH0_ADDR_H)drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gc_9_4_3.c +45
-0+static uint32_t kgd_gfx_v9_4_3_set_address_watch ( +struct amdgpu_device *adev, +uint64_t watch_address, +uint32_t watch_address_mask, +uint32_t watch_id, +uint32_t watch_mode, +uint32_t debug_vmid) +{ +uint32_t watch_address_high; +uint32_t watch_address_low; +uint32_t watch_address_cntl; + + watch_address_cntl =0 ; + watch_address_low =lower_32_bits (watch_address); + watch_address_high =upper_32_bits (watch_address) &0xffff ; + + watch_address_cntl =REG_SET_FIELD (watch_address_cntl, +TCP_WATCH0_CNTL , +MODE , + watch_mode); + + watch_address_cntl =REG_SET_FIELD (watch_address_cntl, +TCP_WATCH0_CNTL , +MASK , + watch_address_mask >>7 ); + + watch_address_cntl =REG_SET_FIELD (watch_address_cntl, +TCP_WATCH0_CNTL , +VALID , +1 ); + +WREG32_RLC ((SOC15_REG_OFFSET (GC ,0 , regTCP_WATCH0_ADDR_H) + + (watch_id *TCP_WATCH_STRIDE )), + watch_address_high); + +WREG32_RLC ((SOC15_REG_OFFSET (GC ,0 , regTCP_WATCH0_ADDR_L) + + (watch_id *TCP_WATCH_STRIDE )), + watch_address_low); + +return watch_address_cntl; +} + +static uint32_t kgd_gfx_v9_4_3_clear_address_watch(struct amdgpu_device*adev,
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gc_9_4_3.c +5
-0+ uint32_t watch_id) +{ +return 0 ; +} +const struct kfd2kgd_calls gc_9_4_3_kfd2kgd = { .program_sh_mem_settings =
kgd_gfx_v9_program_sh_mem_settings,
.set_pasid_vmid_mapping =kgd_gfx_v9_4_3_set_pasid_vmid_mapping,
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gc_9_4_3.c const struct kfd2kgd_calls gc_9_4_3_kfd2kgd = { · line 519
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gc_9_4_3.c +1
-1@@ -380,5 +515,14 @@ const struct kfd2kgd_calls gc_9_4_3_kfd2kgd = { .set_vm_context_page_table_base = kgd_gfx_v9_set_vm_context_page_table_base, .program_trap_handler_settings = - kgd_gfx_v9_program_trap_handler_settings + kgd_gfx_v9_program_trap_handler_settings,
What happened to setting up the custom grace period? That should still be a requirement for the debugger.
Thanks,
Jon
Quoted 12 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gc_9_4_3.c +9
-0+ .enable_debug_trap = kgd_aldebaran_enable_debug_trap, + .disable_debug_trap = kgd_aldebaran_disable_debug_trap, + .validate_trap_override_request = + kgd_gfx_v9_4_3_validate_trap_override_request, + .set_wave_launch_trap_override = + kgd_gfx_v9_4_3_set_wave_launch_trap_override, + .set_wave_launch_mode = kgd_aldebaran_set_wave_launch_mode, + .set_address_watch = kgd_gfx_v9_4_3_set_address_watch, + .clear_address_watch = kgd_gfx_v9_4_3_clear_address_watch};
--
2.34.1
PATCH 2/5 drm/amdkfd: add multi-process debugging support for GC v9.4.3
In reply to Eric HuangFrom: Jonathan Kim <[email protected]>
Similar to GC v9.4.2, GC v9.4.3 should use the 5-Dword extended MAP_PROCESS packet to support multi-process debugging. Update the mutli-process debug support list so that the KFD updates the runlist on debug mode setting and that it allocates enough GTT memory during KFD device initialization.
--- drivers/gpu/drm/amd/amdkfd/kfd_debug.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_debug.h +3 -2
@@ -76,8 +76,9 @@ int kfd_dbg_send_exception_to_runtime(struct kfd_process *p,static inline bool kfd_dbg_is_per_vmid_supported (struct kfd_node *dev) { -return KFD_GC_VERSION (dev) ==IP_VERSION (9 ,4 ,2 ) || -KFD_GC_VERSION (dev) >=IP_VERSION (11 ,0 ,0 ); +return (KFD_GC_VERSION (dev) ==IP_VERSION (9 ,4 ,2 ) || +KFD_GC_VERSION (dev) ==IP_VERSION (9 ,4 ,3 ) || +KFD_GC_VERSION (dev) >=IP_VERSION (11 ,0 ,0 )); }void debug_event_write_work_handler (struct work_struct *work);
Signature · 1 line
2.34.1
RE: [PATCH 2/5] drm/amdkfd: add multi-process debugging support for GC v9.4.3
[Public]
Quoted 31 lines
-----Original Message-----
From: Huang, JinHuiEric <[email protected]>
Sent: Wednesday, June 28, 2023 5:23 PM
To: [email protected]
Cc: Kim, Jonathan <[email protected]>; Kim, Jonathan <[email protected]>; Kuehling, Felix <[email protected]>; Huang, JinHuiEric <[email protected]>
Subject: [PATCH 2/5] drm/amdkfd: add multi-process debugging support for GC v9.4.3From: Jonathan Kim <[email protected]>
Similar to GC v9.4.2, GC v9.4.3 should use the 5-Dword extended
MAP_PROCESSpacket to support multi-process debugging. Update the mutli-process debug support list so that the KFD updates the runlist on debug mode setting and that it allocates enough GTT memory during KFD device initialization.Signed-off-by Jonathan Kim <[email protected]>Reviewed-by Felix Kuehling <[email protected]>Signed-off-by Eric Huang <[email protected]>--- drivers/gpu/drm/amd/amdkfd/kfd_debug.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdkfd/kfd_debug.h +0
-0
drivers/gpu/drm/amd/amdkfd/kfd_debug.h int kfd_dbg_send_exception_to_runtime(struct · line 83
Quoted 10 lines
drivers/gpu/drm/amd/amdkfd/kfd_debug.h +3
-2@@ -76,8 +76,9 @@ int kfd_dbg_send_exception_to_runtime(structkfd_process *p, static inline bool kfd_dbg_is_per_vmid_supported(struct kfd_node *dev) { - return KFD_GC_VERSION(dev) == IP_VERSION(9, 4, 2) || - KFD_GC_VERSION(dev) >= IP_VERSION(11, 0, 0); + return (KFD_GC_VERSION(dev) == IP_VERSION(9, 4, 2) || + KFD_GC_VERSION(dev) == IP_VERSION(9, 4, 3) || + KFD_GC_VERSION(dev) >= IP_VERSION(11, 0, 0)); }
This should probably be the last patch in the series since the rest of the series is required to enable debugging correctly. Also did we ever close on enabling the trap temporaries regardless of debug mode?
IIRC, core dump will require this to capture consistent wave data.
That should probably be done in this patch since this check will also trigger the ttmp setup call on process creation.
Thanks,
Jon
Quoted 4 lines
drivers/gpu/drm/amd/amdkfd/kfd_debug.h +0
-1void debug_event_write_work_handler (struct work_struct *work); --2.34.1
PATCH 3/5 drm/amdkfd: restore debugger additional info for gfx v9_4_3
In reply to Eric HuangFrom: Jonathan Kim <[email protected]>
The additional information that the KFD reports to the debugger was destroyed when the following commit was merged:
"drm/amdkfd: convert switches to IP version checking"
--- drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 10 ++++++++-- drivers/gpu/drm/amd/amdkfd/kfd_topology.h | 3 +++ 2 files changed, 11 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_topology.c +8 -2
@@ -1932,8 +1932,14 @@ static void kfd_topology_set_capabilities(struct kfd_topology_device *dev)HSA_CAP_TRAP_DEBUG_WAVE_LAUNCH_MODE_SUPPORTED ;if (KFD_GC_VERSION (dev->gpu) <IP_VERSION (10 ,0 ,0 )) { - dev->node_props.debug_prop |=HSA_DBG_WATCH_ADDR_MASK_LO_BIT_GFX9 | -HSA_DBG_WATCH_ADDR_MASK_HI_BIT ; +if (KFD_GC_VERSION (dev->gpu) ==IP_VERSION (9 ,4 ,3 )) + dev->node_props.debug_prop |= +HSA_DBG_WATCH_ADDR_MASK_LO_BIT_GFX9_4_3 | +HSA_DBG_WATCH_ADDR_MASK_HI_BIT_GFX9_4_3 ; +else + dev->node_props.debug_prop |= +HSA_DBG_WATCH_ADDR_MASK_LO_BIT_GFX9 | +HSA_DBG_WATCH_ADDR_MASK_HI_BIT ;if (KFD_GC_VERSION (dev->gpu) <IP_VERSION (9 ,4 ,2 )) dev->node_props.debug_prop |=
drivers/gpu/drm/amd/amdkfd/kfd_topology.h +3 -0
@@ -32,9 +32,12 @@#define KFD_TOPOLOGY_PUBLIC_NAME_SIZE 32#define HSA_DBG_WATCH_ADDR_MASK_LO_BIT_GFX9 6 +#define HSA_DBG_WATCH_ADDR_MASK_LO_BIT_GFX9_4_3 7#define HSA_DBG_WATCH_ADDR_MASK_LO_BIT_GFX10 7#define HSA_DBG_WATCH_ADDR_MASK_HI_BIT \ (29 << HSA_DBG_WATCH_ADDR_MASK_HI_BIT_SHIFT) +#define HSA_DBG_WATCH_ADDR_MASK_HI_BIT_GFX9_4_3 \ + (30 << HSA_DBG_WATCH_ADDR_MASK_HI_BIT_SHIFT)struct kfd_node_properties {uint64_t hive_id;
Signature · 1 line
2.34.1
PATCH 4/5 drm/amdkfd: add xcc instance for debugger APIs
In reply to Eric HuangSince GFX9 GPU has multiple xcc instances, this is to implement this change in KFD for debugger APIs.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_aldebaran.c | 6 ++++-- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gc_9_4_3.c | 6 ++++-- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10.c | 6 ++++-- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10.h | 6 ++++-- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v11.c | 6 ++++-- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c | 6 ++++-- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.h | 6 ++++-- drivers/gpu/drm/amd/amdkfd/kfd_debug.c | 6 ++++-- drivers/gpu/drm/amd/include/kgd_kfd_interface.h | 6 ++++-- 9 files changed, 36 insertions(+), 18 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_aldebaran.c +4 -2
@@ -126,7 +126,8 @@ static uint32_t kgd_gfx_aldebaran_set_address_watch(uint32_t watch_address_mask, uint32_t watch_id, uint32_t watch_mode, - uint32_t debug_vmid) + uint32_t debug_vmid, + uint32_t inst ) { uint32_t watch_address_high;uint32_t watch_address_low;
@@ -163,7 +164,8 @@ static uint32_t kgd_gfx_aldebaran_set_address_watch( }static uint32_t kgd_gfx_aldebaran_clear_address_watch (struct amdgpu_device *adev, -uint32_t watch_id) +uint32_t watch_id, +uint32_t inst) {return 0 ; }
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gc_9_4_3.c +4 -2
@@ -454,7 +454,8 @@ static uint32_t kgd_gfx_v9_4_3_set_address_watch(uint32_t watch_address_mask, uint32_t watch_id, uint32_t watch_mode, - uint32_t debug_vmid) + uint32_t debug_vmid, + uint32_t inst) { uint32_t watch_address_high;uint32_t watch_address_low;
@@ -491,7 +492,8 @@ static uint32_t kgd_gfx_v9_4_3_set_address_watch( }static uint32_t kgd_gfx_v9_4_3_clear_address_watch (struct amdgpu_device *adev, -uint32_t watch_id) +uint32_t watch_id, +uint32_t inst) {return 0 ; }
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10.c +4 -2
@@ -886,7 +886,8 @@ uint32_t kgd_gfx_v10_set_address_watch(struct amdgpu_device *adev,uint32_t watch_address_mask, uint32_t watch_id, uint32_t watch_mode, - uint32_t debug_vmid) + uint32_t debug_vmid, + uint32_t inst) { uint32_t watch_address_high;uint32_t watch_address_low;
@@ -942,7 +943,8 @@ uint32_t kgd_gfx_v10_set_address_watch(struct amdgpu_device *adev, }uint32_t kgd_gfx_v10_clear_address_watch (struct amdgpu_device *adev, -uint32_t watch_id) +uint32_t watch_id, +uint32_t inst) {uint32_t watch_address_cntl;
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10.h +4 -2
@@ -44,9 +44,11 @@ uint32_t kgd_gfx_v10_set_address_watch(struct amdgpu_device *adev,uint32_t watch_address_mask, uint32_t watch_id, uint32_t watch_mode, - uint32_t debug_vmid); + uint32_t debug_vmid, + uint32_t inst);uint32_t kgd_gfx_v10_clear_address_watch (struct amdgpu_device *adev, -uint32_t watch_id); +uint32_t watch_id, +uint32_t inst);void kgd_gfx_v10_get_iq_wait_times (struct amdgpu_device *adev,uint32_t *wait_times); void kgd_gfx_v10_build_grace_period_packet_info(struct amdgpu_device *adev, uint32_t wait_times,
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v11.c +4 -2
@@ -743,7 +743,8 @@ static uint32_t kgd_gfx_v11_set_address_watch(struct amdgpu_device *adev,uint32_t watch_address_mask, uint32_t watch_id, uint32_t watch_mode, - uint32_t debug_vmid) + uint32_t debug_vmid, + uint32_t inst) { uint32_t watch_address_high;uint32_t watch_address_low;
@@ -780,7 +781,8 @@ static uint32_t kgd_gfx_v11_set_address_watch(struct amdgpu_device *adev, }static uint32_t kgd_gfx_v11_clear_address_watch (struct amdgpu_device *adev, -uint32_t watch_id) +uint32_t watch_id, +uint32_t inst) {return 0 ; }
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c +4 -2
@@ -822,7 +822,8 @@ uint32_t kgd_gfx_v9_set_address_watch(struct amdgpu_device *adev,uint32_t watch_address_mask, uint32_t watch_id, uint32_t watch_mode, - uint32_t debug_vmid) + uint32_t debug_vmid, + uint32_t inst) { uint32_t watch_address_high;uint32_t watch_address_low;
@@ -878,7 +879,8 @@ uint32_t kgd_gfx_v9_set_address_watch(struct amdgpu_device *adev, }uint32_t kgd_gfx_v9_clear_address_watch (struct amdgpu_device *adev, -uint32_t watch_id) +uint32_t watch_id, +uint32_t inst) {uint32_t watch_address_cntl;
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.h +4 -2
@@ -89,9 +89,11 @@ uint32_t kgd_gfx_v9_set_address_watch(struct amdgpu_device *adev,uint32_t watch_address_mask, uint32_t watch_id, uint32_t watch_mode, - uint32_t debug_vmid); + uint32_t debug_vmid, + uint32_t inst);uint32_t kgd_gfx_v9_clear_address_watch (struct amdgpu_device *adev, -uint32_t watch_id); +uint32_t watch_id, +uint32_t inst);void kgd_gfx_v9_get_iq_wait_times (struct amdgpu_device *adev,uint32_t *wait_times); void kgd_gfx_v9_build_grace_period_packet_info(struct amdgpu_device *adev, uint32_t wait_times,
drivers/gpu/drm/amd/amdkfd/kfd_debug.c +4 -2
@@ -427,7 +427,8 @@ int kfd_dbg_trap_clear_dev_address_watch(struct kfd_process_device *pdd,amdgpu_gfx_off_ctrl (pdd->dev->adev, false); pdd->watch_points[watch_id] = pdd->dev->kfd2kgd->clear_address_watch ( pdd->dev->adev, - watch_id); + watch_id, +0 );amdgpu_gfx_off_ctrl (pdd->dev->adev, true);if (!pdd->dev->kfd->shared_resources.enable_mes)
@@ -466,7 +467,8 @@ int kfd_dbg_trap_set_dev_address_watch(struct kfd_process_device *pdd, watch_address_mask, *watch_id, watch_mode, - pdd->dev->vm_info.last_vmid_kfd); + pdd->dev->vm_info.last_vmid_kfd, + 0);amdgpu_gfx_off_ctrl (pdd->dev->adev, true);if (!pdd->dev->kfd->shared_resources.enable_mes)
drivers/gpu/drm/amd/include/kgd_kfd_interface.h +4 -2
@@ -315,9 +315,11 @@ struct kfd2kgd_calls {uint32_t watch_address_mask, uint32_t watch_id, uint32_t watch_mode, - uint32_t debug_vmid); + uint32_t debug_vmid, + uint32_t inst);uint32_t (*clear_address_watch)(struct amdgpu_device *adev, -uint32_t watch_id); +uint32_t watch_id, +uint32_t inst);void (*get_iq_wait_times)(struct amdgpu_device *adev,uint32_t *wait_times); void (*build_grace_period_packet_info)(struct amdgpu_device *adev,
Signature · 1 line
2.34.1
RE: [PATCH 4/5] drm/amdkfd: add xcc instance for debugger APIs
[Public]
Quoted 114 lines
-----Original Message-----
From: Huang, JinHuiEric <[email protected]>
Sent: Wednesday, June 28, 2023 5:23 PM
To: [email protected]
Cc: Kim, Jonathan <[email protected]>; Huang, JinHuiEric <[email protected]>
Subject: [PATCH 4/5] drm/amdkfd: add xcc instance for debugger APIsSince GFX9 GPU has multiple xcc instances, this is to implement this change in KFD for debugger APIs.
Signed-off-by Eric Huang <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_aldebaran.c | 6 ++++-- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gc_9_4_3.c | 6 ++++-- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10.c | 6 ++++-- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10.h | 6 ++++-- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v11.c | 6 ++++-- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c | 6 ++++-- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.h | 6 ++++-- drivers/gpu/drm/amd/amdkfd/kfd_debug.c | 6 ++++-- drivers/gpu/drm/amd/include/kgd_kfd_interface.h | 6 ++++-- 9 files changed, 36 insertions(+), 18 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_aldebaran.c +0
-0@@ -126,7 +126,8 @@ static uint32_tkgd_gfx_aldebaran_set_address_watch(
uint32_t watch_address_mask, uint32_t watch_id, uint32_t watch_mode,drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_aldebaran.c +2
-1- uint32_t debug_vmid) + uint32_t debug_vmid, + uint32_t inst ) {uint32_t watch_address_high;uint32_t watch_address_low;@@ -163,7 +164,8 @@ static uint32_tkgd_gfx_aldebaran_set_address_watch(
}static
uint32_tkgd_gfx_aldebaran_clear_address_watch(structamdgpu_device*adev,drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_aldebaran.c +2
-1- uint32_t watch_id) + uint32_t watch_id, + uint32_t inst) {return 0 ; }drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gc_9_4_3.c +4
-2@@ -454,7 +454,8 @@ static uint32_t kgd_gfx_v9_4_3_set_address_watch(uint32_t watch_address_mask, uint32_t watch_id, uint32_t watch_mode, - uint32_t debug_vmid) + uint32_t debug_vmid, + uint32_t inst) { uint32_t watch_address_high;uint32_t watch_address_low;@@ -491,7 +492,8 @@ static uint32_t kgd_gfx_v9_4_3_set_address_watch( }static uint32_t kgd_gfx_v9_4_3_clear_address_watch (struct amdgpu_device *adev, -uint32_t watch_id) +uint32_t watch_id, +uint32_t inst) {return 0 ;}
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10.c +2
-1@@ -886,7 +886,8 @@ uint32_t kgd_gfx_v10_set_address_watch(structamdgpu_device *adev, uint32_t watch_address_mask, uint32_t watch_id, uint32_t watch_mode, - uint32_t debug_vmid) + uint32_t debug_vmid, + uint32_t inst) { uint32_t watch_address_high;uint32_t watch_address_low;drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10.c +2
-1@@ -942,7 +943,8 @@ uint32_t kgd_gfx_v10_set_address_watch(struct amdgpu_device *adev, }uint32_t kgd_gfx_v10_clear_address_watch (struct amdgpu_device *adev, -uint32_t watch_id) +uint32_t watch_id, +uint32_t inst) {uint32_t watch_address_cntl;drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10.h +0
-0@@ -44,9 +44,11 @@ uint32_t kgd_gfx_v10_set_address_watch(structamdgpu_device *adev, uint32_t watch_address_mask, uint32_t watch_id,
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10.h uint32_t kgd_gfx_v10_set_address_watch(struct · line 54
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10.h +4
-2uint32_t watch_mode, - uint32_t debug_vmid); + uint32_t debug_vmid, + uint32_t inst);uint32_t kgd_gfx_v10_clear_address_watch (struct amdgpu_device *adev, -uint32_t watch_id); +uint32_t watch_id, +uint32_t inst);void kgd_gfx_v10_get_iq_wait_times (struct amdgpu_device *adev,uint32_t *wait_times);
We should instance the iq_wait_times as well to be consistent in what instance we're pulling grace period info from to reset the node's default grace period.
Thanks,
Jon
Quoted 129 lines
void kgd_gfx_v10_build_grace_period_packet_info(struct
amdgpu_device
*adev,
uint32_twait_times,drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v11.c +2
-1@@ -743,7 +743,8 @@ static uint32_t kgd_gfx_v11_set_address_watch(structamdgpu_device *adev, uint32_t watch_address_mask, uint32_t watch_id, uint32_t watch_mode, - uint32_t debug_vmid) + uint32_t debug_vmid, + uint32_t inst) { uint32_t watch_address_high;uint32_t watch_address_low;drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v11.c +2
-1@@ -780,7 +781,8 @@ static uint32_t kgd_gfx_v11_set_address_watch(struct amdgpu_device *adev, }static uint32_t kgd_gfx_v11_clear_address_watch (struct amdgpu_device *adev, -uint32_t watch_id) +uint32_t watch_id, +uint32_t inst) {return 0;}
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c +2
-1@@ -822,7 +822,8 @@ uint32_t kgd_gfx_v9_set_address_watch(structamdgpu_device *adev, uint32_t watch_address_mask, uint32_t watch_id, uint32_t watch_mode, - uint32_t debug_vmid) + uint32_t debug_vmid, + uint32_t inst) { uint32_t watch_address_high;uint32_t watch_address_low;drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c +2
-1@@ -878,7 +879,8 @@ uint32_t kgd_gfx_v9_set_address_watch(struct amdgpu_device *adev, }uint32_t kgd_gfx_v9_clear_address_watch (struct amdgpu_device *adev, -uint32_t watch_id) +uint32_t watch_id, +uint32_t inst) {uint32_t watch_address_cntl;drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.h +4
-2@@ -89,9 +89,11 @@ uint32_t kgd_gfx_v9_set_address_watch(structamdgpu_device *adev, uint32_t watch_address_mask, uint32_t watch_id, uint32_t watch_mode, - uint32_t debug_vmid); + uint32_t debug_vmid, + uint32_t inst);uint32_t kgd_gfx_v9_clear_address_watch (struct amdgpu_device *adev, -uint32_t watch_id); +uint32_t watch_id, +uint32_t inst);void kgd_gfx_v9_get_iq_wait_times (struct amdgpu_device *adev,uint32_t *wait_times);void kgd_gfx_v9_build_grace_period_packet_info(struct
amdgpu_device
*adev,
uint32_twait_times,drivers/gpu/drm/amd/amdkfd/kfd_debug.c +0
-0@@ -427,7 +427,8 @@ int kfd_dbg_trap_clear_dev_address_watch(struct kfd_process_device *pdd,amdgpu_gfx_off_ctrl (pdd->dev->adev, false); pdd->watch_points[watch_id] = pdd->dev->kfd2kgd-Quoted 1 line
clear_address_watch(
pdd->dev->adev,drivers/gpu/drm/amd/amdkfd/kfd_debug.c +4
-2- watch_id); + watch_id, + 0);amdgpu_gfx_off_ctrl (pdd->dev->adev, true);if (!pdd->dev->kfd->shared_resources.enable_mes)@@ -466,7 +467,8 @@ int kfd_dbg_trap_set_dev_address_watch(struct kfd_process_device *pdd, watch_address_mask, *watch_id, watch_mode, - pdd->dev->vm_info.last_vmid_kfd); + pdd->dev->vm_info.last_vmid_kfd, + 0);amdgpu_gfx_off_ctrl (pdd->dev->adev, true);if (!pdd->dev->kfd->shared_resources.enable_mes)drivers/gpu/drm/amd/include/kgd_kfd_interface.h +4
-3@@ -315,9 +315,11 @@ struct kfd2kgd_calls {uint32_t watch_address_mask, uint32_t watch_id, uint32_t watch_mode, - uint32_t debug_vmid); + uint32_t debug_vmid, + uint32_t inst);uint32_t (*clear_address_watch)(struct amdgpu_device *adev, -uint32_t watch_id); +uint32_t watch_id, +uint32_t inst);void (*get_iq_wait_times)(struct amdgpu_device *adev,uint32_t *wait_times); void (*build_grace_period_packet_info)(struct amdgpu_device *adev, --2.34.1
PATCH 5/5 drm/amdkfd: enable watch points globally for gfx943
In reply to Eric HuangFrom: Jonathan Kim <[email protected]>
Set watch points for all xcc instances on GFX943.
--- .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gc_9_4_3.c | 6 ++++-- drivers/gpu/drm/amd/amdkfd/kfd_debug.c | 16 ++++++++++------ 2 files changed, 14 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gc_9_4_3.c +4 -2
@@ -480,11 +480,13 @@ static uint32_t kgd_gfx_v9_4_3_set_address_watch(VALID , 1); -WREG32_RLC ((SOC15_REG_OFFSET (GC ,0 , regTCP_WATCH0_ADDR_H) + +WREG32_RLC ((SOC15_REG_OFFSET (GC ,GET_INST (GC , inst), + regTCP_WATCH0_ADDR_H) + (watch_id *TCP_WATCH_STRIDE )), watch_address_high); -WREG32_RLC ((SOC15_REG_OFFSET (GC ,0 , regTCP_WATCH0_ADDR_L) + +WREG32_RLC ((SOC15_REG_OFFSET (GC ,GET_INST (GC , inst), + regTCP_WATCH0_ADDR_L) + (watch_id *TCP_WATCH_STRIDE )), watch_address_low);
drivers/gpu/drm/amd/amdkfd/kfd_debug.c +10 -6
@@ -413,7 +413,8 @@ static bool kfd_dbg_owns_dev_watch_id(struct kfd_process_device *pdd, int watch_int kfd_dbg_trap_clear_dev_address_watch (struct kfd_process_device *pdd,uint32_t watch_id) { -int r; +int xcc_id, r; +uint32_t xcc_mask = pdd->dev->xcc_mask;if (!kfd_dbg_owns_dev_watch_id (pdd, watch_id))return -EINVAL ;
@@ -425,10 +426,11 @@ int kfd_dbg_trap_clear_dev_address_watch(struct kfd_process_device *pdd, }amdgpu_gfx_off_ctrl (pdd->dev->adev, false); - pdd->watch_points[watch_id] = pdd->dev->kfd2kgd->clear_address_watch ( +for_each_inst (xcc_id, xcc_mask) + pdd->watch_points[watch_id] = pdd->dev->kfd2kgd->clear_address_watch ( pdd->dev->adev, watch_id, -0 ); + xcc_id);amdgpu_gfx_off_ctrl (pdd->dev->adev, true);if (!pdd->dev->kfd->shared_resources.enable_mes)
@@ -447,7 +449,8 @@ int kfd_dbg_trap_set_dev_address_watch(struct kfd_process_device *pdd,uint32_t *watch_id, uint32_t watch_mode) { - int r = kfd_dbg_get_dev_watch_id(pdd, watch_id); + int xcc_id, r = kfd_dbg_get_dev_watch_id(pdd, watch_id); +uint32_t xcc_mask = pdd->dev->xcc_mask;if (r)return r;
@@ -461,14 +464,15 @@ int kfd_dbg_trap_set_dev_address_watch(struct kfd_process_device *pdd, }amdgpu_gfx_off_ctrl (pdd->dev->adev, false); - pdd->watch_points[*watch_id] = pdd->dev->kfd2kgd->set_address_watch ( +for_each_inst (xcc_id, xcc_mask) + pdd->watch_points[*watch_id] = pdd->dev->kfd2kgd->set_address_watch ( pdd->dev->adev, watch_address, watch_address_mask, *watch_id, watch_mode, pdd->dev->vm_info.last_vmid_kfd, -0 ); + xcc_id);amdgpu_gfx_off_ctrl (pdd->dev->adev, true);if (!pdd->dev->kfd->shared_resources.enable_mes)
Signature · 1 line
2.34.1