Skip to content

RFC xe-eudebug: GPU debugging interface

Mika Kuoppala intel-xe 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest25 patches 13 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/25drm/xe/eudebug: Introduce eudebug supportdrivers/gpu/drm/xe/Makefile drivers/gpu/drm/xe/xe_device.c drivers/gpu/drm/xe/xe_device_types.h +5 more+1335 -34 replies
2/25drm/xe/eudebug: Introduce discovery for resourcesdrivers/gpu/drm/xe/xe_eudebug.c drivers/gpu/drm/xe/xe_eudebug_types.h+118 -11 reply
3/25drm/xe/eudebug: Introduce exec_queue eventsdrivers/gpu/drm/xe/xe_eudebug.c drivers/gpu/drm/xe/xe_eudebug.h drivers/gpu/drm/xe/xe_eudebug_types.h +2 more+212 -24 replies
4/25drm/xe/eudebug: hw enablement for eudebugdrivers/gpu/drm/xe/regs/xe_gt_regs.h drivers/gpu/drm/xe/xe_eudebug.c drivers/gpu/drm/xe/xe_eudebug.h +1 more+66 -04 replies
5/25drm/xe: define XE_MAX_[DSS|EU]_FUSE_BITS globallydrivers/gpu/drm/xe/xe_gt_topology.c drivers/gpu/drm/xe/xe_gt_types.h+4 -50 replies
6/25drm/xe: Introduce for_each_dss_steering loopdrivers/gpu/drm/xe/xe_gt_mcr.c drivers/gpu/drm/xe/xe_gt_mcr.h+42 -00 replies
7/25drm/xe: Export xe_hw_engine's mmio accessorsdrivers/gpu/drm/xe/xe_hw_engine.c drivers/gpu/drm/xe/xe_hw_engine.h+7 -30 replies
8/25drm/xe: Add runalone engine propertydrivers/gpu/drm/xe/regs/xe_engine_regs.h drivers/gpu/drm/xe/xe_exec_queue.c drivers/gpu/drm/xe/xe_lrc.c +2 more+34 -00 replies
9/25drm/xe/eudebug: Introduce per device attention scan workerdrivers/gpu/drm/xe/Makefile drivers/gpu/drm/xe/regs/xe_engine_regs.h drivers/gpu/drm/xe/regs/xe_gt_regs.h +6 more+583 -80 replies
10/25drm/xe: Move and export xe_hw_engine lookup.drivers/gpu/drm/xe/xe_exec_queue.c drivers/gpu/drm/xe/xe_hw_engine.c drivers/gpu/drm/xe/xe_hw_engine.h+40 -330 replies
11/25drm/xe/eudebug: Introduce EU control interfacedrivers/gpu/drm/xe/regs/xe_gt_regs.h drivers/gpu/drm/xe/xe_eudebug.c drivers/gpu/drm/xe/xe_eudebug_types.h +3 more+443 -150 replies
12/25drm/xe: Extend drm_xe_vm_bind_opinclude/uapi/drm/xe_drm.h+3 -00 replies
13/25drm/xe/eudebug: uapi for client to debugger metadata (work in progress)include/uapi/drm/xe_drm.h+103 -00 replies
14/25drm/xe/eudebug: Create/destroy user metadatainclude/uapi/drm/xe_drm_tmp.h+12 -00 replies
15/25drm/xe/eudebug: Set vm metadatainclude/uapi/drm/xe_drm_tmp.h+15 -00 replies
16/25drm/xe/eudebug: User coredump supportdrivers/gpu/drm/xe/Makefile drivers/gpu/drm/xe/xe_device_types.h drivers/gpu/drm/xe/xe_eudebug.c +6 more+392 -110 replies
17/25drm/xe/eudebug: Add per process coredumpsdrivers/gpu/drm/xe/xe_device.c drivers/gpu/drm/xe/xe_device_types.h drivers/gpu/drm/xe/xe_usercoredump.c +2 more+217 -10 replies
18/25drm/xe: Debug metadata create/destroy ioctlsdrivers/gpu/drm/xe/Makefile drivers/gpu/drm/xe/xe_debug_metadata.c drivers/gpu/drm/xe/xe_debug_metadata.h +3 more+184 -00 replies
19/25xe/drm: Include debug_metadata in usercoredumpdrivers/gpu/drm/xe/xe_usercoredump.c drivers/gpu/drm/xe/xe_usercoredump_types.h+62 -10 replies
20/25drm/xe: Set vm debug metadatadrivers/gpu/drm/xe/xe_usercoredump.c drivers/gpu/drm/xe/xe_usercoredump_types.h drivers/gpu/drm/xe/xe_vm.c +1 more+177 -110 replies
21/25drm/xe/: Include attention in usercapture.drivers/gpu/drm/xe/xe_eudebug.c drivers/gpu/drm/xe/xe_usercoredump.c drivers/gpu/drm/xe/xe_usercoredump_types.h+180 -20 replies
22/25RFC: xe/drm: attach debug metadata to vmadrivers/gpu/drm/xe/xe_debug_metadata.c drivers/gpu/drm/xe/xe_debug_metadata.h drivers/gpu/drm/xe/xe_vm.c +1 more+163 -80 replies
23/25drm/xe: Capture metadata attached to vmadrivers/gpu/drm/xe/xe_usercoredump.c drivers/gpu/drm/xe/xe_usercoredump_types.h+8 -10 replies
24/25drm/xe/xe_eudebug: Add vm bind events w/o ackingdrivers/gpu/drm/xe/xe_eudebug.c drivers/gpu/drm/xe/xe_eudebug.h drivers/gpu/drm/xe/xe_eudebug_types.h +2 more+131 -60 replies
25/25drm/xe/eudebug: vm open/pread/pwritedrivers/gpu/drm/xe/regs/xe_gt_regs.h drivers/gpu/drm/xe/xe_eudebug.c drivers/gpu/drm/xe/xe_eudebug.h +1 more+431 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [Intel-xe] [RFC 00/25] xe-eudebug: GPU debugging interface

Hi,

This patchset is to allow l0/oneAPI GDB
(or some other debugger) to attach to xe driven device.

The intent is to provide a similar but not API compatible functionality as in:
https://dgpu-docs.intel.com/driver/gpu-debugging.html

Debugger first opens a connection to a device through drm ioctl with debug target as a pid. This will return a dedicated file descriptor used for debugging for further events and control.

Xe internal resources that are considered essential to debugger functionality are relayed as events to the debugger. On debugger connection, all existing resources are relayed to debugger (discovery) and from that point onwards, as they are created/destroyed.

uapi is extended to allow an application/lib to provide debug metadata information. These are relayed as events to the debugger so it can decode the program state. Debug metadata is also attached to capture dumps if no debugger was connected during the gpu/hw exception. For capturing, the goal is to allow external tools to construct symbolic backtraces from error capture dumps.

Along with the resource and metadata events, we provide an event for EU attention. The debugger can (with the assistance of SIP program provided with pipeline setup), figure out which exact eu/thread and instruction encountered the breakpoint or some other exception.

Latest code can be found in:
https://gitlab.freedesktop.org/miku/kernel/-/tree/eudebug-dev

With the associated tests in:
https://gitlab.freedesktop.org/Dominisg/igt-gpu-tools/-/tree/eudebug-dev

All comments greatly appreciated,
- Mika

Christoph Manszewski (1):
drm/xe/xe_eudebug: Add vm bind events w/o acking

Dominik Grzegorzek (15):
drm/xe/eudebug: Introduce exec_queue events drm/xe/eudebug: hw enablement for eudebug drm/xe: define XE_MAX_[DSS|EU]_FUSE_BITS globally drm/xe: Introduce for_each_dss_steering loop drm/xe: Export xe_hw_engine's mmio accessors drm/xe: Add runalone engine property drm/xe/eudebug: Introduce per device attention scan worker drm/xe: Move and export xe_hw_engine lookup. drm/xe/eudebug: Introduce EU control interface drm/xe: Debug metadata create/destroy ioctls xe/drm: Include debug_metadata in usercoredump drm/xe: Set vm debug metadata
drm/xe/: Include attention in usercapture.
RFC: xe/drm: attach debug metadata to vma drm/xe: Capture metadata attached to vma

