From: jsg Date: Mon, 20 May 2024 04:52:26 +0000 (+0000) Subject: drm/amdkfd: range check cp bad op exception interrupts X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=8b68e9dedc5b1a2ef9fae4d11f703c6d7be32352;p=openbsd drm/amdkfd: range check cp bad op exception interrupts From Jonathan Kim 41dc6791596656dd41100b85647ed489e1d5c2f2 in linux-6.6.y/6.6.31 0cac183b98d8a8c692c98e8dba37df15a9e9210d in mainline linux --- diff --git a/sys/dev/pci/drm/amd/amdkfd/kfd_int_process_v10.c b/sys/dev/pci/drm/amd/amdkfd/kfd_int_process_v10.c index a7697ec8188..f85ca6cb90f 100644 --- a/sys/dev/pci/drm/amd/amdkfd/kfd_int_process_v10.c +++ b/sys/dev/pci/drm/amd/amdkfd/kfd_int_process_v10.c @@ -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)), diff --git a/sys/dev/pci/drm/amd/amdkfd/kfd_int_process_v11.c b/sys/dev/pci/drm/amd/amdkfd/kfd_int_process_v11.c index 2a65792fd11..3ca9c160da7 100644 --- a/sys/dev/pci/drm/amd/amdkfd/kfd_int_process_v11.c +++ b/sys/dev/pci/drm/amd/amdkfd/kfd_int_process_v11.c @@ -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)), diff --git a/sys/dev/pci/drm/amd/amdkfd/kfd_int_process_v9.c b/sys/dev/pci/drm/amd/amdkfd/kfd_int_process_v9.c index 27cdaea4050..8a6729939ae 100644 --- a/sys/dev/pci/drm/amd/amdkfd/kfd_int_process_v9.c +++ b/sys/dev/pci/drm/amd/amdkfd/kfd_int_process_v9.c @@ -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)),