From patchwork Fri Feb 3 01:10:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Harrison X-Patchwork-Id: 13126889 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F2E12C61DA4 for ; Fri, 3 Feb 2023 01:10:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1675410E6DB; Fri, 3 Feb 2023 01:10:43 +0000 (UTC) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8470210E6D4; Fri, 3 Feb 2023 01:10:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675386640; x=1706922640; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=r9mmBGgw9NGT3fFeiAVZvCaD4vbcKWPN3IsssW3yIZM=; b=aV5KIi2+bhVluOEEwdzDoUlXGJo8hkJQ0Zs5fv2JZHelxB4T5Vd6A2s7 oRleHQyeSlEBpykkneO/TFatxuPk55Y8E3MIyKqBj98QMsPDlzQ4t/W+6 Z/XtWdkO49GYwqaDQ+Y61WSkDuHx5whuN100RhQxTyPeNfdT0OO9uT+u/ AOSDxQEIfjAwEZEF85RaRmsK+B2IiRBKj76skhdMtoxs6X0iELr+H9eOD d0M6cWBEl6fQWAMwZl/QEL8ARddymXMs75L2M0uqHyNkrr1rNBYkk05RS h4moXLukr6YAogxCN3CJ1OlgCq7ACAqulpoE3od8KxC8crLo3jqKOi4DH g==; X-IronPort-AV: E=McAfee;i="6500,9779,10609"; a="391021623" X-IronPort-AV: E=Sophos;i="5.97,269,1669104000"; d="scan'208";a="391021623" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Feb 2023 17:10:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10609"; a="665528230" X-IronPort-AV: E=Sophos;i="5.97,269,1669104000"; d="scan'208";a="665528230" Received: from relo-linux-5.jf.intel.com ([10.165.21.152]) by orsmga002.jf.intel.com with ESMTP; 02 Feb 2023 17:10:39 -0800 From: John.C.Harrison@Intel.com To: Intel-GFX@Lists.FreeDesktop.Org Subject: [PATCH 1/3] drm/i915/guc: Fix missing ecodes Date: Thu, 2 Feb 2023 17:10:41 -0800 Message-Id: <20230203011043.3427096-2-John.C.Harrison@Intel.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230203011043.3427096-1-John.C.Harrison@Intel.com> References: <20230203011043.3427096-1-John.C.Harrison@Intel.com> MIME-Version: 1.0 Organization: Intel Corporation (UK) Ltd. - Co. Reg. #1134945 - Pipers Way, Swindon SN3 1RJ X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Matthew Brost , Tvrtko Ursulin , Michael Cheng , Alan Previn , Matthew Auld , Lucas De Marchi , Daniele Ceraolo Spurio , DRI-Devel@Lists.FreeDesktop.Org, Aravind Iddamsetty , Rodrigo Vivi , Umesh Nerlige Ramappa , John Harrison , Bruce Chang Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: John Harrison Error captures are tagged with an 'ecode'. This is a pseduo-unique magic number that is meant to distinguish similar seeming bugs with different underlying signatures. It is a combination of two ring state registers. Unfortunately, the register state being used is only valid in execlist mode. In GuC mode, the register state exists in a separate list of arbitrary register address/value pairs rather than the named entry structure. So, search through that list to find the two exciting registers and copy them over to the structure's named members. v2: if else if instead of if if (Alan) Signed-off-by: John Harrison Fixes: a6f0f9cf330a ("drm/i915/guc: Plumb GuC-capture into gpu_coredump") Cc: Alan Previn Cc: Umesh Nerlige Ramappa Cc: Lucas De Marchi Cc: Jani Nikula Cc: Joonas Lahtinen Cc: Rodrigo Vivi Cc: Tvrtko Ursulin Cc: Matt Roper Cc: Aravind Iddamsetty Cc: Michael Cheng Cc: Matthew Brost Cc: Bruce Chang Cc: Daniele Ceraolo Spurio Cc: Matthew Auld Reviewed-by: Alan Previn --- .../gpu/drm/i915/gt/uc/intel_guc_capture.c | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c index fc3b994626a4f..710999d7189ee 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c @@ -1571,6 +1571,27 @@ int intel_guc_capture_print_engine_node(struct drm_i915_error_state_buf *ebuf, #endif //CONFIG_DRM_I915_CAPTURE_ERROR +static void guc_capture_find_ecode(struct intel_engine_coredump *ee) +{ + struct gcap_reg_list_info *reginfo; + struct guc_mmio_reg *regs; + i915_reg_t reg_ipehr = RING_IPEHR(0); + i915_reg_t reg_instdone = RING_INSTDONE(0); + int i; + + if (!ee->guc_capture_node) + return; + + reginfo = ee->guc_capture_node->reginfo + GUC_CAPTURE_LIST_TYPE_ENGINE_INSTANCE; + regs = reginfo->regs; + for (i = 0; i < reginfo->num_regs; i++) { + if (regs[i].offset == reg_ipehr.reg) + ee->ipehr = regs[i].value; + else if (regs[i].offset == reg_instdone.reg) + ee->instdone.instdone = regs[i].value; + } +} + void intel_guc_capture_free_node(struct intel_engine_coredump *ee) { if (!ee || !ee->guc_capture_node) @@ -1612,6 +1633,7 @@ void intel_guc_capture_get_matching_node(struct intel_gt *gt, list_del(&n->link); ee->guc_capture_node = n; ee->guc_capture = guc->capture; + guc_capture_find_ecode(ee); return; } } From patchwork Fri Feb 3 01:10:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Harrison X-Patchwork-Id: 13126891 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 667F4C61DA4 for ; Fri, 3 Feb 2023 01:10:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E2C5E10E6E4; Fri, 3 Feb 2023 01:10:44 +0000 (UTC) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id BDB0010E6D2; Fri, 3 Feb 2023 01:10:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675386640; x=1706922640; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=SF0gbr5LQ6BigMAU+ZRpz/C1+EuJ1ggUvL6c7dnwOXY=; b=aHNIWDba/OGDlvpBQcQYKCqxKNSNHqWeRH2F6EKXWVw9J5lh6nIxc8rF zoavgHl97ZxP2/jqwAVor9RwG+OrD/9vfV+IciE4QuamK+3C8++qM1Cbf YnxMQ8+YHGTSAS0F/s/acSmrtOjqmrrD9INKOMO5+65cl9de3AT9ZM3I4 Y7w8CotbLB2ddJEdrGyCV8OKocdAb26Q2Hvhq273cfWhzrIEARk98fBFe 5UNDkOu3fQdytggx77yTcyeIt9TXovRRZ80VIhrjUcGX6/HI4Q0dJpg3U FQj/ZFnGnR7UmtEUru81RURePr/Mum/3bgCVVNkDrwx9OIGnh3EPyLJcx A==; X-IronPort-AV: E=McAfee;i="6500,9779,10609"; a="391021624" X-IronPort-AV: E=Sophos;i="5.97,269,1669104000"; d="scan'208";a="391021624" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Feb 2023 17:10:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10609"; a="665528234" X-IronPort-AV: E=Sophos;i="5.97,269,1669104000"; d="scan'208";a="665528234" Received: from relo-linux-5.jf.intel.com ([10.165.21.152]) by orsmga002.jf.intel.com with ESMTP; 02 Feb 2023 17:10:39 -0800 From: John.C.Harrison@Intel.com To: Intel-GFX@Lists.FreeDesktop.Org Subject: [PATCH 2/3] drm/i915/guc: Clean up of register capture search Date: Thu, 2 Feb 2023 17:10:42 -0800 Message-Id: <20230203011043.3427096-3-John.C.Harrison@Intel.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230203011043.3427096-1-John.C.Harrison@Intel.com> References: <20230203011043.3427096-1-John.C.Harrison@Intel.com> MIME-Version: 1.0 Organization: Intel Corporation (UK) Ltd. - Co. Reg. #1134945 - Pipers Way, Swindon SN3 1RJ X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: John Harrison , DRI-Devel@Lists.FreeDesktop.Org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: John Harrison The comparison in the search for a matching register capture node was not the most readable. So remove two redundant terms and re-format to keep each term on a single line, and only one term per line. Signed-off-by: John Harrison Reviewed-by: Alan Previn --- drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c index 710999d7189ee..87b080dd6bead 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c @@ -1627,9 +1627,8 @@ void intel_guc_capture_get_matching_node(struct intel_gt *gt, list_for_each_entry_safe(n, ntmp, &guc->capture->outlist, link) { if (n->eng_inst == GUC_ID_TO_ENGINE_INSTANCE(ee->engine->guc_id) && n->eng_class == GUC_ID_TO_ENGINE_CLASS(ee->engine->guc_id) && - n->guc_id && n->guc_id == ce->guc_id.id && - (n->lrca & CTX_GTT_ADDRESS_MASK) && (n->lrca & CTX_GTT_ADDRESS_MASK) == - (ce->lrc.lrca & CTX_GTT_ADDRESS_MASK)) { + n->guc_id == ce->guc_id.id && + (n->lrca & CTX_GTT_ADDRESS_MASK) == (ce->lrc.lrca & CTX_GTT_ADDRESS_MASK)) { list_del(&n->link); ee->guc_capture_node = n; ee->guc_capture = guc->capture; From patchwork Fri Feb 3 01:10:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Harrison X-Patchwork-Id: 13126888 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1C383C636D3 for ; Fri, 3 Feb 2023 01:10:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 91C1D10E6D4; Fri, 3 Feb 2023 01:10:42 +0000 (UTC) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id F423910E6DB; Fri, 3 Feb 2023 01:10:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675386641; x=1706922641; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=wXf3vlTlkh+uMebUO8Z51WaJ27tJow59rytbzDrAliE=; b=XhqvUOYgOzuuVP3jIF5XwKeObaQZ4wqvtACkLEIU/Rfj4V60h8ef4yOT Ph7q0OoHaC5IqlCLigaB+CcNbaBruHSPpHiYFj6/4oHVcBGx76DVzs95L G6JzIJvmpYXGxGemBof5b6oRgL1dKcz0MBoXt8gyysGeMQECfostKTzn7 JIGamUYPV6Wc7KqLLvzycP8ZzwuNZuk1F4SFEnNg/D7jrETiBFTyMfp9d y99j0dmwLndbWUYwi7KzmRrrblIVh6D9zWL2tdCCVOPCamEKaYwkWyp7a 90NwPSmASLhOKTn8BxcHAq7/GWGUNS67pv9PuwFuOvlRuJ26x1DbXHOf3 A==; X-IronPort-AV: E=McAfee;i="6500,9779,10609"; a="391021625" X-IronPort-AV: E=Sophos;i="5.97,269,1669104000"; d="scan'208";a="391021625" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Feb 2023 17:10:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10609"; a="665528239" X-IronPort-AV: E=Sophos;i="5.97,269,1669104000"; d="scan'208";a="665528239" Received: from relo-linux-5.jf.intel.com ([10.165.21.152]) by orsmga002.jf.intel.com with ESMTP; 02 Feb 2023 17:10:39 -0800 From: John.C.Harrison@Intel.com To: Intel-GFX@Lists.FreeDesktop.Org Subject: [PATCH 3/3] drm/i915: Include timelines in error capture Date: Thu, 2 Feb 2023 17:10:43 -0800 Message-Id: <20230203011043.3427096-4-John.C.Harrison@Intel.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230203011043.3427096-1-John.C.Harrison@Intel.com> References: <20230203011043.3427096-1-John.C.Harrison@Intel.com> MIME-Version: 1.0 Organization: Intel Corporation (UK) Ltd. - Co. Reg. #1134945 - Pipers Way, Swindon SN3 1RJ X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: John Harrison , DRI-Devel@Lists.FreeDesktop.Org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: John Harrison The seqno value actually written out to memory is no longer in the regular HWSP and therefore no longer visible in an error capture. Instead, it is now in its own private timeline buffer. So include that buffer in the capture too. Signed-off-by: John Harrison --- drivers/gpu/drm/i915/i915_gpu_error.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c index 904f21e1380cd..66bd4c1162f79 100644 --- a/drivers/gpu/drm/i915/i915_gpu_error.c +++ b/drivers/gpu/drm/i915/i915_gpu_error.c @@ -1550,6 +1550,7 @@ engine_coredump_add_context(struct intel_engine_coredump *ee, */ vma = capture_vma(vma, ce->ring->vma, "ring", gfp); vma = capture_vma(vma, ce->state, "HW context", gfp); + vma = capture_vma(vma, ce->timeline->hwsp_ggtt, "ctxt timeline HWSP", gfp); return vma; } @@ -1572,6 +1573,8 @@ intel_engine_coredump_add_request(struct intel_engine_coredump *ee, */ vma = capture_vma_snapshot(vma, rq->batch_res, gfp, "batch"); vma = capture_user(vma, rq, gfp); + if (rq->timeline != rq->context->timeline) + vma = capture_vma(vma, rq->timeline->hwsp_ggtt, "rq timeline HWSP", gfp); ee->rq_head = rq->head; ee->rq_post = rq->postfix;