Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/21] GPU debug support (eudebug)
@ 2024-07-26 14:07 Mika Kuoppala
  2024-07-26 14:07 ` [PATCH 01/21] drm/xe: Export xe_hw_engine's mmio accessors Mika Kuoppala
                   ` (29 more replies)
  0 siblings, 30 replies; 78+ messages in thread
From: Mika Kuoppala @ 2024-07-26 14:07 UTC (permalink / raw)
  To: intel-xe; +Cc: Mika Kuoppala

Hi,

We (Intel eudebug kernel team) would like to submit this
patchset to enable debug support for Intel GPU devices.

The aim is to allow Level-Zero + GDB (or some other tool)
to attach to xe driver in order to receive information
about relevant driver resources, hardware events and to allow debug
related hardware control. End goal is full debug capability
of supported Intel hardware, see [4].

Debugger first opens a connection to a device through
drm ioctl with debug target process 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.

Along with the resource and metadata events, an event for
hardware exceptions, called EU attention, is provided.
The debugger, with the assistance of an exception handling
program called System Routine (short: SIP) provided
with the pipeline setup, can determine which specific
EU/thread and instruction encountered the breakpoint
or other exceptions.

EU controlling ioctl interface is also introduced where
debugger can manipulate individual threads of the currently
active workload. This interface enables the debugger to
interrupt all threads on demand, check their current state
and resume them individually.

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

For xe the aim is to have all support merged in upstream,
starting with this series. With Lunarlake being first targetted
hardware.

I have split the events into xe_drm_eudebug.h instead
pushing everything into xe_drm.h, in order to help
distinguish what is controlled by which descriptor.
If it's through the original xe fd, it is in xe_drm.h and
if it's through the opened debugger connection fd, it
is in xe_drm_eudebug.h.

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

With the associated IGT tests:
[2] https://gitlab.freedesktop.org/cmanszew/igt-gpu-tools/-/tree/eudebug-dev

The user for this uapi:
[3] https://github.com/intel/compute-runtime
Event loop and thread control interaction can be found at:
https://github.com/intel/compute-runtime/tree/master/level_zero/tools/source/debug/linux/xe
And the wrappers in:
https://github.com/intel/compute-runtime/tree/master/shared/source/os_interface/linux/xe
https://github.com/intel/compute-runtime/blob/master/shared/source/os_interface/linux/xe/ioctl_helper_xe_debugger.cpp
Note that the XE support is disabled by default and you will need
NEO_ENABLE_XE_EU_DEBUG_SUPPORT enabled in order to test.

GDB support:
[4]: https://sourceware.org/pipermail/gdb-patches/2024-July/210264.html

Thank you in advance for any comments and insight.


Andrzej Hajda (1):
  drm/xe/eudebug: implement userptr_vma access

Christoph Manszewski (3):
  drm/xe/eudebug: Add vm bind and vm bind ops
  drm/xe/eudebug: Dynamically toggle debugger functionality
  drm/xe/eudebug_test: Introduce xe_eudebug wa kunit test

Dominik Grzegorzek (10):
  drm/xe: Export xe_hw_engine's mmio accessors
  drm/xe: Move and export xe_hw_engine lookup.
  drm/xe/eudebug: Introduce exec_queue events
  drm/xe/eudebug: hw enablement for eudebug
  drm/xe: Add EUDEBUG_ENABLE exec queue property
  drm/xe/eudebug: Introduce per device attention scan worker
  drm/xe/eudebug: Introduce EU control interface
  drm/xe: Debug metadata create/destroy ioctls
  drm/xe: Attach debug metadata to vma
  drm/xe/eudebug: Add debug metadata support for xe_eudebug

Jonathan Cavitt (1):
  drm/xe/eudebug: Use ptrace_may_access for xe_eudebug_attach

