Expose debug capabilities in the KFD topology node's HSA capabilities and debug properties flags. Ensure correct capabilities are exposed based on firmware support. Flag definitions can be referenced in uapi/linux/kfd_sysfs.h.
Showing the changes to include/uapi (1 of 3 files). Show all
Unified · Split
| @@ -43,6 +43,11 @@ · 42 unmodified lines | ||
| 43 | 43 | #define HSA_CAP_DOORBELL_TYPE_2_0 0x2 |
| 44 | 44 | #define HSA_CAP_AQL_QUEUE_DOUBLE_MAP 0x00004000 |
| 45 | 45 | |
| 46 | +#define HSA_CAP_TRAP_DEBUG_SUPPORT 0x00008000 | |
| 47 | +#define HSA_CAP_TRAP_DEBUG_WAVE_LAUNCH_TRAP_OVERRIDE_SUPPORTED 0x00010000 | |
| 48 | +#define HSA_CAP_TRAP_DEBUG_WAVE_LAUNCH_MODE_SUPPORTED 0x00020000 | |
| 49 | +#define HSA_CAP_TRAP_DEBUG_PRECISE_MEMORY_OPERATIONS_SUPPORTED 0x00040000 | |
| 50 | + | |
| 46 | 51 | /* Old buggy user mode depends on this being 0 */ |
| 47 | 52 | #define HSA_CAP_RESERVED_WAS_SRAM_EDCSUPPORTED 0x00080000 |
| 48 | 53 | |
| @@ -53,8 +58,18 @@ · 4 unmodified lines | ||
| 53 | 58 | #define HSA_CAP_SRAM_EDCSUPPORTED 0x04000000 |
| 54 | 59 | #define HSA_CAP_SVMAPI_SUPPORTED 0x08000000 |
| 55 | 60 | #define HSA_CAP_FLAGS_COHERENTHOSTACCESS 0x10000000 |
| 61 | +#define HSA_CAP_TRAP_DEBUG_FIRMWARE_SUPPORTED 0x20000000 | |
| 56 | 62 | #define HSA_CAP_RESERVED 0xe00f8000 |
| 57 | 63 | |
| 64 | +/* debug_prop bits in node properties */ | |
| 65 | +#define HSA_DBG_WATCH_ADDR_MASK_LO_BIT_MASK 0x0000000f | |
| 66 | +#define HSA_DBG_WATCH_ADDR_MASK_LO_BIT_SHIFT 0 | |
| 67 | +#define HSA_DBG_WATCH_ADDR_MASK_HI_BIT_MASK 0x000003f0 | |
| 68 | +#define HSA_DBG_WATCH_ADDR_MASK_HI_BIT_SHIFT 4 | |
| 69 | +#define HSA_DBG_DISPATCH_INFO_ALWAYS_VALID 0x00000400 | |
| 70 | +#define HSA_DBG_WATCHPOINTS_EXCLUSIVE 0x00000800 | |
| 71 | +#define HSA_DBG_RESERVED 0xfffffffffffff000ull | |
| 72 | + | |
| 58 | 73 | /* Heap types in memory properties */ |
| 59 | 74 | #define HSA_MEM_HEAP_TYPE_SYSTEM 0 |
| 60 | 75 | #define HSA_MEM_HEAP_TYPE_FB_PUBLIC 1 |