/linux/drivers/gpu/drm/amd/amdkfd/ |
H A D | kfd_debug.h | 0ab2d7532b05a3e7c06fd3b0c8bd6b46c1dfb508 Fri Mar 25 19:55:30 CET 2022 Jonathan Kim <jonathan.kim@amd.com> drm/amdkfd: prepare per-process debug enable and disable
The ROCm debugger will attach to a process to debug by PTRACE and will expect the KFD to prepare a process for the target PID, whether the target PID has opened the KFD device or not.
This patch is to explicity handle this requirement. Further HW mode setting and runtime coordination requirements will be handled in following patches.
In the case where the target process has not opened the KFD device, a new KFD process must be created for the target PID. The debugger as well as the target process for this case will have not acquired any VMs so handle process restoration to correctly account for this.
To coordinate with HSA runtime, the debugger must be aware of the target process' runtime enablement status and will copy the runtime status information into the debugged KFD process for later query.
On enablement, the debugger will subscribe to a set of exceptions where each exception events will notify the debugger through a pollable FIFO file descriptor that the debugger provides to the KFD to manage.
Finally on process termination of either the debugger or the target, debugging must be disabled if it has not been done so.
Signed-off-by: Jonathan Kim <jonathan.kim@amd.com> Reviewed-by: Felix Kuehling <felix.kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
|
H A D | kfd_debug.c | 0ab2d7532b05a3e7c06fd3b0c8bd6b46c1dfb508 Fri Mar 25 19:55:30 CET 2022 Jonathan Kim <jonathan.kim@amd.com> drm/amdkfd: prepare per-process debug enable and disable
The ROCm debugger will attach to a process to debug by PTRACE and will expect the KFD to prepare a process for the target PID, whether the target PID has opened the KFD device or not.
This patch is to explicity handle this requirement. Further HW mode setting and runtime coordination requirements will be handled in following patches.
In the case where the target process has not opened the KFD device, a new KFD process must be created for the target PID. The debugger as well as the target process for this case will have not acquired any VMs so handle process restoration to correctly account for this.
To coordinate with HSA runtime, the debugger must be aware of the target process' runtime enablement status and will copy the runtime status information into the debugged KFD process for later query.
On enablement, the debugger will subscribe to a set of exceptions where each exception events will notify the debugger through a pollable FIFO file descriptor that the debugger provides to the KFD to manage.
Finally on process termination of either the debugger or the target, debugging must be disabled if it has not been done so.
Signed-off-by: Jonathan Kim <jonathan.kim@amd.com> Reviewed-by: Felix Kuehling <felix.kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
|
H A D | Makefile | diff 0ab2d7532b05a3e7c06fd3b0c8bd6b46c1dfb508 Fri Mar 25 19:55:30 CET 2022 Jonathan Kim <jonathan.kim@amd.com> drm/amdkfd: prepare per-process debug enable and disable
The ROCm debugger will attach to a process to debug by PTRACE and will expect the KFD to prepare a process for the target PID, whether the target PID has opened the KFD device or not.
This patch is to explicity handle this requirement. Further HW mode setting and runtime coordination requirements will be handled in following patches.
In the case where the target process has not opened the KFD device, a new KFD process must be created for the target PID. The debugger as well as the target process for this case will have not acquired any VMs so handle process restoration to correctly account for this.
To coordinate with HSA runtime, the debugger must be aware of the target process' runtime enablement status and will copy the runtime status information into the debugged KFD process for later query.
On enablement, the debugger will subscribe to a set of exceptions where each exception events will notify the debugger through a pollable FIFO file descriptor that the debugger provides to the KFD to manage.
Finally on process termination of either the debugger or the target, debugging must be disabled if it has not been done so.
Signed-off-by: Jonathan Kim <jonathan.kim@amd.com> Reviewed-by: Felix Kuehling <felix.kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
|
H A D | kfd_process.c | diff 0ab2d7532b05a3e7c06fd3b0c8bd6b46c1dfb508 Fri Mar 25 19:55:30 CET 2022 Jonathan Kim <jonathan.kim@amd.com> drm/amdkfd: prepare per-process debug enable and disable
The ROCm debugger will attach to a process to debug by PTRACE and will expect the KFD to prepare a process for the target PID, whether the target PID has opened the KFD device or not.
This patch is to explicity handle this requirement. Further HW mode setting and runtime coordination requirements will be handled in following patches.
In the case where the target process has not opened the KFD device, a new KFD process must be created for the target PID. The debugger as well as the target process for this case will have not acquired any VMs so handle process restoration to correctly account for this.
To coordinate with HSA runtime, the debugger must be aware of the target process' runtime enablement status and will copy the runtime status information into the debugged KFD process for later query.
On enablement, the debugger will subscribe to a set of exceptions where each exception events will notify the debugger through a pollable FIFO file descriptor that the debugger provides to the KFD to manage.
Finally on process termination of either the debugger or the target, debugging must be disabled if it has not been done so.
Signed-off-by: Jonathan Kim <jonathan.kim@amd.com> Reviewed-by: Felix Kuehling <felix.kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
|
H A D | kfd_chardev.c | diff 0ab2d7532b05a3e7c06fd3b0c8bd6b46c1dfb508 Fri Mar 25 19:55:30 CET 2022 Jonathan Kim <jonathan.kim@amd.com> drm/amdkfd: prepare per-process debug enable and disable
The ROCm debugger will attach to a process to debug by PTRACE and will expect the KFD to prepare a process for the target PID, whether the target PID has opened the KFD device or not.
This patch is to explicity handle this requirement. Further HW mode setting and runtime coordination requirements will be handled in following patches.
In the case where the target process has not opened the KFD device, a new KFD process must be created for the target PID. The debugger as well as the target process for this case will have not acquired any VMs so handle process restoration to correctly account for this.
To coordinate with HSA runtime, the debugger must be aware of the target process' runtime enablement status and will copy the runtime status information into the debugged KFD process for later query.
On enablement, the debugger will subscribe to a set of exceptions where each exception events will notify the debugger through a pollable FIFO file descriptor that the debugger provides to the KFD to manage.
Finally on process termination of either the debugger or the target, debugging must be disabled if it has not been done so.
Signed-off-by: Jonathan Kim <jonathan.kim@amd.com> Reviewed-by: Felix Kuehling <felix.kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
|
H A D | kfd_device_queue_manager.c | diff 0ab2d7532b05a3e7c06fd3b0c8bd6b46c1dfb508 Fri Mar 25 19:55:30 CET 2022 Jonathan Kim <jonathan.kim@amd.com> drm/amdkfd: prepare per-process debug enable and disable
The ROCm debugger will attach to a process to debug by PTRACE and will expect the KFD to prepare a process for the target PID, whether the target PID has opened the KFD device or not.
This patch is to explicity handle this requirement. Further HW mode setting and runtime coordination requirements will be handled in following patches.
In the case where the target process has not opened the KFD device, a new KFD process must be created for the target PID. The debugger as well as the target process for this case will have not acquired any VMs so handle process restoration to correctly account for this.
To coordinate with HSA runtime, the debugger must be aware of the target process' runtime enablement status and will copy the runtime status information into the debugged KFD process for later query.
On enablement, the debugger will subscribe to a set of exceptions where each exception events will notify the debugger through a pollable FIFO file descriptor that the debugger provides to the KFD to manage.
Finally on process termination of either the debugger or the target, debugging must be disabled if it has not been done so.
Signed-off-by: Jonathan Kim <jonathan.kim@amd.com> Reviewed-by: Felix Kuehling <felix.kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
|
H A D | kfd_priv.h | diff 0ab2d7532b05a3e7c06fd3b0c8bd6b46c1dfb508 Fri Mar 25 19:55:30 CET 2022 Jonathan Kim <jonathan.kim@amd.com> drm/amdkfd: prepare per-process debug enable and disable
The ROCm debugger will attach to a process to debug by PTRACE and will expect the KFD to prepare a process for the target PID, whether the target PID has opened the KFD device or not.
This patch is to explicity handle this requirement. Further HW mode setting and runtime coordination requirements will be handled in following patches.
In the case where the target process has not opened the KFD device, a new KFD process must be created for the target PID. The debugger as well as the target process for this case will have not acquired any VMs so handle process restoration to correctly account for this.
To coordinate with HSA runtime, the debugger must be aware of the target process' runtime enablement status and will copy the runtime status information into the debugged KFD process for later query.
On enablement, the debugger will subscribe to a set of exceptions where each exception events will notify the debugger through a pollable FIFO file descriptor that the debugger provides to the KFD to manage.
Finally on process termination of either the debugger or the target, debugging must be disabled if it has not been done so.
Signed-off-by: Jonathan Kim <jonathan.kim@amd.com> Reviewed-by: Felix Kuehling <felix.kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
|