drm/amdkfd: send SIGSEGV to process upon KFD_EVENT_TYPE_MEMORY
authorMoses Reuben <moses.reuben@amd.com>
Thu, 12 Jul 2018 02:32:48 +0000 (22:32 -0400)
committerOded Gabbay <oded.gabbay@gmail.com>
Thu, 12 Jul 2018 02:32:48 +0000 (22:32 -0400)
Signed-off-by: Moses Reuben <moses.reuben@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
drivers/gpu/drm/amd/amdkfd/kfd_events.c

index 5562e94e786ae2f093f9ebb1d9ac7c801293d7ac..3d5a8332e8c01da692480e8542ebdc6f27a64b4e 100644 (file)
@@ -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) {