summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdkfd/kfd_debug.c
diff options
context:
space:
mode:
authorJonathan Kim <jonathan.kim@amd.com>2023-08-21 11:47:47 -0400
committerAlex Deucher <alexander.deucher@amd.com>2024-05-02 16:18:13 -0400
commit9243240bed3859fba2d15c016902a4c73a186249 (patch)
treeb99c2b6a76b735283ff47e4a7d15df4f5c154977 /drivers/gpu/drm/amd/amdkfd/kfd_debug.c
parent984b265ff604aa608aefc571a2db173b38fe88ce (diff)
drm/amdkfd: enable single alu ops for gfx12
GFX12 debugging requires setting up precise ALU operation for catching ALU exceptions. Signed-off-by: Jonathan Kim <jonathan.kim@amd.com> Tested-by: Lancelot Six <lancelot.six@amd.com> Reviewed-by: Eric Huang <jinhuieric.huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdkfd/kfd_debug.c')
-rw-r--r--drivers/gpu/drm/amd/amdkfd/kfd_debug.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_debug.c b/drivers/gpu/drm/amd/amdkfd/kfd_debug.c
index d889e3545120..45b1975b149a 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_debug.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_debug.c
@@ -25,6 +25,7 @@
#include "kfd_topology.h"
#include <linux/file.h>
#include <uapi/linux/kfd_ioctl.h>
+#include <uapi/linux/kfd_sysfs.h>
#define MAX_WATCH_ADDRESSES 4
@@ -497,14 +498,24 @@ int kfd_dbg_trap_set_flags(struct kfd_process *target, uint32_t *flags)
int i, r = 0, rewind_count = 0;
for (i = 0; i < target->n_pdds; i++) {
- if (!kfd_dbg_is_per_vmid_supported(target->pdds[i]->dev) &&
+ struct kfd_topology_device *topo_dev =
+ kfd_topology_device_by_id(target->pdds[i]->dev->id);
+ uint32_t caps = topo_dev->node_props.capability;
+
+ if (!(caps | HSA_CAP_TRAP_DEBUG_PRECISE_MEMORY_OPERATIONS_SUPPORTED) &&
(*flags & KFD_DBG_TRAP_FLAG_SINGLE_MEM_OP)) {
*flags = prev_flags;
return -EACCES;
}
+
+ if (!(caps | HSA_CAP_TRAP_DEBUG_PRECISE_ALU_OPERATIONS_SUPPORTED) &&
+ (*flags & KFD_DBG_TRAP_FLAG_SINGLE_ALU_OP)) {
+ *flags = prev_flags;
+ return -EACCES;
+ }
}
- target->dbg_flags = *flags & KFD_DBG_TRAP_FLAG_SINGLE_MEM_OP;
+ target->dbg_flags = *flags;
*flags = prev_flags;
for (i = 0; i < target->n_pdds; i++) {
struct kfd_process_device *pdd = target->pdds[i];