Skip to content

gpu: nova-core: add INTR_CTRL interrupt controller and CPU doorbell self-test

Joel Fernandes dri-devel linux-doc lkml nova-gpu rust-for-linux 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7rust: sync: completion: add wait_for_completion_timeout()rust/kernel/sync/completion.rs+17 -12 replies
2/7gpu: nova-core: allocate PCI MSI vector during probedrivers/gpu/nova-core/gpu.rs drivers/gpu/nova-core/irq.rs drivers/gpu/nova-core/nova_core.rs+33 -00 replies
3/7gpu: nova-core: add interrupt controller register definitionsdrivers/gpu/nova-core/regs.rs+47 -00 replies
4/7gpu: nova-core: add Architecture::is_pre_hopper() helperdrivers/gpu/nova-core/gpu.rs+7 -00 replies
5/7gpu: nova-core: add INTR_CTRL interrupt controller APIdrivers/gpu/nova-core/irq.rs drivers/gpu/nova-core/irq/intr_ctrl.rs drivers/gpu/nova-core/nova_core.rs+284 -00 replies
6/7gpu: nova-core: add CPU doorbell IRQ self-testdrivers/gpu/nova-core/Kconfig drivers/gpu/nova-core/gpu.rs drivers/gpu/nova-core/irq.rs +2 more+227 -10 replies
7/7gpu: nova-core: document INTR_CTRL interrupt treeDocumentation/gpu/nova/core/intr-ctrl.rst Documentation/gpu/nova/index.rst+306 -00 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH v1 0/7] gpu: nova-core: add INTR_CTRL interrupt controller and CPU doorbell self-test

This series adds interrupt controller support to nova-core, and validates the full interrupt path with a CPU-doorbell self-test. It is based on today's drm-rust-next tree.

The GPU interrupt controller block (INTR_CTRL)
----------------------------------------------
INTR_CTRL is the GPU's two-level (top/leaf) interrupt controller. It multiplexes all GSP and engine interrupts onto a single PCI MSI line. We need it to receive asynchronous messages from GSP. GSP will the host with a SWGEN0 interrupt (routed via INTR_CTRL) to deliver async RPC messages like error reports (XIDs) and other event. INTR_CTRL also routes notifications from GPU engines to PCIe MSI such as submitted work completion, MMU faults, etc. Detailed documentation of the architecture with diagrams are provided in a separate patch (patch 7/7).

What this series proves
-----------------------
The CPU doorbell self-test (patch 6/7) exercises the full interrupt path end-to-end. It uses the LEAF_TRIGGER hardware register in INTR_CTRL to trigger a interrupt, then waits for the IRQ handler to fire. The path under test is:

LEAF_TRIGGER write
v
INTR_CTRL TOP/LEAF goes pending
v
GPU fires PCI MSI write
v
Host VFIO -> guest IOMMU/IRQ
v
Guest Linux IRQ -> nova-core handler
v
Handler

The full stack has been end-to-end tested on Ampere GA102 with GPU passthrough.

What comes next
---------------
This is the first stage. Once this lands, the next step is to read (via RPC) the interrupt vector table that GSP programs at boot. That table tells us which INTR_CTRL leaf and bit each engine is wired to, so the driver can route incoming interrupts to per-engine handlers. Future patches will also add GSP interrupt support, and a per-engine ISR dispatch loops.

The git tree with all patches can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/jfern/linux.git (tag: nova-intr-ctrl-v1-20260501b)

Joel Fernandes (7):
rust: sync: completion: add wait_for_completion_timeout()
gpu: nova-core: allocate PCI MSI vector during probe
gpu: nova-core: add interrupt controller register definitions
gpu: nova-core: add Architecture::is_pre_hopper() helper
gpu: nova-core: add INTR_CTRL interrupt controller API
gpu: nova-core: add CPU doorbell IRQ self-test
gpu: nova-core: document INTR_CTRL interrupt tree

 Documentation/gpu/nova/core/intr-ctrl.rst  | 305 +++++++++++++++++++++
 Documentation/gpu/nova/index.rst           |   1 +
 drivers/gpu/nova-core/Kconfig              |  13 +
 drivers/gpu/nova-core/gpu.rs               |  22 ++
 drivers/gpu/nova-core/irq.rs               |  29 ++
 drivers/gpu/nova-core/irq/doorbell_test.rs | 203 ++++++++++++++
 drivers/gpu/nova-core/irq/intr_ctrl.rs     | 281 +++++++++++++++++++
 drivers/gpu/nova-core/nova_core.rs         |   2 +
 drivers/gpu/nova-core/regs.rs              |  13 +
 rust/kernel/sync/completion.rs             |  18 +-
 10 files changed, 886 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/gpu/nova/core/intr-ctrl.rst
 create mode 100644 drivers/gpu/nova-core/irq.rs
 create mode 100644 drivers/gpu/nova-core/irq/doorbell_test.rs
 create mode 100644 drivers/gpu/nova-core/irq/intr_ctrl.rs

base-commit: 610e892bdb57043c7769982c2bff0260b6007b75

Signature · 1 line
2.34.1