From: Moses Reuben Date: Thu, 12 Jul 2018 02:32:48 +0000 (-0400) Subject: drm/amdkfd: send SIGSEGV to process upon KFD_EVENT_TYPE_MEMORY X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=101fee63cbb0a3df9e54aaafbfad0ab5821a34e6;p=openwrt%2Fstaging%2Fblogic.git drm/amdkfd: send SIGSEGV to process upon KFD_EVENT_TYPE_MEMORY Signed-off-by: Moses Reuben Reviewed-by: Felix Kuehling Signed-off-by: Felix Kuehling Acked-by: Christian König Signed-off-by: Oded Gabbay --- diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_events.c b/drivers/gpu/drm/amd/amdkfd/kfd_events.c index 5562e94e786a..3d5a8332e8c0 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_events.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_events.c @@ -850,6 +850,13 @@ static void lookup_events_by_type_and_signal(struct kfd_process *p, ev->memory_exception_data = *ev_data; } + if (type == KFD_EVENT_TYPE_MEMORY) { + dev_warn(kfd_device, + "Sending SIGSEGV to HSA Process with PID %d ", + p->lead_thread->pid); + send_sig(SIGSEGV, p->lead_thread, 0); + } + /* Send SIGTERM no event of type "type" has been found*/ if (send_signal) { if (send_sigterm) {