Initial kfd debugger address watch support

Code for new kfd debugger address watch code.
           -- Adding support for:
              -- add address watch
              -- clear address watch

Change-Id: I9b014e7cee03897157b997b9e5b39b6ed403b8e1
Signed-off-by: Philip.Cox@amd.com <Philip.Cox@amd.com>
此提交包含在:
Philip.Cox@amd.com
2020-04-01 13:39:26 -04:00
提交者 Philip Cox
父節點 df16950a0c
當前提交 0a55f31463
共有 5 個檔案被更改,包括 104 行新增5 行删除
+36 -3
查看文件
@@ -28,8 +28,25 @@
#define KFD_IOCTL_MAJOR_VERSION 1
#define KFD_IOCTL_MINOR_VERSION 2
#define KFD_IOCTL_DBG_MAJOR_VERSION 1
#define KFD_IOCTL_DBG_MINOR_VERSION 0
/*
* Debug revision change log
*
* 0.1 - Initial revision
* 0.2 - Fix to include querying pending event that is both trap and vmfault
* 1.0 - Removed function to set debug data (renumbering functions broke ABI)
* 1.1 - Allow attaching to processes that have not opened /dev/kfd yet
* 1.2 - Allow flag option to clear queue status on queue suspend
* 1.3 - Fix race condition between clear on suspend and trap event handling
* 1.3 - Fix race condition between clear on suspend and trap event handling
* 1.4 - Fix bad kfifo free
* 1.5 - Fix ABA issue between queue snapshot and suspend
* 2.0 - Return number of queues suspended/resumed and mask invalid/error
* array slots
* 2.1 - Add Set Address Watch, and Clear Address Watch support.
*/
#define KFD_IOCTL_DBG_MAJOR_VERSION 2
#define KFD_IOCTL_DBG_MINOR_VERSION 1
struct kfd_ioctl_get_version_args {
__u32 major_version; /* from KFD */
@@ -257,6 +274,7 @@ struct kfd_ioctl_dbg_wave_control_args {
* data2: flags (IN)
* data3: suspend[2:2], event type [1:0] (OUT)
*/
#define KFD_IOC_DBG_TRAP_QUERY_DEBUG_EVENT 5
/* KFD_IOC_DBG_TRAP_GET_QUEUE_SNAPSHOT:
@@ -268,13 +286,28 @@ struct kfd_ioctl_dbg_wave_control_args {
#define KFD_IOC_DBG_TRAP_GET_QUEUE_SNAPSHOT 6
/* KFD_IOC_DBG_TRAP_GET_VERSION:
* prt: unsused
* ptr: unsused
* data1: major version (OUT)
* data2: minor version (OUT)
* data3: unused
*/
#define KFD_IOC_DBG_TRAP_GET_VERSION 7
/* KFD_IOC_DBG_TRAP_CLEAR_ADDRESS_WATCH:
* ptr: unused
* data1: watch ID
* data2: unused
* data3: unused
*/
#define KFD_IOC_DBG_TRAP_CLEAR_ADDRESS_WATCH 8
/* KFD_IOC_DBG_TRAP_SET_ADDRESS_WATCH:
* ptr: Watch address
* data1: Watch ID (OUT)
* data2: watch_mode: 0=read, 1=nonread, 2=atomic, 3=all
* data3: watch address mask
*/
#define KFD_IOC_DBG_TRAP_SET_ADDRESS_WATCH 9
struct kfd_ioctl_dbg_trap_args {
__u64 ptr; /* to KFD -- used for pointer arguments: queue arrays */