Mika Kuoppala (9):
drm/xe/eudebug: Introduce eudebug support drm/xe/eudebug: Introduce discovery for resources drm/xe: Extend drm_xe_vm_bind_op
drm/xe/eudebug: uapi for client to debugger metadata (work in
progress)
drm/xe/eudebug: Create/destroy user metadata drm/xe/eudebug: Set vm metadata
drm/xe/eudebug: User coredump support drm/xe/eudebug: Add per process coredumps drm/xe/eudebug: vm open/pread/pwrite

 drivers/gpu/drm/xe/Makefile                  |    6 +-
 drivers/gpu/drm/xe/regs/xe_engine_regs.h     |    4 +
 drivers/gpu/drm/xe/regs/xe_gt_regs.h         |   46 +
 drivers/gpu/drm/xe/xe_debug_metadata.c       |  120 +
 drivers/gpu/drm/xe/xe_debug_metadata.h       |   26 +
 drivers/gpu/drm/xe/xe_debug_metadata_types.h |   28 +
 drivers/gpu/drm/xe/xe_device.c               |   42 +-
 drivers/gpu/drm/xe/xe_device_types.h         |   40 +
 drivers/gpu/drm/xe/xe_eudebug.c              | 2552 ++++++++++++++++++
 drivers/gpu/drm/xe/xe_eudebug.h              |   42 +
 drivers/gpu/drm/xe/xe_eudebug_types.h        |  271 ++
 drivers/gpu/drm/xe/xe_exec_queue.c           |   63 +-
 drivers/gpu/drm/xe/xe_gt_debug.c             |  150 +
 drivers/gpu/drm/xe/xe_gt_debug.h             |   27 +
 drivers/gpu/drm/xe/xe_gt_mcr.c               |   27 +
 drivers/gpu/drm/xe/xe_gt_mcr.h               |   15 +
 drivers/gpu/drm/xe/xe_gt_topology.c          |    3 -
 drivers/gpu/drm/xe/xe_gt_types.h             |    6 +-
 drivers/gpu/drm/xe/xe_hw_engine.c            |   37 +-
 drivers/gpu/drm/xe/xe_hw_engine.h            |   11 +
 drivers/gpu/drm/xe/xe_lrc.c                  |    8 +
 drivers/gpu/drm/xe/xe_lrc.h                  |    3 +
 drivers/gpu/drm/xe/xe_usercoredump.c         |  710 +++++
 drivers/gpu/drm/xe/xe_usercoredump.h         |   26 +
 drivers/gpu/drm/xe/xe_usercoredump_types.h   |  107 +
 drivers/gpu/drm/xe/xe_vm.c                   |  284 +-
 drivers/gpu/drm/xe/xe_vm.h                   |    5 +
 drivers/gpu/drm/xe/xe_vm_types.h             |   39 +
 include/uapi/drm/xe_drm.h                    |  107 +
 include/uapi/drm/xe_drm_tmp.h                |  172 ++
 30 files changed, 4914 insertions(+), 63 deletions(-)
 create mode 100644 drivers/gpu/drm/xe/xe_debug_metadata.c
 create mode 100644 drivers/gpu/drm/xe/xe_debug_metadata.h
 create mode 100644 drivers/gpu/drm/xe/xe_debug_metadata_types.h
 create mode 100644 drivers/gpu/drm/xe/xe_eudebug.c
 create mode 100644 drivers/gpu/drm/xe/xe_eudebug.h
 create mode 100644 drivers/gpu/drm/xe/xe_eudebug_types.h
 create mode 100644 drivers/gpu/drm/xe/xe_gt_debug.c
 create mode 100644 drivers/gpu/drm/xe/xe_gt_debug.h
 create mode 100644 drivers/gpu/drm/xe/xe_usercoredump.c
 create mode 100644 drivers/gpu/drm/xe/xe_usercoredump.h
 create mode 100644 drivers/gpu/drm/xe/xe_usercoredump_types.h
 create mode 100644 include/uapi/drm/xe_drm_tmp.h
Signature · 1 line
2.34.1