Skip to content

irqchip/gic-v5: Fix misc IRS and ITS host driver issues

Sascha Bischoff linux-arm-kernel lkml 4 versions – In review

Get series with b4
b4 am [email protected] change-id 20261102-host_gicv5_fixes-1eeea29d2ea4

Versions newest first

  1. v4 Latest13 patches 8 repliesIn review
  2. v314 patches 20 repliesSuperseded
  3. v210 patches 14 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v110 patches16 repliesSuperseded

Changes in v4 from the cover letter

- Rebased onto v7.4-rc4.
- Dropped the L2 IST timeout patch at Lorenzo's request while he
reworks the approach.
- Clarified that IRS synchronisation serialisation prepares for
upcoming KVM callers; removed its Fixes and Cc: stable tags.
- Collected Reviewed-by and Acked-by tags.
- Use FW_BUG for unimplemented SPI warnings.
- Mark retained ITTs, including L2 pointer arrays, with kmemleak_not_leak().
- Return early on device teardown invalidation failure.
- Inline L1 DTE invalidation and explain the effective EVENTID_BITS.
- Link to v3: https://patch.msgid.link/[email protected]

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/13irqchip/gic-v5: Reject SPIs not backed by an IRSdrivers/irqchip/irq-gic-v5.c+9 -01 reply
2/13irqchip/gic-v5: Only set IRS DPS when 1ofN routing is supporteddrivers/irqchip/irq-gic-v5-irs.c include/linux/irqchip/arm-gic-v5.h+10 -50 replies
3/13irqchip/gic-v5: Serialise IRS synchronisation requestsdrivers/irqchip/irq-gic-v5-irs.c+6 -20 replies
4/13irqchip/gic-v5: Serialise ITS invalidation commandsdrivers/irqchip/irq-gic-v5-its.c+9 -01 reply
5/13irqchip/gic-v5: Use linear DT and ITT when L2 covers all IDsdrivers/irqchip/irq-gic-v5-its.c+1 -11 reply
6/13irqchip/gic-v5: Honour ACPI ITS noncoherent flagdrivers/irqchip/irq-gic-v5-its.c+1 -11 reply
7/13irqchip/gic-v5: Use firmware node name in ITS warningdrivers/irqchip/irq-gic-v5-its.c+2 -21 reply
8/13irqchip/gic-v5: Invalidate ITS device cache before freeing ITTdrivers/irqchip/irq-gic-v5-its.c+3 -11 reply
9/13irqchip/gic-v5: Clean the allocated linear device table sizedrivers/irqchip/irq-gic-v5-its.c+3 -31 reply
10/13irqchip/gic-v5: Release ITS MMIO region on DT probe failuredrivers/irqchip/irq-gic-v5-its.c+7 -01 reply
11/13irqchip/gic-v5: Retain the ITT when device invalidation times outdrivers/irqchip/irq-gic-v5-its.c+27 -20 replies
12/13irqchip/gic-v5: Clean a level 2 device table before making it validdrivers/irqchip/irq-gic-v5-its.c+2 -00 replies
13/13irqchip/gic-v5: Invalidate the L1 DTE when allocating an L2 device tabledrivers/irqchip/irq-gic-v5-its.c+18 -60 replies

Reviews trailers per patch

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

PatchLorenzo PieralisiFuad Tabba
1/13A-b R-b
2/13A-b R-b
3/13A-b R-b
4/13A-b R-b
5/13A-b R-b
6/13A-b R-b
7/13A-b R-b
8/13A-b R-b
9/13A-b R-b
10/13A-b R-b
11/13A-b R-b
12/13A-b
13/13A-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 00/13] irqchip/gic-v5: Fix misc IRS and ITS host driver issues

This series fixes issues in the GICv5 host IRS and ITS drivers.

The ITS invalidation serialisation fix addresses Sashiko's report of a race between event and device invalidation commands [1]. The other patches fix IRS allocation and routing, ITS table selection and cache maintenance, ACPI coherency handling, and resource cleanup. The IRS synchronisation change prepares for upcoming KVM callers.

Since v2, Fuad reported missing cache maintenance and L1 invalidation when allocating an L2 device table, as well as unsafe table cleanup after a hardware timeout [2]. This revision includes his L2 device-table cache-clean patch and fixes for L1 invalidation and the host ITS timeout paths. The L2 IST timeout patch is deferred at Lorenzo's request while he reworks the approach.

The IRS changes:
* Reject allocation of an SPI without a backing IRS and warn about broken firmware.
* Only program IRS_PE_CR0.DPS when 1-of-N routing is supported.
* Serialise synchronisation requests and their completion polls in preparation for upcoming KVM callers.