Mika Kuoppala (6):
  drm/xe/eudebug: Introduce eudebug support
  kernel: export ptrace_may_access
  drm/xe/eudebug: Introduce discovery for resources
  drm/xe/eudebug: Add UFENCE events with acks
  drm/xe/eudebug: vm open/pread/pwrite
  drm/xe/eudebug: Implement vm_bind_op discovery

 drivers/gpu/drm/xe/Makefile                  |    5 +-
 drivers/gpu/drm/xe/regs/xe_engine_regs.h     |    8 +
 drivers/gpu/drm/xe/regs/xe_gt_regs.h         |   43 +
 drivers/gpu/drm/xe/tests/xe_eudebug.c        |  170 +
 drivers/gpu/drm/xe/tests/xe_live_test_mod.c  |    2 +
 drivers/gpu/drm/xe/xe_debug_metadata.c       |  125 +
 drivers/gpu/drm/xe/xe_debug_metadata.h       |   25 +
 drivers/gpu/drm/xe/xe_debug_metadata_types.h |   28 +
 drivers/gpu/drm/xe/xe_device.c               |   47 +-
 drivers/gpu/drm/xe/xe_device_types.h         |   45 +
 drivers/gpu/drm/xe/xe_eudebug.c              | 3841 ++++++++++++++++++
 drivers/gpu/drm/xe/xe_eudebug.h              |   51 +
 drivers/gpu/drm/xe/xe_eudebug_types.h        |  326 ++
 drivers/gpu/drm/xe/xe_exec.c                 |    2 +-
 drivers/gpu/drm/xe/xe_exec_queue.c           |   80 +-
 drivers/gpu/drm/xe/xe_exec_queue_types.h     |    7 +
 drivers/gpu/drm/xe/xe_gt_debug.c             |  152 +
 drivers/gpu/drm/xe/xe_gt_debug.h             |   27 +
 drivers/gpu/drm/xe/xe_hw_engine.c            |   39 +-
 drivers/gpu/drm/xe/xe_hw_engine.h            |   11 +
 drivers/gpu/drm/xe/xe_lrc.c                  |   16 +-
 drivers/gpu/drm/xe/xe_lrc.h                  |    4 +-
 drivers/gpu/drm/xe/xe_reg_sr.c               |   21 +-
 drivers/gpu/drm/xe/xe_reg_sr.h               |    4 +-
 drivers/gpu/drm/xe/xe_rtp.c                  |    2 +-
 drivers/gpu/drm/xe/xe_rtp_types.h            |    1 +
 drivers/gpu/drm/xe/xe_sync.c                 |   49 +-
 drivers/gpu/drm/xe/xe_sync.h                 |    8 +-
 drivers/gpu/drm/xe/xe_sync_types.h           |   26 +-
 drivers/gpu/drm/xe/xe_vm.c                   |  227 +-
 drivers/gpu/drm/xe/xe_vm_types.h             |   26 +
 include/uapi/drm/xe_drm.h                    |   96 +-
 include/uapi/drm/xe_drm_eudebug.h            |  226 ++
 kernel/ptrace.c                              |    1 +
 34 files changed, 5655 insertions(+), 86 deletions(-)
 create mode 100644 drivers/gpu/drm/xe/tests/xe_eudebug.c
 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 include/uapi/drm/xe_drm_eudebug.h

-- 
2.34.1


^ permalink raw reply	[flat|nested] 78+ messages in thread

end of thread, other threads:[~2024-08-27  8:42 UTC | newest]

