xen/arm: gicv3: defer host LPI init and split ITS/LPI quirk scopes
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v4 Latest4 patches 7 repliesIn review
- v34 patches 11 repliesSuperseded
Changes in v4 from the cover letter
* Move the empty ITS list check before the preparation loop.
* Calculate the table entry count and select the table type inside its_map_baser(). Keep the ITS/LPI quirks handling comment above the shared helpers.
* Use BUG_ON() for a missing match callback or missing IIDR match data. Keep the existing quirks variable name in gicv3_its_find_quirk().
---
Patches in v4 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | xen/arm: its: initialize host LPI state before activating ITSesxen/ xen/ xen/ | +31 | 2 replies | |
| 2/4 | xen/arm: its: separate ITS and host LPI quirk scopesxen/ xen/ xen/ | +118 | 2 replies | |
| 3/4 | xen/arm: its: refactor ITS quirk matchingxen/ | +52 | 2 replies | |
| 4/4 | xen/arm: its: handle dma-noncoherent on GIC and ITS nodesxen/ xen/ | +36 | 1 reply |
Reviews trailers per patch
All 4 patches have a Reviewed-by or Acked-by.
| Patch | Volodymyr Babchuk | Michal Orzel |
|---|---|---|
| 1/4 | R-b | R-b |
| 2/4 | R-b | R-b |
| 3/4 | R-b | R-b |
| 4/4 | R-b | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v4 0/4] xen/arm: gicv3: defer host LPI init and split ITS/LPI quirk scopes
Hi all,
This series reworks ITS and host LPI initialization, separates ITS-private memory restrictions from host LPI/Redistributor restrictions, and adds support for the DT dma-noncoherent property.
Patch 1 splits ITS initialization into preparation and activation phases. The preparation pass maps and disables each host ITS and collects its quirks. Once all host ITSes have been prepared, host LPI state is initialized, including the boot CPU pending table. Only then are ITS tables and command queues allocated and programmed, and the ITSes enabled. This sequence is coordinated within gicv3_its_init().
The subsequent gicv3_cpu_init() sequence remains unchanged: it programs the Redistributor LPI table registers, enables LPIs, and submits the first MAPC and SYNC commands.
Patch 2 replaces the global ITS quirk state with per-ITS flags and a separate host LPI policy. Per-ITS flags govern ITS table, command queue, and ITT allocations, and the memory attributes programmed into GITS_CBASER and GITS_BASER<n>. Host LPI flags govern property and pending table allocations and the attributes programmed into GICR_PROPBASER and GICR_PENDBASER.
An ITS-discovered quirk contributes to host LPI policy only through its explicit lpi_flags. Per-ITS flags are not implicitly aggregated into that policy, and different ITSes no longer have to share the same quirk state.
Patch 3 replaces the fixed IIDR/mask fields in the quirk table with a match(hw_its, data) callback and an opaque data pointer. A reusable IIDR matcher is combined with platform checks for the R-Car Gen4 entry. First-match semantics are preserved.
The R-Car Gen4 entry matches only DT-discovered ITSes with IIDR 0x0201743b on machines compatible with renesas,r8a779f0 or renesas,r8a779g0. ACPI-discovered ITSes and other platforms with the same IIDR no longer match this entry. For matching systems, the non-cacheable/non-shareable attributes and 32-bit allocation restrictions are retained in both the ITS and host LPI scopes.
Patch 4 handles dma-noncoherent independently of platform quirk matching. A property on an ITS subnode affects only that ITS. A property on the top-level GIC node affects only host LPI/Redistributor policy. The property is not inherited between the nodes. It selects non-cacheable/non-shareable memory attributes; it does not impose a 32-bit allocation restriction.
---
Changes since v3
* Move the empty ITS list check before the preparation loop.
* Calculate the table entry count and select the table type inside its_map_baser(). Keep the ITS/LPI quirks handling comment above the shared helpers.
* Use BUG_ON() for a missing match callback or missing IIDR match data. Keep the existing quirks variable name in gicv3_its_find_quirk().
---
Changes since v2
* Split ITS initialization into preparation and activation phases, with host LPI initialization between them inside gicv3_its_init().
* Collected quirk flags during ITS preparation. Kept the ITS init-only annotations in the initialization patch.
* Documented the intentional narrowing of the R-Car Gen4 match, including the exclusion of ACPI-discovered ITSes and other platforms with the same IIDR.
* Added the non-debug NULL-data guard to the IIDR matcher and placed the matcher data and quirk table in init-only read-only sections.
* Dropped the redundant aggregate host-LPI-flags log message
---
Changes since v1
* Reordered the series so that the minimal host LPI initialization ordering fix was first. In v2, patch 1 was intended for 4.22.
* Dropped the v1 ITS pre-initialization hook.
* Moved the existing gicv3_lpi_init_host_lpis() call after gicv3_its_init() instead, so host LPI state is allocated after ITS workaround discovery.
* Checked the return value from gicv3_lpi_init_host_lpis() and made failure fatal once the ITS/LPI path is enabled.
* Replaced the old single global ITS quirk state with separate per-ITS and host LPI quirk scopes.
* Removed the implicit aggregation of all per-ITS quirks into the host LPI policy. Host LPI effects are now expressed explicitly with lpi_flags.
* Kept per-ITS flags for ITS-private allocations:
- GITS_CBASER;
- GITS_BASER<n>;
- ITT memory.
* Kept host LPI flags for Redistributor/LPI state:
- GICR_PROPBASER;
- GICR_PENDBASER.
* Refactored ITS quirk matching from fixed IIDR/mask fields to a generic match(hw_its, data) callback plus opaque data.
* Kept first-match semantics explicit. More specific entries must be listed before broader IIDR-only entries.
* Added a reusable IIDR matcher and used it after checking the Renesas machine compatibles for the R-Car Gen4 quirk.
* Split dma-noncoherent handling by DT node scope:
- ITS subnode dma-noncoherent affects only the matching ITS;
- top-level GIC dma-noncoherent affects only the host LPI/Redistributor policy.
* Dropped the Orange Pi 5 / RK3588-specific quirk patch from v1. The non-coherent GIC integration is now handled through DT dma-noncoherent properties instead of a Xen-side platform quirk.
Mykola Kvach (4):
xen/arm: its: initialize host LPI state before activating ITSes xen/arm: its: separate ITS and host LPI quirk scopes xen/arm: its: refactor ITS quirk matching
xen/arm: its: handle dma-noncoherent on GIC and ITS nodes
xen/arch/arm/gic-v3-its.c | 233 ++++++++++++++++---------- xen/arch/arm/gic-v3-lpi.c | 65 ++++++- xen/arch/arm/gic-v3.c | 15 +- xen/arch/arm/include/asm/gic_v3_its.h | 23 ++- 4 files changed, 222 insertions(+), 114 deletions(-)
Signature · 1 line
2.53.0