drm/amdkfd: range check cp bad op exception interrupts
authorjsg <jsg@openbsd.org>
Mon, 20 May 2024 04:52:26 +0000 (04:52 +0000)
committerjsg <jsg@openbsd.org>
Mon, 20 May 2024 04:52:26 +0000 (04:52 +0000)
From Jonathan Kim
41dc6791596656dd41100b85647ed489e1d5c2f2 in linux-6.6.y/6.6.31
0cac183b98d8a8c692c98e8dba37df15a9e9210d in mainline linux

sys/dev/pci/drm/amd/amdkfd/kfd_int_process_v10.c
sys/dev/pci/drm/amd/amdkfd/kfd_int_process_v11.c
sys/dev/pci/drm/amd/amdkfd/kfd_int_process_v9.c

index a7697ec..f85ca6c 100644 (file)
@@ -336,7 +336,8 @@ static void event_interrupt_wq_v10(struct kfd_node *dev,
                                break;
                        }
                        kfd_signal_event_interrupt(pasid, context_id0 & 0x7fffff, 23);
-               } else if (source_id == SOC15_INTSRC_CP_BAD_OPCODE) {
+               } else if (source_id == SOC15_INTSRC_CP_BAD_OPCODE &&
+                          KFD_DBG_EC_TYPE_IS_PACKET(KFD_DEBUG_CP_BAD_OP_ECODE(context_id0))) {
                        kfd_set_dbg_ev_from_interrupt(dev, pasid,
                                KFD_DEBUG_DOORBELL_ID(context_id0),
                                KFD_EC_MASK(KFD_DEBUG_CP_BAD_OP_ECODE(context_id0)),
index 2a65792..3ca9c16 100644 (file)
@@ -325,7 +325,8 @@ static void event_interrupt_wq_v11(struct kfd_node *dev,
                /* CP */
                if (source_id == SOC15_INTSRC_CP_END_OF_PIPE)
                        kfd_signal_event_interrupt(pasid, context_id0, 32);
-               else if (source_id == SOC15_INTSRC_CP_BAD_OPCODE)
+               else if (source_id == SOC15_INTSRC_CP_BAD_OPCODE &&
+                        KFD_DBG_EC_TYPE_IS_PACKET(KFD_CTXID0_CP_BAD_OP_ECODE(context_id0)))
                        kfd_set_dbg_ev_from_interrupt(dev, pasid,
                                KFD_CTXID0_DOORBELL_ID(context_id0),
                                KFD_EC_MASK(KFD_CTXID0_CP_BAD_OP_ECODE(context_id0)),
index 27cdaea..8a67299 100644 (file)
@@ -385,7 +385,8 @@ static void event_interrupt_wq_v9(struct kfd_node *dev,
                                break;
                        }
                        kfd_signal_event_interrupt(pasid, sq_int_data, 24);
-               } else if (source_id == SOC15_INTSRC_CP_BAD_OPCODE) {
+               } else if (source_id == SOC15_INTSRC_CP_BAD_OPCODE &&
+                          KFD_DBG_EC_TYPE_IS_PACKET(KFD_DEBUG_CP_BAD_OP_ECODE(context_id0))) {
                        kfd_set_dbg_ev_from_interrupt(dev, pasid,
                                KFD_DEBUG_DOORBELL_ID(context_id0),
                                KFD_EC_MASK(KFD_DEBUG_CP_BAD_OP_ECODE(context_id0)),