The ITS changes:
* Serialise event and device cache invalidations, which share the DIDR register.
* Select linear device and interrupt translation tables when one L2 table covers the full ID space.
* Honour the ACPI noncoherent flag.
* Use firmware-node names in initialisation warnings.
* Invalidate the device cache before freeing an ITT.
* Correct cache-maintenance sizing after limiting the DeviceID width.
* Release the reserved MMIO region if DT-based ITS initialisation fails.
* Retain the ITT if device invalidation times out during registration or teardown.
* Clean a new L2 device table before publishing its valid L1 DTE.
* Invalidate the L1 DTE immediately after publishing the L2 device table, including when device registration subsequently fails.

The ITS invalidation serialisation fix, ITS table-selection fix, ACPI coherency fix, device-table cache-maintenance fixes and L1 DTE invalidation fix carry Cc: stable trailers for backporting.

The series is based on v7.4-rc4. Thanks to Lorenzo for the review and to Fuad for the additional reports and cache-clean patch.

Sascha

[1] https://sashiko.dev/#/patchset/[email protected]?part=11
[2] https://lore.kernel.org/r/[email protected]

---
Changes in v4:
- Rebased onto v7.4-rc4.
- Dropped the L2 IST timeout patch at Lorenzo's request while he
reworks the approach.
- Clarified that IRS synchronisation serialisation prepares for
upcoming KVM callers; removed its Fixes and Cc: stable tags.
- Collected Reviewed-by and Acked-by tags.
- Use FW_BUG for unimplemented SPI warnings.
- Mark retained ITTs, including L2 pointer arrays, with kmemleak_not_leak().
- Return early on device teardown invalidation failure.
- Inline L1 DTE invalidation and explain the effective EVENTID_BITS.
- Link to v3: https://patch.msgid.link/[email protected]

Changes in v3:
- Rebased onto v7.4-rc3.
- Added Fuad's patch to clean an L2 device table before publishing it.
- Retain the L2 IST and its L1 entry on a mapping timeout, and reject subsequent allocation attempts that would overwrite a pending mapping.
- Retain ITTs when device invalidation times out during registration
or teardown.
- Added L1 DTE invalidation immediately after publishing an L2 device table, keeping single-device invalidations for registration and teardown.
- Reworded the IRS synchronisation and ITS invalidation commit messages
to describe the host issues without relying on future KVM support.
- Collected Acked-by tags and reordered commit trailers as requested.
- Link to v2: https://patch.msgid.link/[email protected]

Changes in v2:
- Explained why IRS synchronisation uses a raw spinlock in the KVM
affinity path.
- Clarified the ITS invalidation race and described the KVM forwarding path.
- Reworked to calculate the device-table size after capping the
DeviceID width.
- Reordered local declarations in the ITS probe function to be in
reverse fir tree order.
- Added Acked-by tags.
- Link to v1: https://patch.msgid.link/[email protected]

---
Fuad Tabba (1):
irqchip/gic-v5: Clean a level 2 device table before making it valid

Sascha Bischoff (12):
irqchip/gic-v5: Reject SPIs not backed by an IRS irqchip/gic-v5: Only set IRS DPS when 1ofN routing is supported irqchip/gic-v5: Serialise IRS synchronisation requests irqchip/gic-v5: Serialise ITS invalidation commands irqchip/gic-v5: Use linear DT and ITT when L2 covers all IDs irqchip/gic-v5: Honour ACPI ITS noncoherent flag irqchip/gic-v5: Use firmware node name in ITS warning irqchip/gic-v5: Invalidate ITS device cache before freeing ITT irqchip/gic-v5: Clean the allocated linear device table size irqchip/gic-v5: Release ITS MMIO region on DT probe failure irqchip/gic-v5: Retain the ITT when device invalidation times out irqchip/gic-v5: Invalidate the L1 DTE when allocating an L2 device table

 drivers/irqchip/irq-gic-v5-irs.c   | 22 +++++++---
 drivers/irqchip/irq-gic-v5-its.c   | 87 +++++++++++++++++++++++++++++++-------
 drivers/irqchip/irq-gic-v5.c       |  9 ++++
 include/linux/irqchip/arm-gic-v5.h |  1 +
 4 files changed, 97 insertions(+), 22 deletions(-)

---
base-commit: b6a9fa34ce4187cb69d3c588a4bbffc31ce5db8f
change-id: 20261102-host_gicv5_fixes-1eeea29d2ea4

Best regards,

Signature · 1 line
Sascha Bischoff <[email protected]>