Add GuC Error Capture Support
Subsystems (2)
cover Add GuC Error Capture Support
This series:
1. Enables support of GuC to execute error- state-capture based on a list of MMIO
registers the driver registers and GuC will dump and report back right before a GuC triggered engine-reset event.
2. Updates the ADS blob creation to register lists of global and engine registers with GuC.
3. Defines tables of register lists that are global or engine class or engine instance in scope.
4. Separates GuC log-buffer access locks for relay logging vs the new region for the error state capture data.
5. Allocates an additional interim circular buffer store to copy snapshots of new GuC reported error-state-capture dumps in response to the G2H notification.
6. Connects the i915_gpu_coredump reporting function to the GuC error capture module to print all GuC error state capture dumps that is reported.
This is the 4th rev of this series with the first 3 revs labelled as RFC.
Prior receipts of rvb's:
- Patch #4 has received R-v-b from Matthew Brost <[email protected]>
Changes from prior revs:
v4:
- Rebased on latest drm-tip that has been merged with the support of GuC firmware version 69.0.3 that is required for GuC error-state-catpure to work.
- Added register list for DG2 which is the same as XE_LP except an additional steering register set.
- Fixed a bug in the end of capture parsing loop in intel_guc_capture_out_print_next_group that was not properly comparing the engine-instance and engine- class being parsed against the one that triggered the i915_gpu_coredump.
v3:
- Fixed all review comments from rev2 except the following:
- Michal Wajdeczko proposed adding a seperate function to lookup register string nameslookup (based on offset) but decided against it because of offset conflicts and the current table layout is easier to maintain.
- Last set of checkpatch errors pertaining to "COMPLEX MACROS" should be fixed on next rev.
- Abstracted internal-to-guc-capture information into a new __guc_state_capture_priv structure that allows the exclusion of intel_guc.h and intel_guc_fwif.h from intel_guc_capture.h. Now, only the first 2 patches have a wider build time impact because of the changes to intel_guc_fwif.h but subsequent changes to guc-capture internal structures or firmware interfaces used solely by guc-capture module shoudn't impact the rest of the driver build.
- Added missing Gen12LP registers and added slice+subslice indices when reporting extended steered registers.
- Add additional checks to ensure that the GuC reported error capture information matches the i915_gpu_coredump that is being printed before we print out the corresponding VMA dumps such as the batch buffer.
v2:
- Ignore - failed CI retest.
Alan Previn (7):
drm/i915/guc: Update GuC ADS size for error capture lists drm/i915/guc: Add XE_LP registers for GuC error state capture. drm/i915/guc: Add DG2 registers for GuC error state capture. drm/i915/guc: Add GuC's error state capture output structures. drm/i915/guc: Update GuC's log-buffer-state access for error capture. drm/i915/guc: Copy new GuC error capture logs upon G2H notification. drm/i915/guc: Print the GuC error capture output register list.
drivers/gpu/drm/i915/Makefile | 1 + drivers/gpu/drm/i915/gt/intel_engine_cs.c | 4 +- .../gpu/drm/i915/gt/uc/abi/guc_actions_abi.h | 7 + drivers/gpu/drm/i915/gt/uc/guc_capture_fwif.h | 85 ++ drivers/gpu/drm/i915/gt/uc/intel_guc.c | 13 +- drivers/gpu/drm/i915/gt/uc/intel_guc.h | 13 +- drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c | 36 +- .../gpu/drm/i915/gt/uc/intel_guc_capture.c | 1310 +++++++++++++++++ .../gpu/drm/i915/gt/uc/intel_guc_capture.h | 30 + drivers/gpu/drm/i915/gt/uc/intel_guc_fwif.h | 21 +- drivers/gpu/drm/i915/gt/uc/intel_guc_log.c | 155 +- drivers/gpu/drm/i915/gt/uc/intel_guc_log.h | 20 +- .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 14 +- drivers/gpu/drm/i915/i915_gpu_error.c | 65 +- drivers/gpu/drm/i915/i915_gpu_error.h | 14 + 15 files changed, 1669 insertions(+), 119 deletions(-) create mode 100644 drivers/gpu/drm/i915/gt/uc/guc_capture_fwif.h create mode 100644 drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c create mode 100644 drivers/gpu/drm/i915/gt/uc/intel_guc_capture.h
Signature · 1 line
2.25.1
PATCH 1/7 drm/i915/guc: Update GuC ADS size for error capture lists
Update GuC ADS size allocation to include space for the lists of error state capture register descriptors.
Also, populate the lists of registers we want GuC to report back to Host on engine reset events. This list should include global, engine-class and engine-instance registers for every engine-class type on the current hardware.
NOTE: Start with a sample table of register lists to layout the framework before adding real registers in subsequent patch.
--- drivers/gpu/drm/i915/Makefile | 1 + drivers/gpu/drm/i915/gt/uc/guc_capture_fwif.h | 36 ++ drivers/gpu/drm/i915/gt/uc/intel_guc.c | 13 +- drivers/gpu/drm/i915/gt/uc/intel_guc.h | 11 +- drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c | 36 +- .../gpu/drm/i915/gt/uc/intel_guc_capture.c | 450 ++++++++++++++++++ .../gpu/drm/i915/gt/uc/intel_guc_capture.h | 20 + drivers/gpu/drm/i915/gt/uc/intel_guc_fwif.h | 17 + 8 files changed, 555 insertions(+), 29 deletions(-) create mode 100644 drivers/gpu/drm/i915/gt/uc/guc_capture_fwif.h create mode 100644 drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c create mode 100644 drivers/gpu/drm/i915/gt/uc/intel_guc_capture.h
drivers/gpu/drm/i915/Makefile +1 -0
@@ -183,6 +183,7 @@ i915-y += gt/uc/intel_uc.o \ gt/uc/intel_uc_fw.o \ gt/uc/intel_guc.o \ gt/uc/intel_guc_ads.o \ + gt/uc/intel_guc_capture.o \ gt/uc/intel_guc_ct.o \ gt/uc/intel_guc_debugfs.o \ gt/uc/intel_guc_fw.o \
drivers/gpu/drm/i915/gt/uc/guc_capture_fwif.h new file +36 -0
@@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: MIT */ +/* +* Copyright © 2021-2021 Intel Corporation +*/ + +#ifndef _INTEL_GUC_CAPTURE_FWIF_H +#define _INTEL_GUC_CAPTURE_FWIF_H + +#include <linux/types.h> +#include "intel_guc_fwif.h" + +struct intel_guc ; + +struct __guc_mmio_reg_descr { +i915_reg_t reg; +u32 flags; +u32 mask; +const char *regname; +}; + +struct __guc_mmio_reg_descr_group { +struct __guc_mmio_reg_descr *list; +u32 num_regs; +u32 owner;/* see enum guc_capture_owner */ +u32 type;/* see enum guc_capture_type */ +u32 engine;/* as per MAX_ENGINE_CLASS */ +}; + +struct __guc_state_capture_priv { +struct __guc_mmio_reg_descr_group *reglists; +u16 num_instance_regs[GUC_CAPTURE_LIST_INDEX_MAX ][GUC_MAX_ENGINE_CLASSES ]; +u16 num_class_regs[GUC_CAPTURE_LIST_INDEX_MAX ][GUC_MAX_ENGINE_CLASSES ]; +u16 num_global_regs[GUC_CAPTURE_LIST_INDEX_MAX ]; +}; + +#endif /* _INTEL_GUC_CAPTURE_FWIF_H */
drivers/gpu/drm/i915/gt/uc/intel_guc.c +11 -2
@@ -8,8 +8,9 @@#include "gt/intel_gt_irq.h" #include "gt/intel_gt_pm_irq.h" #include "intel_guc.h" -#include "intel_guc_slpc.h" #include "intel_guc_ads.h" +#include "intel_guc_capture.h" +#include "intel_guc_slpc.h" #include "intel_guc_submission.h" #include "i915_drv.h" #include "i915_irq.h"
@@ -361,9 +362,14 @@ int intel_guc_init(struct intel_guc *guc)if (ret) goto err_fw; - ret =intel_guc_ads_create (guc); + ret =intel_guc_capture_init (guc);if (ret) goto err_log; + + ret =intel_guc_ads_create (guc); +if (ret) + goto err_capture; +GEM_BUG_ON (!guc->ads_vma); ret =intel_guc_ct_init (&guc->ct);
@@ -402,6 +408,8 @@ int intel_guc_init(struct intel_guc *guc)intel_guc_ct_fini (&guc->ct); err_ads:intel_guc_ads_destroy (guc); +err_capture: +intel_guc_capture_destroy (guc); err_log:intel_guc_log_destroy (&guc->log); err_fw:
@@ -429,6 +437,7 @@ void intel_guc_fini(struct intel_guc *guc)intel_guc_ct_fini (&guc->ct);intel_guc_ads_destroy (guc); +intel_guc_capture_destroy (guc);intel_guc_log_destroy (&guc->log);intel_uc_fw_fini (&guc->fw); }
drivers/gpu/drm/i915/gt/uc/intel_guc.h +9 -2
@@ -9,18 +9,19 @@#include <linux/xarray.h> #include <linux/delay.h> -#include "intel_uncore.h" +#include "intel_guc_ct.h" #include "intel_guc_fw.h" #include "intel_guc_fwif.h" -#include "intel_guc_ct.h" #include "intel_guc_log.h" #include "intel_guc_reg.h" #include "intel_guc_slpc_types.h" #include "intel_uc_fw.h" +#include "intel_uncore.h" #include "i915_utils.h" #include "i915_vma.h" struct __guc_ads_blob ; +struct __guc_state_capture_priv ;/** * struct intel_guc - Top level structure of GuC.
@@ -37,6 +38,10 @@ struct intel_guc {struct intel_guc_ct ct;/** @slpc: sub-structure containing SLPC related data and objects */ struct intel_guc_slpc slpc; +/** @capture: the error-state-capture module's data and objects */ +struct intel_guc_state_capture { +struct __guc_state_capture_priv *priv; + } capture;/** @sched_engine: Global engine used to submit requests to GuC */ struct i915_sched_engine *sched_engine;
@@ -143,6 +148,8 @@ struct intel_guc {u32 ads_regset_size;/** @ads_golden_ctxt_size: size of the golden contexts in the ADS */ u32 ads_golden_ctxt_size; +/** @ads_capture_size: size of register lists in the ADS used for error capture */ +u32 ads_capture_size;/** @ads_engine_usage_size: size of engine usage in the ADS */ u32 ads_engine_usage_size;
drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c +11 -25
@@ -10,6 +10,7 @@#include "gt/intel_lrc.h" #include "gt/shmem_utils.h" #include "intel_guc_ads.h" +#include "intel_guc_capture.h" #include "intel_guc_fwif.h" #include "intel_uc.h" #include "i915_drv.h"
@@ -72,8 +73,7 @@ static u32 guc_ads_golden_ctxt_size(struct intel_guc *guc)static u32 guc_ads_capture_size (struct intel_guc *guc) { -/* FIXME: Allocate a proper capture list */ -return PAGE_ALIGN (PAGE_SIZE ); +return PAGE_ALIGN (guc->ads_capture_size); }static u32 guc_ads_private_data_size (struct intel_guc *guc)
@@ -520,26 +520,6 @@ static void guc_init_golden_context(struct intel_guc *guc)GEM_BUG_ON (guc->ads_golden_ctxt_size != total_size); } -static void guc_capture_list_init (struct intel_guc *guc,struct __guc_ads_blob *blob) -{ -int i, j; -u32 addr_ggtt, offset; - - offset =guc_ads_capture_offset (guc); - addr_ggtt =intel_guc_ggtt_offset (guc, guc->ads_vma) + offset; - -/* FIXME: Populate a proper capture list */ - -for (i =0 ; i <GUC_CAPTURE_LIST_INDEX_MAX ; i++) { -for (j =0 ; j <GUC_MAX_ENGINE_CLASSES ; j++) { - blob->ads.capture_instance[i][j] = addr_ggtt; - blob->ads.capture_class[i][j] = addr_ggtt; - } - - blob->ads.capture_global[i] = addr_ggtt; - } -} -static void __guc_ads_init (struct intel_guc *guc) {struct intel_gt *gt =guc_to_gt (guc);
@@ -573,9 +553,9 @@ static void __guc_ads_init(struct intel_guc *guc) base =intel_guc_ggtt_offset (guc, guc->ads_vma); -/* Capture list for hang debug */ -guc_capture_list_init (guc, blob); - +/* Lists for error capture debug */ +intel_guc_capture_prep_lists (guc, (struct guc_ads *)blob, base, +guc_ads_capture_offset (guc), &blob->system_info);/* ADS */ blob->ads.scheduler_policies = base +ptr_offset (blob, policies); blob->ads.gt_system_info = base +ptr_offset (blob, system_info);
@@ -615,6 +595,12 @@ int intel_guc_ads_create(struct intel_guc *guc)return ret; guc->ads_golden_ctxt_size = ret; +/* Likewise the capture lists: */ + ret =intel_guc_capture_prep_lists (guc,NULL ,0 ,0 ,NULL ); +if (ret <0 ) +return ret; + guc->ads_capture_size = ret; +/* Now the total size can be determined: */ size =guc_ads_blob_size (guc);
drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c new file +450 -0
450 lines not on this page · raw message
drivers/gpu/drm/i915/gt/uc/intel_guc_capture.h new file +20 -0
@@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: MIT */ +/* +* Copyright © 2021-2021 Intel Corporation +*/ + +#ifndef _INTEL_GUC_CAPTURE_H +#define _INTEL_GUC_CAPTURE_H + +#include <linux/types.h> + +struct intel_guc ; +struct guc_ads ; +struct guc_gt_system_info ; + +int intel_guc_capture_prep_lists (struct intel_guc *guc,struct guc_ads *blob,u32 blob_ggtt, +u32 capture_offset,struct guc_gt_system_info *sysinfo); +void intel_guc_capture_destroy (struct intel_guc *guc); +int intel_guc_capture_init (struct intel_guc *guc); + +#endif /* _INTEL_GUC_CAPTURE_H */
drivers/gpu/drm/i915/gt/uc/intel_guc_fwif.h +17 -0
@@ -297,6 +297,23 @@ enum { GUC_CAPTURE_LIST_INDEX_MAX = 2, }; +/*Register-types of GuC capture register lists */ +enum guc_capture_type { +GUC_CAPTURE_LIST_TYPE_GLOBAL =0 , +GUC_CAPTURE_LIST_TYPE_ENGINE_CLASS , +GUC_CAPTURE_LIST_TYPE_ENGINE_INSTANCE , +GUC_CAPTURE_LIST_TYPE_MAX , +}; + +struct guc_debug_capture_list_header { +u32 info; +#define GUC_CAPTURELISTHDR_NUMDESCR GENMASK(15, 0) +} __packed; + +struct guc_debug_capture_list { +struct guc_debug_capture_list_header header; +} __packed; +/* GuC Additional Data Struct */ struct guc_ads {struct guc_mmio_reg_set reg_state_list[GUC_MAX_ENGINE_CLASSES ][GUC_MAX_INSTANCES_PER_CLASS ];
Signature · 1 line
2.25.1
PATCH 2/7 drm/i915/guc: Add XE_LP registers for GuC error state capture.
In reply to Alan PrevinAdd device specific tables and register lists to cover different engines class types for GuC error state capture for XE_LP products.
Also, add runtime allocation and freeing of extended register lists for registers that need steering identifiers that depend on the detected HW config.
--- drivers/gpu/drm/i915/gt/uc/guc_capture_fwif.h | 2 + .../gpu/drm/i915/gt/uc/intel_guc_capture.c | 208 +++++++++++++++--- drivers/gpu/drm/i915/gt/uc/intel_guc_fwif.h | 4 +- 3 files changed, 186 insertions(+), 28 deletions(-)
drivers/gpu/drm/i915/gt/uc/guc_capture_fwif.h +2 -0
@@ -24,6 +24,8 @@ struct __guc_mmio_reg_descr_group {u32 owner;/* see enum guc_capture_owner */ u32 type;/* see enum guc_capture_type */ u32 engine;/* as per MAX_ENGINE_CLASS */ +int num_ext; +struct __guc_mmio_reg_descr *ext; };struct __guc_state_capture_priv {
drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c +181 -27
289 lines not on this page · raw message
drivers/gpu/drm/i915/gt/uc/intel_guc_fwif.h +3 -1
@@ -271,10 +271,12 @@ struct guc_mmio_reg {u32 offset;u32 value;u32 flags; -u32 mask;#define GUC_REGSET_MASKED BIT(0)#define GUC_REGSET_MASKED_WITH_VALUE BIT(2)#define GUC_REGSET_RESTORE_ONLY BIT(3) +#define GUC_REGSET_STEERING_GROUP GENMASK(15, 12) +#define GUC_REGSET_STEERING_INSTANCE GENMASK(23, 20) +u32 mask; } __packed;/* GuC register sets */
Signature · 1 line
2.25.1
Re: [Intel-gfx] [PATCH 2/7] drm/i915/guc: Add XE_LP registers for GuC error state capture.
Internal feedback is to exactly match the register dumps output as it did in execlist, however it seems that the register dump function in execlist targetting the GT subsystem also includes non-GT registers like display-related ones that GuC doesn't manage. So for that, I will have to break up the execlist function into global-non-gt vs global-gt and then call the former for both GuC and non-GuC cases (skipping latter when GuC is doing the dump).
...alan
Quoted 36 lines · Alan Previn
Add device specific tables and register lists to cover different engines class types for GuC error state capture for
XE_LPproducts.Also, add runtime allocation and freeing of extended register lists for registers that need steering identifiers that depend on the detected HW config.
Signed-off-by Alan Previn <[email protected]>--- drivers/gpu/drm/i915/gt/uc/guc_capture_fwif.h | 2 + .../gpu/drm/i915/gt/uc/intel_guc_capture.c | 208 +++++++++++++++--- drivers/gpu/drm/i915/gt/uc/intel_guc_fwif.h | 4 +- 3 files changed, 186 insertions(+), 28 deletions(-)drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c +14
-0@@ -19,20 +19,84 @@* NOTE: For engine-registers, GuC only needs the register offsets * from the engine-mmio-base */ +#define COMMON_GEN12BASE_GLOBAL () \ + {GEN12_FAULT_TLB_DATA0, 0, 0, "GEN12_FAULT_TLB_DATA0"}, \ + {GEN12_FAULT_TLB_DATA1, 0, 0, "GEN12_FAULT_TLB_DATA1"}, \ + {FORCEWAKE_MT, 0, 0, "FORCEWAKE_MT"}, \ + {DERRMR, 0, 0, "DERRMR"}, \ + {GEN12_AUX_ERR_DBG, 0, 0, "GEN12_AUX_ERR_DBG"}, \ + {GEN12_GAM_DONE, 0, 0, "GEN12_GAM_DONE"}, \ + {GEN11_GUC_SG_INTR_ENABLE, 0, 0, "GEN11_GUC_SG_INTR_ENABLE"}, \ + {GEN11_CRYPTO_RSVD_INTR_ENABLE, 0, 0, "GEN11_CRYPTO_RSVD_INTR_ENABLE"}, \ + {GEN11_GUNIT_CSME_INTR_ENABLE, 0, 0, "GEN11_GUNIT_CSME_INTR_ENABLE"}, \ + {GEN11_GPM_WGBOXPERF_INTR_ENABLE, 0, 0, "GEN11_GPM_WGBOXPERF_INTR_ENABLE"}, \ + {GEN8_DE_MISC_IER, 0, 0, "GEN8_DE_MISC_IER"}, \ + {GEN12_RING_FAULT_REG, 0, 0, "GEN12_RING_FAULT_REG"} +
PATCH 3/7 drm/i915/guc: Add DG2 registers for GuC error state capture.
In reply to Alan PrevinAdd additional DG2 registers for GuC error state capture.
--- .../gpu/drm/i915/gt/uc/intel_guc_capture.c | 64 ++++++++++++++----- 1 file changed, 49 insertions(+), 15 deletions(-)
drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c +49 -15
@@ -190,19 +190,23 @@ static struct __ext_steer_reg xelpd_extregs[] = { {"GEN7_ROW_INSTDONE", GEN7_ROW_INSTDONE} }; +static struct __ext_steer_reg xehpg_extregs[] = { + {"XEHPG_INSTDONE_GEOM_SVG" ,XEHPG_INSTDONE_GEOM_SVG } +}; +static void -guc_capture_alloc_steered_list_xelpd (struct intel_guc *guc, -struct __guc_mmio_reg_descr_group *lists) +guc_capture_alloc_steered_list_xe_lpd_hpg (struct intel_guc *guc, +struct __guc_mmio_reg_descr_group *lists, +u32 ipver) {struct intel_gt *gt =guc_to_gt (guc);struct drm_i915_private *i915 =guc_to_gt (guc)->i915;struct sseu_dev_info *sseu; -int slice, subslice, i, num_tot_regs =0 ; +int slice, subslice, i, iter, num_steer_regs, num_tot_regs =0 ;struct __guc_mmio_reg_descr_group *list;struct __guc_mmio_reg_descr *extarray; -int num_steer_regs =ARRAY_SIZE (xelpd_extregs); -/* In XE_LP we only care about render-class steering registers during error-capture */ +/* In XE_LP / HPG we only have render-class steering registers during error-capture */ list =guc_capture_get_one_list (lists,GUC_CAPTURE_LIST_INDEX_PF ,GUC_CAPTURE_LIST_TYPE_ENGINE_CLASS ,GUC_RENDER_CLASS );if (!list)
@@ -211,10 +215,21 @@ guc_capture_alloc_steered_list_xelpd(struct intel_guc *guc,if (list->ext)return ;/* already populated */ + num_steer_regs =ARRAY_SIZE (xelpd_extregs); +if (ipver >=IP_VER (12 ,55 )) + num_steer_regs +=ARRAY_SIZE (xehpg_extregs); + sseu = >->info.sseu; -for_each_instdone_slice_subslice (i915, sseu, slice, subslice) { - num_tot_regs += num_steer_regs; +if (ipver >=IP_VER (12 ,50 )) { +for_each_instdone_gslice_dss_xehp (i915, sseu, iter, slice, subslice) { + num_tot_regs += num_steer_regs; + } + }else { +for_each_instdone_slice_subslice (i915, sseu, slice, subslice) { + num_tot_regs += num_steer_regs; + } } +if (!num_tot_regs)return ;
@@ -223,15 +238,31 @@ guc_capture_alloc_steered_list_xelpd(struct intel_guc *guc,return ; extarray = list->ext; -for_each_instdone_slice_subslice (i915, sseu, slice, subslice) { -for (i =0 ; i < num_steer_regs; i++) { - extarray->reg = xelpd_extregs[i].reg; - extarray->flags =FIELD_PREP (GUC_REGSET_STEERING_GROUP , slice); - extarray->flags |=FIELD_PREP (GUC_REGSET_STEERING_INSTANCE , subslice); - extarray->regname = xelpd_extregs[i].name; - ++extarray; + +#define POPULATE_NEXT_EXTREG (ext, list, idx, slicenum, subslicenum) \ + { \ + ext->reg = list[idx].reg; \ + ext->flags = FIELD_PREP(GUC_REGSET_STEERING_GROUP, slicenum); \ + ext->flags |= FIELD_PREP(GUC_REGSET_STEERING_INSTANCE, subslicenum); \ + ext->regname = xelpd_extregs[i].name; \ + ++ext; \ + } +if (ipver >=IP_VER (12 ,50 )) { +for_each_instdone_gslice_dss_xehp (i915, sseu, iter, slice, subslice) { +for (i =0 ; i <ARRAY_SIZE (xelpd_extregs); i++) + POPULATE_NEXT_EXTREG(extarray, xelpd_extregs, i, slice, subslice) +for (i =0 ; i <ARRAY_SIZE (xehpg_extregs) && ipver >=IP_VER (12 ,55 ); + i++) + POPULATE_NEXT_EXTREG(extarray, xehpg_extregs, i, slice, subslice) + } + }else { +for_each_instdone_slice_subslice (i915, sseu, slice, subslice) { +for (i =0 ; i < num_steer_regs; i++) + POPULATE_NEXT_EXTREG(extarray, xelpd_extregs, i, slice, subslice) } } +#undef POPULATE_NEXT_EXTREG + list->num_ext = num_tot_regs; }
@@ -248,7 +279,10 @@ guc_capture_get_device_reglist(struct intel_guc *guc)* these at init time based on hw config add it as an extension * list at the end of the pre-populated render list. */ -guc_capture_alloc_steered_list_xelpd (guc, xe_lpd_lists); +guc_capture_alloc_steered_list_xe_lpd_hpg (guc, xe_lpd_lists,IP_VER (12 ,0 )); +return xe_lpd_lists; + }else if (IS_DG2 (i915)) { +guc_capture_alloc_steered_list_xe_lpd_hpg (guc, xe_lpd_lists,IP_VER (12 ,55 ));return xe_lpd_lists; }
Signature · 1 line
2.25.1
PATCH 4/7 drm/i915/guc: Add GuC's error state capture output structures.
In reply to Alan PrevinAdd GuC's error capture output structures and definitions as how they would appear in GuC log buffer's error capture subregion after an error state capture G2H event notification.
--- drivers/gpu/drm/i915/gt/uc/guc_capture_fwif.h | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+)
drivers/gpu/drm/i915/gt/uc/guc_capture_fwif.h +35 -0
@@ -28,6 +28,41 @@ struct __guc_mmio_reg_descr_group {struct __guc_mmio_reg_descr *ext; }; +struct guc_state_capture_header_t { +u32 reserved1; +u32 info; +#define CAP_HDR_CAPTURE_TYPE GENMASK(3, 0)/* see enum guc_capture_type */ +#define CAP_HDR_ENGINE_CLASS GENMASK(7, 4)/* see GUC_MAX_ENGINE_CLASSES */ +#define CAP_HDR_ENGINE_INSTANCE GENMASK(11, 8) +u32 lrca;/* if type-instance, LRCA (address) that hung, else set to ~0 */ +u32 guc_id;/* if type-instance, context index of hung context, else set to ~0 */ +u32 num_mmios; +#define CAP_HDR_NUM_MMIOS GENMASK(9, 0) +} __packed; + +struct guc_state_capture_t { +struct guc_state_capture_header_t header; +struct guc_mmio_reg mmio_entries[0 ]; +} __packed; + +enum guc_capture_group_types { +GUC_STATE_CAPTURE_GROUP_TYPE_FULL , +GUC_STATE_CAPTURE_GROUP_TYPE_PARTIAL , +GUC_STATE_CAPTURE_GROUP_TYPE_MAX , +}; + +struct guc_state_capture_group_header_t { +u32 reserved1; +u32 info; +#define CAP_GRP_HDR_NUM_CAPTURES GENMASK(7, 0) +#define CAP_GRP_HDR_CAPTURE_TYPE GENMASK(15, 8)/* guc_capture_group_types */ +} __packed; + +struct guc_state_capture_group_t { +struct guc_state_capture_group_header_t grp_header; +struct guc_state_capture_t capture_entries[0 ]; +} __packed; +struct __guc_state_capture_priv {struct __guc_mmio_reg_descr_group *reglists;u16 num_instance_regs[GUC_CAPTURE_LIST_INDEX_MAX ][GUC_MAX_ENGINE_CLASSES ];
Signature · 1 line
2.25.1
PATCH 5/7 drm/i915/guc: Update GuC's log-buffer-state access for error capture.
In reply to Alan PrevinGuC log buffer regions for debug-log-events, crash-dumps and error-state-capture are all a single bo allocation that includes the guc_log_buffer_state structures.
Since the error-capture region is accessed with high priority at non- deterministic times (as part of gpu coredump) while the debug-log-event region is populated and accessed with different priorities, timings and consumers, let's split out separate locks for buffer-state accesses of each region.
Also, ensure a global mapping is made up front for the entire bo throughout GuC operation so that dynamic mapping and unmapping isn't required for error capture log access if relay-logging isn't running.
Additionally, while here, make some readibility improvements:
1. change previous function names with "capture_logs" to "copy_debug_logs" to help make the distinction clearer.
2. Update the guc log region mapping comments to order them according to the enum definition as per the GuC interface.
--- drivers/gpu/drm/i915/gt/uc/intel_guc.h | 2 + .../gpu/drm/i915/gt/uc/intel_guc_capture.c | 47 ++++++ .../gpu/drm/i915/gt/uc/intel_guc_capture.h | 1 + drivers/gpu/drm/i915/gt/uc/intel_guc_log.c | 135 +++++++++++------- drivers/gpu/drm/i915/gt/uc/intel_guc_log.h | 16 ++- 5 files changed, 141 insertions(+), 60 deletions(-)
drivers/gpu/drm/i915/gt/uc/intel_guc.h +2 -0
@@ -34,6 +34,8 @@ struct intel_guc {struct intel_uc_fw fw;/** @log: sub-structure containing GuC log related data and objects */ struct intel_guc_log log; +/** @log_state: states and locks for each subregion of GuC's log buffer */ +struct intel_guc_log_stats log_state[GUC_MAX_LOG_BUFFER ];/** @ct: the command transport communication channel */ struct intel_guc_ct ct;/** @slpc: sub-structure containing SLPC related data and objects */
drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c +47 -0
53 lines not on this page · raw message
drivers/gpu/drm/i915/gt/uc/intel_guc_capture.h +1 -0
@@ -14,6 +14,7 @@ struct guc_gt_system_info;int intel_guc_capture_prep_lists (struct intel_guc *guc,struct guc_ads *blob,u32 blob_ggtt,u32 capture_offset,struct guc_gt_system_info *sysinfo); +int intel_guc_capture_output_min_size_est (struct intel_guc *guc);void intel_guc_capture_destroy (struct intel_guc *guc);int intel_guc_capture_init (struct intel_guc *guc);
drivers/gpu/drm/i915/gt/uc/intel_guc_log.c +82 -53
336 lines not on this page · raw message
drivers/gpu/drm/i915/gt/uc/intel_guc_log.h +9 -7
@@ -46,23 +46,25 @@ struct intel_guc;#define GUC_VERBOSITY_TO_LOG_LEVEL (x) ((x) + 2)#define GUC_LOG_LEVEL_MAX GUC_VERBOSITY_TO_LOG_LEVEL(GUC_LOG_VERBOSITY_MAX) +struct intel_guc_log_stats { +struct mutex lock;/* protects below and guc_log_buffer_state's read-ptr */ +u32 sampled_overflow; +u32 overflow; +u32 flush; +}; +struct intel_guc_log {u32 level;struct i915_vma *vma; +void *buf_addr;struct { -void *buf_addr; +bool buf_in_use;bool started;struct work_struct flush_work;struct rchan *channel;struct mutex lock;u32 full_count; } relay; -/* logging related stats */ -struct { -u32 sampled_overflow; -u32 overflow; -u32 flush; - } stats[GUC_MAX_LOG_BUFFER ]; };void intel_guc_log_init_early (struct intel_guc_log *log);
Signature · 1 line
2.25.1
PATCH 6/7 drm/i915/guc: Copy new GuC error capture logs upon G2H notification.
In reply to Alan PrevinUpon the G2H Notify-Err-Capture event, make a snapshot of the error state capture logs from the GuC-log buffer (error capture region) into an bigger interim circular buffer store that can be parsed later during gpu coredump printing.
Also, do the same for where we reset GuC submission and need to flush outstanding logs.
--- .../gpu/drm/i915/gt/uc/abi/guc_actions_abi.h | 7 + drivers/gpu/drm/i915/gt/uc/guc_capture_fwif.h | 12 ++ .../gpu/drm/i915/gt/uc/intel_guc_capture.c | 186 ++++++++++++++++++ .../gpu/drm/i915/gt/uc/intel_guc_capture.h | 1 + drivers/gpu/drm/i915/gt/uc/intel_guc_log.c | 26 ++- drivers/gpu/drm/i915/gt/uc/intel_guc_log.h | 4 + .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 14 +- 7 files changed, 240 insertions(+), 10 deletions(-)
drivers/gpu/drm/i915/gt/uc/abi/guc_actions_abi.h +7 -0
@@ -173,4 +173,11 @@ enum intel_guc_sleep_state_status {#define GUC_LOG_CONTROL_VERBOSITY_MASK (0xF << GUC_LOG_CONTROL_VERBOSITY_SHIFT)#define GUC_LOG_CONTROL_DEFAULT_LOGGING (1 << 8) +enum intel_guc_state_capture_event_status { +INTEL_GUC_STATE_CAPTURE_EVENT_STATUS_SUCCESS =0x0 , +INTEL_GUC_STATE_CAPTURE_EVENT_STATUS_NOSPACE =0x1 , +}; + +#define INTEL_GUC_STATE_CAPTURE_EVENT_STATUS_MASK 0x1 +#endif /* _ABI_GUC_ACTIONS_ABI_H */
drivers/gpu/drm/i915/gt/uc/guc_capture_fwif.h +12 -0
@@ -63,11 +63,23 @@ struct guc_state_capture_group_t { struct guc_state_capture_t capture_entries[0]; } __packed; +struct guc_capture_out_store { +/* An interim storage to copy the GuC error-capture-output before +* parsing and reporting via proper reporting flows with formatting. +*/ +unsigned char *addr; +size_t size; +unsigned long head;/* inject new output capture data */ +unsigned long tail;/* remove output capture data when reporting */ +struct mutex lock;/*lock head or tail when copying capture in or extracting out*/ +}; +struct __guc_state_capture_priv {struct __guc_mmio_reg_descr_group *reglists;u16 num_instance_regs[GUC_CAPTURE_LIST_INDEX_MAX ][GUC_MAX_ENGINE_CLASSES ];u16 num_class_regs[GUC_CAPTURE_LIST_INDEX_MAX ][GUC_MAX_ENGINE_CLASSES ];u16 num_global_regs[GUC_CAPTURE_LIST_INDEX_MAX ]; +struct guc_capture_out_store out_store; };#endif /* _INTEL_GUC_CAPTURE_FWIF_H */
drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c +186 -0
222 lines not on this page · raw message
drivers/gpu/drm/i915/gt/uc/intel_guc_capture.h +1 -0
@@ -14,6 +14,7 @@ struct guc_gt_system_info;int intel_guc_capture_prep_lists (struct intel_guc *guc,struct guc_ads *blob,u32 blob_ggtt,u32 capture_offset,struct guc_gt_system_info *sysinfo); +void intel_guc_capture_store_snapshot (struct intel_guc *guc);int intel_guc_capture_output_min_size_est (struct intel_guc *guc);void intel_guc_capture_destroy (struct intel_guc *guc);int intel_guc_capture_init (struct intel_guc *guc);
drivers/gpu/drm/i915/gt/uc/intel_guc_log.c +20 -6
@@ -157,9 +157,9 @@ static void *guc_get_write_buffer(struct intel_guc_log *log)return relay_reserve (log->relay.channel,0 ); } -static bool guc_check_log_buf_overflow (struct intel_guc *guc, -struct intel_guc_log_stats *log_state, -unsigned int full_cnt) +bool intel_guc_check_log_buf_overflow (struct intel_guc *guc, +struct intel_guc_log_stats *log_state, +unsigned int full_cnt) {unsigned int prev_full_cnt = log_state->sampled_overflow;bool overflow = false;
@@ -182,7 +182,7 @@ static bool guc_check_log_buf_overflow(struct intel_guc *guc,return overflow; } -static unsigned int guc_get_log_buffer_size (enum guc_log_buffer_type type) +unsigned int intel_guc_get_log_buffer_size (enum guc_log_buffer_type type) {switch (type) {case GUC_DEBUG_LOG_BUFFER :
@@ -198,6 +198,20 @@ static unsigned int guc_get_log_buffer_size(enum guc_log_buffer_type type)return 0 ; } +size_t intel_guc_get_log_buffer_offset (enum guc_log_buffer_type type) +{ +enum guc_log_buffer_type i; +size_t offset =PAGE_SIZE ;/* for the log_buffer_states */ + +for (i =GUC_DEBUG_LOG_BUFFER ; i <GUC_MAX_LOG_BUFFER ; i++) { +if (i == type) +break ; + offset +=intel_guc_get_log_buffer_size (i); + } + +return offset; +} +static void _guc_log_copy_debuglogs_for_relay (struct intel_guc_log *log) {struct intel_guc *guc =log_to_guc (log);
@@ -247,14 +261,14 @@ static void _guc_log_copy_debuglogs_for_relay(struct intel_guc_log *log)mutex_lock (&logstate->lock);memcpy (&log_buf_state_local, log_buf_state,sizeof (struct guc_log_buffer_state )); - buffer_size =guc_get_log_buffer_size (type); + buffer_size =intel_guc_get_log_buffer_size (type); read_offset = log_buf_state_local.read_ptr; write_offset = log_buf_state_local.sampled_write_ptr; full_cnt = log_buf_state_local.buffer_full_cnt;/* Bookkeeping stuff */ logstate->flush += log_buf_state_local.flush_to_file; - new_overflow =guc_check_log_buf_overflow (guc, logstate, full_cnt); + new_overflow =intel_guc_check_log_buf_overflow (guc, logstate, full_cnt);/* Update the state of shared log buffer */ log_buf_state->read_ptr = write_offset;
drivers/gpu/drm/i915/gt/uc/intel_guc_log.h +4 -0
@@ -68,6 +68,10 @@ struct intel_guc_log { };void intel_guc_log_init_early (struct intel_guc_log *log); +bool intel_guc_check_log_buf_overflow (struct intel_guc *guc,struct intel_guc_log_stats *state, +unsigned int full_cnt); +unsigned int intel_guc_get_log_buffer_size (enum guc_log_buffer_type type); +size_t intel_guc_get_log_buffer_offset (enum guc_log_buffer_type type);int intel_guc_log_create (struct intel_guc_log *log);void intel_guc_log_destroy (struct intel_guc_log *log);
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +10 -4
@@ -24,6 +24,7 @@#include "gt/intel_ring.h" #include "intel_guc_ads.h" +#include "intel_guc_capture.h" #include "intel_guc_submission.h" #include "i915_drv.h"
@@ -1431,6 +1432,8 @@ void intel_guc_submission_reset_prepare(struct intel_guc *guc) }scrub_guc_desc_for_outstanding_g2h (guc); + +intel_guc_capture_store_snapshot (guc); } static struct intel_engine_cs *
@@ -4025,17 +4028,20 @@ int intel_guc_context_reset_process_msg(struct intel_guc *guc,int intel_guc_error_capture_process_msg (struct intel_guc *guc,const u32 *msg,u32 len) { -int status; +u32 status;if (unlikely (len !=1 )) {drm_dbg (&guc_to_gt (guc)->i915->drm,"Invalid length %u" , len);return -EPROTO ; } - status = msg[0 ]; -drm_info (&guc_to_gt (guc)->i915->drm,"Got error capture: status = %d" , status); + status = msg[0 ] &INTEL_GUC_STATE_CAPTURE_EVENT_STATUS_MASK ; +if (status ==INTEL_GUC_STATE_CAPTURE_EVENT_STATUS_NOSPACE ) +drm_warn (&guc_to_gt (guc)->i915->drm,"G2H-Error capture no space" ); +else +drm_info (&guc_to_gt (guc)->i915->drm,"G2H-Received error capture" ); -/* FIXME: Do something with the capture */ +intel_guc_capture_store_snapshot (guc);return 0 ; }
Signature · 1 line
2.25.1
Re: [Intel-gfx] [PATCH 6/7] drm/i915/guc: Copy new GuC error capture logs upon G2H notification.
A fresh round of offline design discussions with internal team has decided that:
- we dont want to use an interim circular buffer to copy all of the GuC generated register dumps of one or more 'engine-capture-groups'.
- instead, we shall dynamically allocate multiple nodes, each node being a single "engine-capture-dump". A link list of one or many engine-capture- dumps would result from a single engine-capture-group.
- this dynamic allocation should happen during the G2H error-capture notification event which happens before the corresponding G2H context- reset that triggers the i915_gpu_coredump (where we want to avoid memory allocation moving forward).
- we also realize that during the link-list allocation we would need a first-parse of the guc-log-error-state-capture head-to-tail entries in order to duplicate global and engine-class register dumps for each each engine instance register dump if we find dependent-engine resets in a engine-capture-group.
- later when i915_gpu_coredump calls into capture_engine, we finally attach the corresponding node from the link list above (detaching it from that link list) into i915_gpu_coredump's intel_engine_coredump structure when have matching LRCA/guc-id/engine-instace.
- we would also have to add a flag through i915_gpu_coredump top level trigger through to capture_engine to indicate if the capture was triggered via a guc context reset or a forced user reset or gt-reset. In the latter case (user/gt reset), we should capture the register values directly from the HW, i.e. the pre-guc behavior without matching against GuC.
...alan
Quoted 4 lines · Alan Previn
drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c+static void __guc_capture_store_snapshot_work(struct intel_guc *guc) renamed from drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c +0
-0
..
..
Quoted 107 lines
drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c+static void __guc_capture_store_snapshot_work(struct intel_guc *guc) renamed from drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c +107
-0+{ + struct drm_i915_private *i915 = guc_to_gt(guc)->i915; + unsigned int buffer_size, read_offset, write_offset, bytes_to_copy, full_count; + struct guc_log_buffer_state *log_buf_state; + struct guc_log_buffer_state log_buf_state_local; + void *src_data, *dst_data = NULL; + bool new_overflow; + + /* Lock to get the pointer to GuC capture-log-buffer-state */ + mutex_lock(&guc->log_state[GUC_CAPTURE_LOG_BUFFER].lock); + log_buf_state = guc->log.buf_addr + + (sizeof(struct guc_log_buffer_state) * GUC_CAPTURE_LOG_BUFFER); + src_data = guc->log.buf_addr + intel_guc_get_log_buffer_offset(GUC_CAPTURE_LOG_BUFFER); + + /* + * Make a copy of the state structure, inside GuC log buffer + * (which is uncached mapped), on the stack to avoid reading + * from it multiple times. + */ + memcpy(&log_buf_state_local, log_buf_state, sizeof(struct guc_log_buffer_state)); + buffer_size = intel_guc_get_log_buffer_size(GUC_CAPTURE_LOG_BUFFER); + read_offset = log_buf_state_local.read_ptr; + write_offset = log_buf_state_local.sampled_write_ptr; + full_count = log_buf_state_local.buffer_full_cnt; + + /* Bookkeeping stuff */ + guc->log_state[GUC_CAPTURE_LOG_BUFFER].flush += log_buf_state_local.flush_to_file; + new_overflow = intel_guc_check_log_buf_overflow(guc, + &guc->log_state[GUC_CAPTURE_LOG_BUFFER], + full_count); + + /* Update the state of shared log buffer */ + log_buf_state->read_ptr = write_offset; + log_buf_state->flush_to_file = 0; + + mutex_unlock(&guc->log_state[GUC_CAPTURE_LOG_BUFFER].lock); + + dst_data = guc->capture.priv->out_store.addr; + if (dst_data) { + mutex_lock(&guc->capture.priv->out_store.lock); + + /* Now copy the actual logs. */ + if (unlikely(new_overflow)) { + /* copy the whole buffer in case of overflow */ + read_offset = 0; + write_offset = buffer_size; + } else if (unlikely((read_offset > buffer_size) || + (write_offset > buffer_size))) { + drm_err(&i915->drm, "invalid GuC log capture buffer state!\n"); + /* copy whole buffer as offsets are unreliable */ + read_offset = 0; + write_offset = buffer_size; + } + + /* first copy from the tail end of the GuC log capture buffer */ + if (read_offset > write_offset) { + guc_capture_store_insert(guc, &guc->capture.priv->out_store, src_data, + write_offset); + bytes_to_copy = buffer_size - read_offset; + } else { + bytes_to_copy = write_offset - read_offset; + } + guc_capture_store_insert(guc, &guc->capture.priv->out_store, src_data + read_offset, + bytes_to_copy); + + mutex_unlock(&guc->capture.priv->out_store.lock); + } +} + +void intel_guc_capture_store_snapshot(struct intel_guc *guc) +{ + if (guc->capture.priv) + __guc_capture_store_snapshot_work(guc); +} + +static void guc_capture_store_destroy(struct intel_guc *guc) +{ + mutex_destroy(&guc->capture.priv->out_store.lock); + guc->capture.priv->out_store.size = 0; + kfree(guc->capture.priv->out_store.addr); + guc->capture.priv->out_store.addr = NULL; +} + +static int guc_capture_store_create(struct intel_guc *guc) +{ + /* + * Make this interim buffer larger than GuC capture output buffer so that we can absorb + * a little delay when processing the raw capture dumps into text friendly logs + * for the i915_gpu_coredump output + */ + size_t max_dump_size; + + GEM_BUG_ON(guc->capture.priv->out_store.addr); + + max_dump_size = PAGE_ALIGN(intel_guc_capture_output_min_size_est(guc)); + max_dump_size = roundup_pow_of_two(max_dump_size); + + guc->capture.priv->out_store.addr = kzalloc(max_dump_size, GFP_KERNEL); + if (!guc->capture.priv->out_store.addr) + return -ENOMEM; + + guc->capture.priv->out_store.size = max_dump_size; + mutex_init(&guc->capture.priv->out_store.lock); + + return 0; +} +
PATCH 7/7 drm/i915/guc: Print the GuC error capture output register list.
In reply to Alan PrevinPrint the GuC captured error state register list (string names and values) when gpu_coredump_state printout is invoked via the i915 debugfs for flushing the gpu error-state that was captured prior.
Since GuC could have reported multiple engine register dumps in a single notification event, parse the captured data (appearing as a stream of structures) to identify each dump as a different 'engine-capture-group-output'.
Finally, for each 'engine-capture-group-output' that is found, verify if the engine register dump corresponds to the engine_coredump content that was previously populated by the i915_gpu_coredump function. That function would have copied the context's vma's including the bacth buffer during the G2H-context-reset notification that occurred earlier. Perform this verification check by comparing guc_id, lrca and engine- instance obtained from the 'engine-capture-group-output' vs a copy of that same info taken during i915_gpu_coredump. If they match, then print those vma's as well (such as the batch buffers).
--- drivers/gpu/drm/i915/gt/intel_engine_cs.c | 4 +- .../gpu/drm/i915/gt/uc/intel_guc_capture.c | 439 ++++++++++++++++++ .../gpu/drm/i915/gt/uc/intel_guc_capture.h | 10 +- drivers/gpu/drm/i915/i915_gpu_error.c | 65 ++- drivers/gpu/drm/i915/i915_gpu_error.h | 14 + 5 files changed, 509 insertions(+), 23 deletions(-)
drivers/gpu/drm/i915/gt/intel_engine_cs.c +1 -3
@@ -1628,9 +1628,7 @@ static void intel_engine_print_registers(struct intel_engine_cs *engine,drm_printf (m,"\tIPEHR: 0x%08x\n" ,ENGINE_READ (engine,IPEHR )); } -if (intel_engine_uses_guc (engine)) { -/* nothing to print yet */ - }else if (HAS_EXECLISTS (dev_priv)) { +if (HAS_EXECLISTS (dev_priv) && !intel_engine_uses_guc (engine)) {struct i915_request *const *port, *rq;const u32 *hws = &engine->status_page.addr[I915_HWS_CSB_BUF0_INDEX ];
drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c +439 -0
453 lines not on this page · raw message
drivers/gpu/drm/i915/gt/uc/intel_guc_capture.h +9 -1
@@ -8,15 +8,23 @@#include <linux/types.h> -struct intel_guc ; +struct drm_i915_error_state_buf ;struct guc_ads ;struct guc_gt_system_info ; +struct intel_gt_coredump ; +struct intel_guc ; +struct intel_engine_coredump ; +struct intel_context ;int intel_guc_capture_prep_lists (struct intel_guc *guc,struct guc_ads *blob,u32 blob_ggtt,u32 capture_offset,struct guc_gt_system_info *sysinfo); +int intel_guc_capture_out_print_next_group (struct drm_i915_error_state_buf *m, +struct intel_gt_coredump *gt); +void intel_guc_capture_copy_info (struct intel_engine_coredump *ee,struct intel_context *ce);void intel_guc_capture_store_snapshot (struct intel_guc *guc);int intel_guc_capture_output_min_size_est (struct intel_guc *guc);void intel_guc_capture_destroy (struct intel_guc *guc); +struct intel_guc_state_capture *intel_guc_capture_store_ptr (struct intel_guc *guc);int intel_guc_capture_init (struct intel_guc *guc);#endif /* _INTEL_GUC_CAPTURE_H */
drivers/gpu/drm/i915/i915_gpu_error.c +46 -19
155 lines not on this page · raw message
drivers/gpu/drm/i915/i915_gpu_error.h +14 -0
@@ -17,6 +17,7 @@#include "gt/intel_engine.h" #include "gt/intel_gt_types.h" #include "gt/uc/intel_uc_fw.h" +#include "gt/uc/intel_guc_capture.h" #include "intel_device_info.h"
@@ -84,6 +85,13 @@ struct intel_engine_coredump {u32 rc_psmi;/* sleep state */ struct intel_instdone instdone; +/* GuC correlated info */ +struct { +u32 lrca; +u16 guc_id; +u32 eng_id; + } gucinfo; +struct i915_gem_context_coredump {char comm[TASK_COMM_LEN ];
@@ -149,6 +157,7 @@ struct intel_gt_coredump {struct intel_uc_fw guc_fw;struct intel_uc_fw huc_fw;struct i915_vma_coredump *guc_log; +struct intel_guc_state_capture *capture; } *uc;struct intel_gt_coredump *next;
@@ -214,6 +223,11 @@ struct drm_i915_error_state_buf { __printf(2, 3)void i915_error_printf (struct drm_i915_error_state_buf *e,const char *f, ...); +void intel_gpu_error_print_vma (struct drm_i915_error_state_buf *m, +const struct intel_engine_cs *engine, +const struct i915_vma_coredump *vma); +struct i915_vma_coredump * +intel_gpu_error_find_batch (const struct intel_engine_coredump *ee);struct i915_gpu_coredump *i915_gpu_coredump (struct intel_gt *gt,intel_engine_mask_t engine_mask);
Signature · 1 line
2.25.1
Patchwork
CI[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Add GuC Error Capture Support (rev4)
In reply to Alan Previn== Series Details ==
== Series Details ==
Series: Add GuC Error Capture Support (rev4)
URL : https://patchwork.freedesktop.org/series/97187/
State : warning
== Summary ==
$ dim checkpatch origin/drm-tip c5b79a260782 drm/i915/guc: Update GuC ADS size for error capture lists -:32: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating? #32: new file mode 100644
-:307: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'regslist' - possible side-effects? #307: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c:60:
+#define MAKE_REGLIST(regslist, regsowner, regstype, class) \
+ { \
+ .list = regslist, \
+ .num_regs = ARRAY_SIZE(regslist), \
+ .owner = TO_GCAP_DEF_OWNER(regsowner), \
+ .type = TO_GCAP_DEF_TYPE(regstype), \
+ .engine = class, \
+ }
-:356: WARNING:SUSPECT_CODE_INDENT: suspect code indent for conditional statements (16, 16) #356: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c:109:
+ if (reglists[i].owner == owner && reglists[i].type == type &&
[...]
+ return ®lists[i];
-:423: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #423: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c:176:
+ drm_dbg(&i915->drm, "GuC-capture: %s for %s %s-Registers.\n", msg,
+ guc_capture_stringify_owner(owner), guc_capture_stringify_type(type));
-:426: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #426: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c:179:
+ drm_dbg(&i915->drm, "GuC-capture: %s for %s %s-Registers on %s-Engine\n", msg,
+ guc_capture_stringify_owner(owner), guc_capture_stringify_type(type),
total: 0 errors, 2 warnings, 3 checks, 681 lines checked68bc5c4ac7f8 drm/i915/guc: Add XE_LP registers for GuC error state capture. -:37: ERROR:COMPLEX_MACRO: Macros with complex values should be enclosed in parentheses #37: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c:22:
+#define COMMON_GEN12BASE_GLOBAL() \
+ {GEN12_FAULT_TLB_DATA0, 0, 0, "GEN12_FAULT_TLB_DATA0"}, \
+ {GEN12_FAULT_TLB_DATA1, 0, 0, "GEN12_FAULT_TLB_DATA1"}, \
+ {FORCEWAKE_MT, 0, 0, "FORCEWAKE_MT"}, \
+ {DERRMR, 0, 0, "DERRMR"}, \
+ {GEN12_AUX_ERR_DBG, 0, 0, "GEN12_AUX_ERR_DBG"}, \
+ {GEN12_GAM_DONE, 0, 0, "GEN12_GAM_DONE"}, \
+ {GEN11_GUC_SG_INTR_ENABLE, 0, 0, "GEN11_GUC_SG_INTR_ENABLE"}, \
+ {GEN11_CRYPTO_RSVD_INTR_ENABLE, 0, 0, "GEN11_CRYPTO_RSVD_INTR_ENABLE"}, \
+ {GEN11_GUNIT_CSME_INTR_ENABLE, 0, 0, "GEN11_GUNIT_CSME_INTR_ENABLE"}, \
+ {GEN11_GPM_WGBOXPERF_INTR_ENABLE, 0, 0, "GEN11_GPM_WGBOXPERF_INTR_ENABLE"}, \
+ {GEN8_DE_MISC_IER, 0, 0, "GEN8_DE_MISC_IER"}, \
+ {GEN12_RING_FAULT_REG, 0, 0, "GEN12_RING_FAULT_REG"}-:51: ERROR:COMPLEX_MACRO: Macros with complex values should be enclosed in parentheses #51: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c:36:
+#define COMMON_GEN12BASE_ENGINE_INSTANCE() \
+ {RING_PSMI_CTL(0), 0, 0, "RING_PSMI_CTL"}, \
+ {RING_ESR(0), 0, 0, "RING_ESR"}, \
+ {RING_DMA_FADD(0), 0, 0, "RING_DMA_FADD_LOW32"}, \
+ {RING_DMA_FADD_UDW(0), 0, 0, "RING_DMA_FADD_UP32"}, \
+ {RING_IPEIR(0), 0, 0, "RING_IPEIR"}, \
+ {RING_IPEHR(0), 0, 0, "RING_IPEHR"}, \
+ {RING_INSTPS(0), 0, 0, "RING_INSTPS"}, \
+ {RING_BBADDR(0), 0, 0, "RING_BBADDR_LOW32"}, \
+ {RING_BBADDR_UDW(0), 0, 0, "RING_BBADDR_UP32"}, \
+ {RING_BBSTATE(0), 0, 0, "RING_BBSTATE"}, \
+ {CCID(0), 0, 0, "CCID"}, \
+ {RING_ACTHD(0), 0, 0, "RING_ACTHD_LOW32"}, \
+ {RING_ACTHD_UDW(0), 0, 0, "RING_ACTHD_UP32"}, \
+ {RING_INSTPM(0), 0, 0, "RING_INSTPM"}, \
+ {RING_NOPID(0), 0, 0, "RING_NOPID"}, \
+ {RING_START(0), 0, 0, "RING_START"}, \
+ {RING_HEAD(0), 0, 0, "RING_HEAD"}, \
+ {RING_TAIL(0), 0, 0, "RING_TAIL"}, \
+ {RING_CTL(0), 0, 0, "RING_CTL"}, \
+ {RING_MI_MODE(0), 0, 0, "RING_MI_MODE"}, \
+ {RING_CONTEXT_CONTROL(0), 0, 0, "RING_CONTEXT_CONTROL"}, \
+ {RING_INSTDONE(0), 0, 0, "RING_INSTDONE"}, \
+ {RING_HWS_PGA(0), 0, 0, "RING_HWS_PGA"}, \
+ {RING_MODE_GEN7(0), 0, 0, "RING_MODE_GEN7"}, \
+ {GEN8_RING_PDP_LDW(0, 0), 0, 0, "GEN8_RING_PDP0_LDW"}, \
+ {GEN8_RING_PDP_UDW(0, 0), 0, 0, "GEN8_RING_PDP0_UDW"}, \
+ {GEN8_RING_PDP_LDW(0, 1), 0, 0, "GEN8_RING_PDP1_LDW"}, \
+ {GEN8_RING_PDP_UDW(0, 1), 0, 0, "GEN8_RING_PDP1_UDW"}, \
+ {GEN8_RING_PDP_LDW(0, 2), 0, 0, "GEN8_RING_PDP2_LDW"}, \
+ {GEN8_RING_PDP_UDW(0, 2), 0, 0, "GEN8_RING_PDP2_UDW"}, \
+ {GEN8_RING_PDP_LDW(0, 3), 0, 0, "GEN8_RING_PDP3_LDW"}, \
+ {GEN8_RING_PDP_UDW(0, 3), 0, 0, "GEN8_RING_PDP3_UDW"}-:88: ERROR:COMPLEX_MACRO: Macros with complex values should be enclosed in parentheses #88: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c:73:
+#define COMMON_GEN12BASE_RENDER() \
+ {GEN7_SC_INSTDONE, 0, 0, "GEN7_SC_INSTDONE"}, \
+ {GEN12_SC_INSTDONE_EXTRA, 0, 0, "GEN12_SC_INSTDONE_EXTRA"}, \
+ {GEN12_SC_INSTDONE_EXTRA2, 0, 0, "GEN12_SC_INSTDONE_EXTRA2"}-:93: ERROR:COMPLEX_MACRO: Macros with complex values should be enclosed in parentheses #93: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c:78:
+#define COMMON_GEN12BASE_VEC() \
+ {GEN11_VCS_VECS_INTR_ENABLE, 0, 0, "GEN11_VCS_VECS_INTR_ENABLE"}, \
+ {GEN12_SFC_DONE(0), 0, 0, "GEN12_SFC_DONE0"}, \
+ {GEN12_SFC_DONE(1), 0, 0, "GEN12_SFC_DONE1"}, \
+ {GEN12_SFC_DONE(2), 0, 0, "GEN12_SFC_DONE2"}, \
+ {GEN12_SFC_DONE(3), 0, 0, "GEN12_SFC_DONE3"}-:180: WARNING:SUSPECT_CODE_INDENT: suspect code indent for conditional statements (16, 16) #180: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c:166:
+ if (reglists[i].owner == owner && reglists[i].type == type &&
[...]
+ return ®lists[i];
total: 4 errors, 1 warnings, 0 checks, 310 lines checked 7febfa438109 drm/i915/guc: Add DG2 registers for GuC error state capture. -:79: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'ext' - possible side-effects? #79: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c:242:
+#define POPULATE_NEXT_EXTREG(ext, list, idx, slicenum, subslicenum) \
+ { \
+ ext->reg = list[idx].reg; \
+ ext->flags = FIELD_PREP(GUC_REGSET_STEERING_GROUP, slicenum); \
+ ext->flags |= FIELD_PREP(GUC_REGSET_STEERING_INSTANCE, subslicenum); \
+ ext->regname = xelpd_extregs[i].name; \
+ ++ext; \
+ }
-:79: CHECK:MACRO_ARG_PRECEDENCE: Macro argument 'ext' may be better as '(ext)' to avoid precedence issues #79: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c:242:
+#define POPULATE_NEXT_EXTREG(ext, list, idx, slicenum, subslicenum) \
+ { \
+ ext->reg = list[idx].reg; \
+ ext->flags = FIELD_PREP(GUC_REGSET_STEERING_GROUP, slicenum); \
+ ext->flags |= FIELD_PREP(GUC_REGSET_STEERING_INSTANCE, subslicenum); \
+ ext->regname = xelpd_extregs[i].name; \
+ ++ext; \
+ }
total: 0 errors, 0 warnings, 2 checks, 100 lines checked13acbdb9a7ca drm/i915/guc: Add GuC's error state capture output structures. b484fd64c7ba drm/i915/guc: Update GuC's log-buffer-state access for error capture. -:191: CHECK:MULTIPLE_ASSIGNMENTS: multiple assignments should be avoided #191: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_log.c:218:
+ log_buf_state = src_data = log->buf_addr;
total: 0 errors, 0 warnings, 1 checks, 436 lines checked dcf143ea1f41 drm/i915/guc: Copy new GuC error capture logs upon G2H notification. e6a40bf716e6 drm/i915/guc: Print the GuC error capture output register list. -:226: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'b' - possible side-effects? #226: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c:869:
+#define guc_capt_err_print(a, b, ...) \
+ do { \
+ drm_warn(a, __VA_ARGS__); \
+ if (b) \
+ i915_error_printf(b, __VA_ARGS__); \
+ } while (0)
-:233: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'b' - possible side-effects? #233: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c:876:
+#define guc_capt_err_print(a, b, ...) \
+ do { \
+ if (b) \
+ i915_error_printf(b, __VA_ARGS__); \
+ } while (0)
-:255: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'i915' - possible side-effects? #255: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c:898:
+#define GCAP_PRINT_INTEL_ENG_INFO(i915, ebuf, eng) \
+ do { \
+ PRINT(&i915->drm, (ebuf), " i915-Eng-Name: %s command stream\n", (eng)->name); \ + PRINT(&i915->drm, (ebuf), " i915-Eng-Inst-Class: 0x%02x\n", (eng)->class); \ + PRINT(&i915->drm, (ebuf), " i915-Eng-Inst-Id: 0x%02x\n", (eng)->instance); \ + PRINT(&i915->drm, (ebuf), " i915-Eng-LogicalMask: 0x%08x\n", \
+ (eng)->logical_mask); \
+ } while (0)
-:255: CHECK:MACRO_ARG_PRECEDENCE: Macro argument 'i915' may be better as '(i915)' to avoid precedence issues #255: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c:898:
+#define GCAP_PRINT_INTEL_ENG_INFO(i915, ebuf, eng) \
+ do { \
+ PRINT(&i915->drm, (ebuf), " i915-Eng-Name: %s command stream\n", (eng)->name); \ + PRINT(&i915->drm, (ebuf), " i915-Eng-Inst-Class: 0x%02x\n", (eng)->class); \ + PRINT(&i915->drm, (ebuf), " i915-Eng-Inst-Id: 0x%02x\n", (eng)->instance); \ + PRINT(&i915->drm, (ebuf), " i915-Eng-LogicalMask: 0x%08x\n", \
+ (eng)->logical_mask); \
+ } while (0)
-:255: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'ebuf' - possible side-effects? #255: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c:898:
+#define GCAP_PRINT_INTEL_ENG_INFO(i915, ebuf, eng) \
+ do { \
+ PRINT(&i915->drm, (ebuf), " i915-Eng-Name: %s command stream\n", (eng)->name); \ + PRINT(&i915->drm, (ebuf), " i915-Eng-Inst-Class: 0x%02x\n", (eng)->class); \ + PRINT(&i915->drm, (ebuf), " i915-Eng-Inst-Id: 0x%02x\n", (eng)->instance); \ + PRINT(&i915->drm, (ebuf), " i915-Eng-LogicalMask: 0x%08x\n", \
+ (eng)->logical_mask); \
+ } while (0)
-:255: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'eng' - possible side-effects? #255: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c:898:
+#define GCAP_PRINT_INTEL_ENG_INFO(i915, ebuf, eng) \
+ do { \
+ PRINT(&i915->drm, (ebuf), " i915-Eng-Name: %s command stream\n", (eng)->name); \ + PRINT(&i915->drm, (ebuf), " i915-Eng-Inst-Class: 0x%02x\n", (eng)->class); \ + PRINT(&i915->drm, (ebuf), " i915-Eng-Inst-Id: 0x%02x\n", (eng)->instance); \ + PRINT(&i915->drm, (ebuf), " i915-Eng-LogicalMask: 0x%08x\n", \
+ (eng)->logical_mask); \
+ } while (0)
-:264: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'i915' - possible side-effects? #264: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c:907:
+#define GCAP_PRINT_GUC_INST_INFO(i915, ebuf, hdr) \
+ do { \
+ PRINT(&i915->drm, (ebuf), " GuC-Engine-Inst-Id: 0x%08x\n", \
+ (uint32_t)FIELD_GET(CAP_HDR_ENGINE_INSTANCE, (hdr).info)); \
+ PRINT(&i915->drm, (ebuf), " GuC-Context-Id: 0x%08x\n", (hdr).guc_id); \
+ PRINT(&i915->drm, (ebuf), " LRCA: 0x%08x\n", (hdr).lrca); \
+ } while (0)
-:264: CHECK:MACRO_ARG_PRECEDENCE: Macro argument 'i915' may be better as '(i915)' to avoid precedence issues #264: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c:907:
+#define GCAP_PRINT_GUC_INST_INFO(i915, ebuf, hdr) \
+ do { \
+ PRINT(&i915->drm, (ebuf), " GuC-Engine-Inst-Id: 0x%08x\n", \
+ (uint32_t)FIELD_GET(CAP_HDR_ENGINE_INSTANCE, (hdr).info)); \
+ PRINT(&i915->drm, (ebuf), " GuC-Context-Id: 0x%08x\n", (hdr).guc_id); \
+ PRINT(&i915->drm, (ebuf), " LRCA: 0x%08x\n", (hdr).lrca); \
+ } while (0)
-:264: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'ebuf' - possible side-effects? #264: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c:907:
+#define GCAP_PRINT_GUC_INST_INFO(i915, ebuf, hdr) \
+ do { \
+ PRINT(&i915->drm, (ebuf), " GuC-Engine-Inst-Id: 0x%08x\n", \
+ (uint32_t)FIELD_GET(CAP_HDR_ENGINE_INSTANCE, (hdr).info)); \
+ PRINT(&i915->drm, (ebuf), " GuC-Context-Id: 0x%08x\n", (hdr).guc_id); \
+ PRINT(&i915->drm, (ebuf), " LRCA: 0x%08x\n", (hdr).lrca); \
+ } while (0)
-:264: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'hdr' - possible side-effects? #264: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c:907:
+#define GCAP_PRINT_GUC_INST_INFO(i915, ebuf, hdr) \
+ do { \
+ PRINT(&i915->drm, (ebuf), " GuC-Engine-Inst-Id: 0x%08x\n", \
+ (uint32_t)FIELD_GET(CAP_HDR_ENGINE_INSTANCE, (hdr).info)); \
+ PRINT(&i915->drm, (ebuf), " GuC-Context-Id: 0x%08x\n", (hdr).guc_id); \
+ PRINT(&i915->drm, (ebuf), " LRCA: 0x%08x\n", (hdr).lrca); \
+ } while (0)
-:272: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'i915' - possible side-effects? #272: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c:915:
+#define GCAP_PRINT_INTEL_CTX_INFO(i915, ebuf, ce) \
+ do { \
+ PRINT(&i915->drm, (ebuf), " i915-Ctx-Flags: 0x%016lx\n", (ce)->flags); \
+ PRINT(&i915->drm, (ebuf), " i915-Ctx-GuC-Id: 0x%016x\n", (ce)->guc_id.id); \
+ } while (0)
-:272: CHECK:MACRO_ARG_PRECEDENCE: Macro argument 'i915' may be better as '(i915)' to avoid precedence issues #272: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c:915:
+#define GCAP_PRINT_INTEL_CTX_INFO(i915, ebuf, ce) \
+ do { \
+ PRINT(&i915->drm, (ebuf), " i915-Ctx-Flags: 0x%016lx\n", (ce)->flags); \
+ PRINT(&i915->drm, (ebuf), " i915-Ctx-GuC-Id: 0x%016x\n", (ce)->guc_id.id); \
+ } while (0)
-:272: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'ebuf' - possible side-effects? #272: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c:915:
+#define GCAP_PRINT_INTEL_CTX_INFO(i915, ebuf, ce) \
+ do { \
+ PRINT(&i915->drm, (ebuf), " i915-Ctx-Flags: 0x%016lx\n", (ce)->flags); \
+ PRINT(&i915->drm, (ebuf), " i915-Ctx-GuC-Id: 0x%016x\n", (ce)->guc_id.id); \
+ } while (0)
-:272: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'ce' - possible side-effects? #272: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c:915:
+#define GCAP_PRINT_INTEL_CTX_INFO(i915, ebuf, ce) \
+ do { \
+ PRINT(&i915->drm, (ebuf), " i915-Ctx-Flags: 0x%016lx\n", (ce)->flags); \
+ PRINT(&i915->drm, (ebuf), " i915-Ctx-GuC-Id: 0x%016x\n", (ce)->guc_id.id); \
+ } while (0)
-:278: CHECK:MACRO_ARG_PRECEDENCE: Macro argument 'i915' may be better as '(i915)' to avoid precedence issues #278: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c:921:
+#define GCAP_PRINT_BATCH(i915, ebuf, ee, batch) \
+ do { \
+ batch = intel_gpu_error_find_batch(ee); \
+ if (batch) { \
+ u64 start = batch->gtt_offset; \
+ u64 end = start + batch->gtt_size; \
+ PRINT(&i915->drm, (ebuf), " batch: [0x%08x_%08x, 0x%08x_%08x]\n", \
+ upper_32_bits(start), lower_32_bits(start), \
+ upper_32_bits(end), lower_32_bits(end)); \
+ } \
+ } while (0)
-:278: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'batch' - possible side-effects? #278: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c:921:
+#define GCAP_PRINT_BATCH(i915, ebuf, ee, batch) \
+ do { \
+ batch = intel_gpu_error_find_batch(ee); \
+ if (batch) { \
+ u64 start = batch->gtt_offset; \
+ u64 end = start + batch->gtt_size; \
+ PRINT(&i915->drm, (ebuf), " batch: [0x%08x_%08x, 0x%08x_%08x]\n", \
+ upper_32_bits(start), lower_32_bits(start), \
+ upper_32_bits(end), lower_32_bits(end)); \
+ } \
+ } while (0)
-:290: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'i915' - possible side-effects? #290: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c:933:
+#define GCAP_PRINT_CONTEXT(i915, ebuf, ctx) \
+ do { \
+ const u32 period = to_gt(ebuf->i915)->clock_period_ns; \
+ PRINT(&i915->drm, (ebuf), " Active context: %s[%d] prio %d, guilty %d " \
+ "active %d, runtime total %lluns, avg %lluns\n", \ + ctx->comm, ctx->pid, ctx->sched_attr.priority, \ + ctx->guilty, ctx->active, \ + ctx->total_runtime * period, \ + mul_u32_u32(ctx->avg_runtime, period)); \
+ } while (0)
-:290: CHECK:MACRO_ARG_PRECEDENCE: Macro argument 'i915' may be better as '(i915)' to avoid precedence issues #290: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c:933:
+#define GCAP_PRINT_CONTEXT(i915, ebuf, ctx) \
+ do { \
+ const u32 period = to_gt(ebuf->i915)->clock_period_ns; \
+ PRINT(&i915->drm, (ebuf), " Active context: %s[%d] prio %d, guilty %d " \
+ "active %d, runtime total %lluns, avg %lluns\n", \ + ctx->comm, ctx->pid, ctx->sched_attr.priority, \ + ctx->guilty, ctx->active, \ + ctx->total_runtime * period, \ + mul_u32_u32(ctx->avg_runtime, period)); \
+ } while (0)
-:290: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'ebuf' - possible side-effects? #290: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c:933:
+#define GCAP_PRINT_CONTEXT(i915, ebuf, ctx) \
+ do { \
+ const u32 period = to_gt(ebuf->i915)->clock_period_ns; \
+ PRINT(&i915->drm, (ebuf), " Active context: %s[%d] prio %d, guilty %d " \
+ "active %d, runtime total %lluns, avg %lluns\n", \ + ctx->comm, ctx->pid, ctx->sched_attr.priority, \ + ctx->guilty, ctx->active, \ + ctx->total_runtime * period, \ + mul_u32_u32(ctx->avg_runtime, period)); \
+ } while (0)
-:290: CHECK:MACRO_ARG_PRECEDENCE: Macro argument 'ebuf' may be better as '(ebuf)' to avoid precedence issues #290: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c:933:
+#define GCAP_PRINT_CONTEXT(i915, ebuf, ctx) \
+ do { \
+ const u32 period = to_gt(ebuf->i915)->clock_period_ns; \
+ PRINT(&i915->drm, (ebuf), " Active context: %s[%d] prio %d, guilty %d " \
+ "active %d, runtime total %lluns, avg %lluns\n", \ + ctx->comm, ctx->pid, ctx->sched_attr.priority, \ + ctx->guilty, ctx->active, \ + ctx->total_runtime * period, \ + mul_u32_u32(ctx->avg_runtime, period)); \
+ } while (0)
-:290: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'ctx' - possible side-effects? #290: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c:933:
+#define GCAP_PRINT_CONTEXT(i915, ebuf, ctx) \
+ do { \
+ const u32 period = to_gt(ebuf->i915)->clock_period_ns; \
+ PRINT(&i915->drm, (ebuf), " Active context: %s[%d] prio %d, guilty %d " \
+ "active %d, runtime total %lluns, avg %lluns\n", \ + ctx->comm, ctx->pid, ctx->sched_attr.priority, \ + ctx->guilty, ctx->active, \ + ctx->total_runtime * period, \ + mul_u32_u32(ctx->avg_runtime, period)); \
+ } while (0)
-:290: CHECK:MACRO_ARG_PRECEDENCE: Macro argument 'ctx' may be better as '(ctx)' to avoid precedence issues #290: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c:933:
+#define GCAP_PRINT_CONTEXT(i915, ebuf, ctx) \
+ do { \
+ const u32 period = to_gt(ebuf->i915)->clock_period_ns; \
+ PRINT(&i915->drm, (ebuf), " Active context: %s[%d] prio %d, guilty %d " \
+ "active %d, runtime total %lluns, avg %lluns\n", \ + ctx->comm, ctx->pid, ctx->sched_attr.priority, \ + ctx->guilty, ctx->active, \ + ctx->total_runtime * period, \ + mul_u32_u32(ctx->avg_runtime, period)); \
+ } while (0)
-:385: CHECK:MULTIPLE_ASSIGNMENTS: multiple assignments should be avoided #385: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c:1028:
+ guc_gucid = guc_lrca = 0;
total: 0 errors, 0 warnings, 23 checks, 680 lines checked
Patchwork
CI[Intel-gfx] ✗ Fi.CI.SPARSE: warning for Add GuC Error Capture Support (rev4)
In reply to Alan Previn== Series Details ==
== Series Details ==
Series: Add GuC Error Capture Support (rev4)
URL : https://patchwork.freedesktop.org/series/97187/
State : warning
== Summary ==
$ dim sparse --fast origin/drm-tip Sparse version: v0.6.2 Fast mode used, each commit won't be checked separately.
Patchwork
CI[Intel-gfx] ✗ Fi.CI.BAT: failure for Add GuC Error Capture Support (rev4)
In reply to Alan Previn== Series Details ==
== Series Details ==
Series: Add GuC Error Capture Support (rev4)
URL : https://patchwork.freedesktop.org/series/97187/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_11094 -> Patchwork_22011
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with Patchwork_22011 absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_22011, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22011/index.html
Participating hosts (46 -> 37)
------------------------------
Additional (2): fi-kbl-soraka fi-pnv-d510
Missing (11): fi-bdw-samus shard-tglu bat-dg1-6 bat-dg1-5 fi-bsw-cyan bat-adlp-6 bat-rpls-1 shard-rkl shard-dg1 bat-jsl-2 bat-jsl-1
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_22011:
### IGT changes ###
#### Possible regressions ####
* igt@core_hotunplug@unbind-rebind:
- fi-cfl-guc: [PASS][1] -> [INCOMPLETE][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11094/fi-cfl-guc/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22011/fi-cfl-guc/igt@[email protected]
- fi-kbl-guc: [PASS][3] -> [INCOMPLETE][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11094/fi-kbl-guc/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22011/fi-kbl-guc/igt@[email protected]
- fi-skl-guc: [PASS][5] -> [INCOMPLETE][6]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11094/fi-skl-guc/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22011/fi-skl-guc/igt@[email protected]
* igt@i915_selftest@live@hangcheck:
- fi-rkl-guc: [PASS][7] -> [DMESG-WARN][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11094/fi-rkl-guc/igt@i915_selftest@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22011/fi-rkl-guc/igt@i915_selftest@[email protected]
Known issues
------------
Here are the changes found in Patchwork_22011 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@amdgpu/amd_basic@semaphore:
- fi-bdw-5557u: NOTRUN -> [SKIP][9] ([fdo#109271]) +31 similar issues
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22011/fi-bdw-5557u/igt@amdgpu/[email protected]
* igt@amdgpu/amd_cs_nop@sync-fork-compute0:
- fi-snb-2600: NOTRUN -> [SKIP][10] ([fdo#109271]) +17 similar issues
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22011/fi-snb-2600/igt@amdgpu/[email protected]
* igt@gem_exec_fence@basic-busy@bcs0:
- fi-kbl-soraka: NOTRUN -> [SKIP][11] ([fdo#109271]) +8 similar issues
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22011/fi-kbl-soraka/igt@gem_exec_fence@[email protected]
* igt@gem_flink_basic@bad-flink:
- fi-skl-6600u: [PASS][12] -> [INCOMPLETE][13] ([i915#4547])
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11094/fi-skl-6600u/igt@[email protected]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22011/fi-skl-6600u/igt@[email protected]
* igt@gem_huc_copy@huc-copy:
- fi-pnv-d510: NOTRUN -> [SKIP][14] ([fdo#109271]) +57 similar issues
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22011/fi-pnv-d510/igt@[email protected]
- fi-kbl-soraka: NOTRUN -> [SKIP][15] ([fdo#109271] / [i915#2190])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22011/fi-kbl-soraka/igt@[email protected]
* igt@gem_lmem_swapping@parallel-random-engines:
- fi-kbl-soraka: NOTRUN -> [SKIP][16] ([fdo#109271] / [i915#4613]) +3 similar issues
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22011/fi-kbl-soraka/igt@[email protected]
* igt@i915_selftest@live@execlists:
- fi-bsw-kefka: [PASS][17] -> [INCOMPLETE][18] ([i915#2940])
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11094/fi-bsw-kefka/igt@i915_selftest@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22011/fi-bsw-kefka/igt@i915_selftest@[email protected]
* igt@i915_selftest@live@gt_pm:
- fi-kbl-soraka: NOTRUN -> [DMESG-FAIL][19] ([i915#1886] / [i915#2291])
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22011/fi-kbl-soraka/igt@i915_selftest@live@gt_pm.html
* igt@i915_selftest@live@requests:
- fi-blb-e6850: [PASS][20] -> [DMESG-FAIL][21] ([i915#4528])
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11094/fi-blb-e6850/igt@i915_selftest@[email protected]
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22011/fi-blb-e6850/igt@i915_selftest@[email protected]
* igt@kms_chamelium@dp-edid-read:
- fi-kbl-soraka: NOTRUN -> [SKIP][22] ([fdo#109271] / [fdo#111827]) +8 similar issues
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22011/fi-kbl-soraka/igt@[email protected]
* igt@kms_chamelium@vga-edid-read:
- fi-bdw-5557u: NOTRUN -> [SKIP][23] ([fdo#109271] / [fdo#111827]) +8 similar issues
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22011/fi-bdw-5557u/igt@[email protected]
* igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-d:
- fi-kbl-soraka: NOTRUN -> [SKIP][24] ([fdo#109271] / [i915#533])
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22011/fi-kbl-soraka/igt@[email protected]
* igt@runner@aborted:
- fi-cfl-guc: NOTRUN -> [FAIL][25] ([i915#2426] / [i915#4312])
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22011/fi-cfl-guc/igt@[email protected]
- fi-skl-guc: NOTRUN -> [FAIL][26] ([i915#2426] / [i915#4312])
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22011/fi-skl-guc/igt@[email protected]
- fi-blb-e6850: NOTRUN -> [FAIL][27] ([fdo#109271] / [i915#2403] / [i915#4312])
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22011/fi-blb-e6850/igt@[email protected]
- fi-bsw-kefka: NOTRUN -> [FAIL][28] ([fdo#109271] / [i915#1436] / [i915#3428] / [i915#4312])
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22011/fi-bsw-kefka/igt@[email protected]
- fi-kbl-guc: NOTRUN -> [FAIL][29] ([i915#2426] / [i915#4312])
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22011/fi-kbl-guc/igt@[email protected]
#### Possible fixes ####
* igt@gem_exec_suspend@basic-s3@smem:
- fi-bdw-5557u: [INCOMPLETE][30] ([i915#146]) -> [PASS][31]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11094/fi-bdw-5557u/igt@gem_exec_suspend@[email protected]
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22011/fi-bdw-5557u/igt@gem_exec_suspend@[email protected]
* igt@i915_selftest@live@gt_heartbeat:
- {fi-tgl-dsi}: [INCOMPLETE][32] -> [PASS][33]
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11094/fi-tgl-dsi/igt@i915_selftest@live@gt_heartbeat.html
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22011/fi-tgl-dsi/igt@i915_selftest@live@gt_heartbeat.html
* igt@i915_selftest@live@hangcheck:
- fi-snb-2600: [INCOMPLETE][34] ([i915#3921]) -> [PASS][35]
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11094/fi-snb-2600/igt@i915_selftest@[email protected]
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22011/fi-snb-2600/igt@i915_selftest@[email protected]
#### Warnings ####
* igt@runner@aborted:
- fi-skl-6600u: [FAIL][36] ([i915#4312]) -> [FAIL][37] ([i915#2722] / [i915#4312])
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11094/fi-skl-6600u/igt@[email protected]
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22011/fi-skl-6600u/igt@[email protected]
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109315]: https://bugs.freedesktop.org/show_bug.cgi?id=109315
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[i915#1436]: https://gitlab.freedesktop.org/drm/intel/issues/1436
[i915#146]: https://gitlab.freedesktop.org/drm/intel/issues/146
[i915#1886]: https://gitlab.freedesktop.org/drm/intel/issues/1886
[i915#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190
[i915#2291]: https://gitlab.freedesktop.org/drm/intel/issues/2291
[i915#2403]: https://gitlab.freedesktop.org/drm/intel/issues/2403
[i915#2426]: https://gitlab.freedesktop.org/drm/intel/issues/2426
[i915#2575]: https://gitlab.freedesktop.org/drm/intel/issues/2575
[i915#2722]: https://gitlab.freedesktop.org/drm/intel/issues/2722
[i915#2940]: https://gitlab.freedesktop.org/drm/intel/issues/2940
[i915#3428]: https://gitlab.freedesktop.org/drm/intel/issues/3428
[i915#3921]: https://gitlab.freedesktop.org/drm/intel/issues/3921
[i915#4312]: https://gitlab.freedesktop.org/drm/intel/issues/4312
[i915#4528]: https://gitlab.freedesktop.org/drm/intel/issues/4528
[i915#4547]: https://gitlab.freedesktop.org/drm/intel/issues/4547
[i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
[i915#533]: https://gitlab.freedesktop.org/drm/intel/issues/533
Build changes
-------------
* Linux: CI_DRM_11094 -> Patchwork_22011
CI-20190529: 20190529
CI_DRM_11094: 6ce31c986ee8beaa0f98fd4e200b7a421fd4adf9 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_6327: 0d559158c2d3b5723abbfc2cb4b04532e28663b2 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_22011: e6a40bf716e6f1ecea017de684ee5bcd06eff8db @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
e6a40bf716e6 drm/i915/guc: Print the GuC error capture output register list. dcf143ea1f41 drm/i915/guc: Copy new GuC error capture logs upon G2H notification. b484fd64c7ba drm/i915/guc: Update GuC's log-buffer-state access for error capture. 13acbdb9a7ca drm/i915/guc: Add GuC's error state capture output structures. 7febfa438109 drm/i915/guc: Add DG2 registers for GuC error state capture. 68bc5c4ac7f8 drm/i915/guc: Add XE_LP registers for GuC error state capture. c5b79a260782 drm/i915/guc: Update GuC ADS size for error capture lists
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22011/index.html