Thread overview: 78+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-26 14:07 [PATCH 00/21] GPU debug support (eudebug) Mika Kuoppala
2024-07-26 14:07 ` [PATCH 01/21] drm/xe: Export xe_hw_engine's mmio accessors Mika Kuoppala
2024-07-27  5:45   ` Matthew Brost
2024-08-08 11:04   ` Andi Shyti
2024-07-26 14:07 ` [PATCH 02/21] drm/xe: Move and export xe_hw_engine lookup Mika Kuoppala
2024-07-27  5:49   ` Matthew Brost
2024-08-08 11:08   ` Andi Shyti
2024-07-26 14:08 ` [PATCH 03/21] drm/xe/eudebug: Introduce eudebug support Mika Kuoppala
2024-07-26 19:20   ` Matthew Brost
2024-07-30 14:12     ` Mika Kuoppala
2024-07-31  1:18       ` Matthew Brost
2024-08-07  9:34   ` Zbigniew Kempczyński
2024-08-21 11:37     ` Mika Kuoppala
2024-08-12 12:02   ` Zbigniew Kempczyński
2024-08-21 11:38     ` Mika Kuoppala
2024-07-26 14:08 ` [PATCH 04/21] kernel: export ptrace_may_access Mika Kuoppala
2024-07-29 18:56   ` Lucas De Marchi
2024-08-08 11:18   ` Andi Shyti
2024-08-21 11:46     ` Mika Kuoppala
2024-07-26 14:08 ` [PATCH 05/21] drm/xe/eudebug: Use ptrace_may_access for xe_eudebug_attach Mika Kuoppala
2024-07-29 19:00   ` Lucas De Marchi
2024-07-26 14:08 ` [PATCH 06/21] drm/xe/eudebug: Introduce discovery for resources Mika Kuoppala
2024-07-26 14:08 ` [PATCH 07/21] drm/xe/eudebug: Introduce exec_queue events Mika Kuoppala
2024-07-26 14:08 ` [PATCH 08/21] drm/xe/eudebug: hw enablement for eudebug Mika Kuoppala
2024-07-29 19:05   ` Lucas De Marchi
2024-07-29 19:16     ` Lucas De Marchi
2024-07-30  9:01     ` Grzegorzek, Dominik
2024-07-30 13:56       ` Lucas De Marchi
2024-07-26 14:08 ` [PATCH 09/21] drm/xe: Add EUDEBUG_ENABLE exec queue property Mika Kuoppala
2024-07-26 18:35   ` Matthew Brost
2024-07-27  0:54   ` Matthew Brost
2024-07-26 14:08 ` [PATCH 10/21] drm/xe/eudebug: Introduce per device attention scan worker Mika Kuoppala
2024-07-27  5:08   ` Matthew Brost
2024-07-29 10:10     ` Grzegorzek, Dominik
2024-07-31  1:25       ` Matthew Brost
2024-07-27  5:39   ` Matthew Brost
2024-07-26 14:08 ` [PATCH 11/21] drm/xe/eudebug: Introduce EU control interface Mika Kuoppala
2024-07-26 14:08 ` [PATCH 12/21] drm/xe/eudebug: Add vm bind and vm bind ops Mika Kuoppala
2024-07-26 14:08 ` [PATCH 13/21] drm/xe/eudebug: Add UFENCE events with acks Mika Kuoppala
2024-07-27  0:40   ` Matthew Brost
2024-07-30 14:05     ` Mika Kuoppala
2024-07-31  1:33       ` Matthew Brost
2024-07-26 14:08 ` [PATCH 14/21] drm/xe/eudebug: vm open/pread/pwrite Mika Kuoppala
2024-07-26 18:59   ` Matthew Brost
2024-07-26 14:08 ` [PATCH 15/21] drm/xe/eudebug: implement userptr_vma access Mika Kuoppala
2024-07-26 18:46   ` Matthew Brost
2024-07-26 18:50     ` Matthew Brost
2024-07-27  1:45       ` Matthew Brost
2024-07-31 11:11         ` [PATCH] fixup! " Andrzej Hajda
2024-07-31 17:51           ` Matthew Brost
2024-08-05 16:54             ` [PATCH v2] " Andrzej Hajda
2024-08-05 19:20               ` Cavitt, Jonathan
2024-08-26 14:40             ` [PATCH v2.5] " Andrzej Hajda
2024-08-26 16:45               ` Andrzej Hajda
2024-08-26 17:02               ` Matthew Brost
2024-08-27  8:41                 ` [PATCH v3] " Andrzej Hajda
2024-07-26 14:08 ` [PATCH 16/21] drm/xe: Debug metadata create/destroy ioctls Mika Kuoppala
2024-07-26 14:08 ` [PATCH 17/21] drm/xe: Attach debug metadata to vma Mika Kuoppala
2024-07-26 21:25   ` Matthew Brost
2024-07-26 14:08 ` [PATCH 18/21] drm/xe/eudebug: Add debug metadata support for xe_eudebug Mika Kuoppala
2024-07-26 14:08 ` [PATCH 19/21] drm/xe/eudebug: Implement vm_bind_op discovery Mika Kuoppala
2024-07-27  4:39   ` Matthew Brost
2024-07-26 14:08 ` [PATCH 20/21] drm/xe/eudebug: Dynamically toggle debugger functionality Mika Kuoppala
2024-07-28  4:50   ` Matthew Brost
2024-07-30 15:01     ` Manszewski, Christoph
2024-07-31 18:03       ` Matthew Brost
2024-08-07 10:09     ` Manszewski, Christoph
2024-07-26 14:08 ` [PATCH 21/21] drm/xe/eudebug_test: Introduce xe_eudebug wa kunit test Mika Kuoppala
2024-07-26 14:32 ` ✓ CI.Patch_applied: success for GPU debug support (eudebug) Patchwork
2024-07-26 14:33 ` ✗ CI.checkpatch: warning " Patchwork
2024-07-26 14:34 ` ✓ CI.KUnit: success " Patchwork
2024-07-26 14:46 ` ✓ CI.Build: " Patchwork
2024-07-26 14:48 ` ✗ CI.Hooks: failure " Patchwork
2024-07-26 14:49 ` ✓ CI.checksparse: success " Patchwork
2024-07-26 15:10 ` ✓ CI.BAT: " Patchwork
2024-07-27  2:37 ` ✓ CI.FULL: " Patchwork
2024-07-27  5:23 ` [PATCH 00/21] " Matthew Brost
2024-07-29  8:27   ` Gwan-gyeong Mun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox