Skip to content

drm/xe/guc: Improve GuC log dumping and add to devcoredump

[email protected] dri-devel intel-xe 11 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v9 Latest posting 2/211 patches 19 repliesIn review
  2. v9 posting 1/211 patches 0 repliesSuperseded
  3. v8 posting 2/211 patches 8 repliesSuperseded
Earlier versions · 8
VersionPostedPatchesRepliesStatus
v8 posting 1/211 patches1 replySuperseded
v710 patches35 repliesSuperseded
v69 patches5 repliesSuperseded
v58 patches8 repliesSuperseded
v4 posting 3/37 patches6 repliesSuperseded
v4 posting 2/37 patches0 repliesSuperseded
v4 posting 1/32 patches0 repliesSuperseded
v32 patches9 repliesSuperseded

Patches in v9 posting 2/2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11drm/xe/guc: Remove spurious line feed in debug printdrivers/gpu/drm/xe/xe_guc_ct.c+1 -10 replies
2/11drm/xe/devcoredump: Use drm_puts and already cached local variablesdrivers/gpu/drm/xe/xe_devcoredump.c+20 -200 replies
3/11drm/xe/devcoredump: Improve section headings and add tile infodrivers/gpu/drm/xe/xe_devcoredump.c drivers/gpu/drm/xe/xe_devcoredump_types.h drivers/gpu/drm/xe/xe_device.c +2 more+9 -36 replies
4/11drm/xe/devcoredump: Add ASCII85 dump helper functiondrivers/gpu/drm/xe/xe_devcoredump.c drivers/gpu/drm/xe/xe_devcoredump.h+93 -011 replies
5/11drm/xe/guc: Copy GuC log prior to dumpingdrivers/gpu/drm/xe/xe_guc_log.c+23 -170 replies
6/11drm/xe/guc: Use a two stage dump for GuC logs and add more infodrivers/gpu/drm/xe/regs/xe_guc_regs.h drivers/gpu/drm/xe/xe_guc_log.c drivers/gpu/drm/xe/xe_guc_log.h +1 more+195 -151 reply
7/11drm/print: Introduce drm_line_printerdrivers/gpu/drm/drm_print.c include/drm/drm_print.h+78 -01 reply
8/11drm/xe/guc: Dead CT helperdrivers/gpu/drm/xe/abi/guc_communication_ctb_abi.h drivers/gpu/drm/xe/xe_guc.c drivers/gpu/drm/xe/xe_guc_ct.c +2 more+335 -290 replies
9/11drm/xe/guc: Dump entire CTB on errorsdrivers/gpu/drm/xe/xe_guc_ct.c drivers/gpu/drm/xe/xe_guc_ct.h drivers/gpu/drm/xe/xe_guc_ct_types.h+41 -670 replies
10/11drm/xe/guc: Add GuC log to devcoredump capturesdrivers/gpu/drm/xe/xe_devcoredump.c drivers/gpu/drm/xe/xe_devcoredump_types.h+19 -70 replies
11/11drm/xe/guc: Add a helper function for dumping GuC log to dmesgdrivers/gpu/drm/xe/xe_guc_log.c drivers/gpu/drm/xe/xe_guc_log.h+19 -00 replies

Reviews trailers per patch

All 11 patches have a Reviewed-by or Acked-by.

PatchMichal WajdeczkoJulia FilipchukJani NikulaMaarten Lankhorst
1/11R-b R-b
2/11R-b
3/11R-b
4/11R-b
5/11R-b
6/11R-b
7/11R-b A-b
8/11R-b
9/11R-b
10/11R-b
11/11R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v9 thread

Cover letter [PATCH v9 00/11] drm/xe/guc: Improve GuC log dumping and add to devcoredump

From: John Harrison <[email protected]>

There is a debug mechanism for dumping the GuC log as an ASCII hex stream via dmesg. This is extremely useful for situations where it is not possibe to query the log from debugfs (self tests, bugs that cause the driver to fail to load, system hangs, etc.). However, dumping via dmesg is not the most reliable. The dmesg buffer is limited in size, can be rate limited and a simple hex stream is hard to parse by tools.

So add extra information to the dump to make it more robust and parsable. This includes adding start and end tags to delimit the dump, using longer lines to reduce the per line overhead, adding a rolling count to check for missing lines and interleaved concurrent dumps and adding other important information such as the GuC version number and timestamp offset. Also, switch to using the much more compact ASCII85 encoding rather than 0x%08X hexdumping.

There are various internal error states that the CTB code can check for. These should never happen but when they do (driver bug, firmware bug or even hardware bug), they can be a nightmare to debug. So add in a capture of the GuC log and CT state at the point of error and subsequent dump from a worker thread.

Finally, include the GuC log and full CTBs in a devcoredump capture.

Note that the ultimate aim is to then provide a mechanism for generating a devcoredump at an arbitrary point (such as dead CTB or failed selftest) and dumping that to dmesg. There are still a few issues with doing that, but this is all good steps along the way.

v2: Remove pm get/put as unnecessary (review feedback from Matthew B).
v3: Add firmware filename and 'wanted' version number.
v4: Use DRM level line printer wrapper from Michal W. Add 'dead CTB' dump support. Lots of restructuring of capture vs dump for both GuC log and CTB capture for both the dead CTB dump and for future inclusion in devcoredump.
v5: Add missing kerneldocs and other review feedback from Michal W. Fix printf of size_t, clean up re-arming of dead CTBs, add GuC log to devcoredump captures.
v6: Replace hexdumps with much more compact ascii85 encoding, drop module parameter (review feedback from Matthew B). Fix potential use-after-free bug.
v7: Couple of bug fixes and a bunch of changes to improve readability/parsablility of the core dump file, debugfs file and dead CTB dmesg dump.
v8: Fix string size calculation, clean up a macro, fix some formatting, re-work CT_DEAD capture to prevent potential leak (review feedback by Julia F). Add more section headers, use drm_puts, use cached variables.
v9: Disable a couple of CT_DEAD checks that are being hit by CI until the underlying issues can be debugged and fixed.

John Harrison (10):
drm/xe/guc: Remove spurious line feed in debug print drm/xe/devcoredump: Use drm_puts and already cached local variables drm/xe/devcoredump: Improve section headings and add tile info drm/xe/devcoredump: Add ASCII85 dump helper function drm/xe/guc: Copy GuC log prior to dumping
drm/xe/guc: Use a two stage dump for GuC logs and add more info drm/xe/guc: Dead CT helper
drm/xe/guc: Dump entire CTB on errors
drm/xe/guc: Add GuC log to devcoredump captures drm/xe/guc: Add a helper function for dumping GuC log to dmesg

Michal Wajdeczko (1):
drm/print: Introduce drm_line_printer

 drivers/gpu/drm/drm_print.c                   |  14 +
 .../drm/xe/abi/guc_communication_ctb_abi.h    |   1 +
 drivers/gpu/drm/xe/regs/xe_guc_regs.h         |   1 +
 drivers/gpu/drm/xe/xe_devcoredump.c           | 144 +++++-
 drivers/gpu/drm/xe/xe_devcoredump.h           |   6 +
 drivers/gpu/drm/xe/xe_devcoredump_types.h     |  13 +-
 drivers/gpu/drm/xe/xe_device.c                |   1 +
 drivers/gpu/drm/xe/xe_guc.c                   |   2 +-
 drivers/gpu/drm/xe/xe_guc_ct.c                | 430 ++++++++++++++----
 drivers/gpu/drm/xe/xe_guc_ct.h                |  10 +-
 drivers/gpu/drm/xe/xe_guc_ct_types.h          |  29 +-
 drivers/gpu/drm/xe/xe_guc_log.c               | 208 ++++++++-
 drivers/gpu/drm/xe/xe_guc_log.h               |   5 +
 drivers/gpu/drm/xe/xe_guc_log_types.h         |  27 ++
 drivers/gpu/drm/xe/xe_guc_submit.c            |   2 +-
 drivers/gpu/drm/xe/xe_hw_engine.c             |   1 -
 include/drm/drm_print.h                       |  64 +++
 17 files changed, 816 insertions(+), 142 deletions(-)
Signature · 1 line
2.46.0