Skip to content

perf: arm_spe: Support heterogeneous ACPI systems

Johnny.Fan linux-arm-kernel linux-perf-users lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 3 repliesIn review
  2. v21 patch 2 repliesSuperseded
  3. v11 patch 9 repliesSuperseded

Changes in v3 from the cover letter

- Split into two patches: drivers first (no functional change), then the ACPI producer. This keeps every patch bisectable; with the opposite order an intermediate kernel would create devices whose CPU mask falls back to cpu_possible_mask and probe CPUs that do not implement the feature.
- Reject GICC entries with inconsistent lengths instead of silently skipping them, while still treating tables that never describe the field (pre-ACPI 6.3 for SPE, 6.5 for TRBE) as "feature absent".
- Allocate the groups dynamically instead of a possible-CPUs-sized array; the counting pass remains as the firmware consistency check.
- Only release a shared GSI once no successfully registered device uses it, fixing the mapping leak when every group on that GSI fails.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2perf: arm_pmu: Accept a per-device CPU mask from platform datadrivers/hwtracing/coresight/coresight-trbe.c drivers/perf/arm_spe_pmu.c include/linux/perf/arm_pmu.h+38 -40 replies
2/2perf: arm_pmu_acpi: Support heterogeneous ACPI systemsdrivers/perf/arm_pmu_acpi.c+167 -713 replies

Reviews trailers per patch

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

PatchFugang Duan
1/2R-b
2/2R-b

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

Read the v3 thread

Cover letter [PATCH v3 0/2] perf: arm_spe: Support heterogeneous ACPI systems

From: "Johnny.Fan" <[email protected]>

This series makes SPE and TRBE usable on heterogeneous ACPI systems, where not all CPUs implement the feature and the ones that do may use different PPIs. The MADT describes both per CPU, and the PPTT hetero id tells identical implementations apart.

Patch 1 lets the drivers take the CPU mask from platform data; patch 2 creates one platform device per (hetero id, interrupt) group and passes the mask along.

v2: https://lore.kernel.org/all/[email protected]/

Changes since v2:
- Split into two patches: drivers first (no functional change), then the ACPI producer. This keeps every patch bisectable; with the opposite order an intermediate kernel would create devices whose CPU mask falls back to cpu_possible_mask and probe CPUs that do not implement the feature.
- Reject GICC entries with inconsistent lengths instead of silently skipping them, while still treating tables that never describe the field (pre-ACPI 6.3 for SPE, 6.5 for TRBE) as "feature absent".
- Allocate the groups dynamically instead of a possible-CPUs-sized array; the counting pass remains as the firmware consistency check.
- Only release a shared GSI once no successfully registered device uses it, fixing the mapping leak when every group on that GSI fails.

On Leo's question about exposing the mask through platform_get_irq_affinity(): these devices are synthetic and have no fwnode, so the lookup falls back to cpu_possible_mask. The mask is a property of the device, not of the interrupt: a GSI can be shared by groups with disjoint CPU masks, so a per-interrupt affinity would be wrong for each of them. ACPI cannot describe PPI affinity today anyway.

Johnny.Fan (2):
perf: arm_pmu: Accept a per-device CPU mask from platform data
perf: arm_pmu_acpi: Support heterogeneous ACPI systems

 drivers/hwtracing/coresight/coresight-trbe.c |  22 +-
 drivers/perf/arm_pmu_acpi.c                  | 238 +++++++++++++------
 drivers/perf/arm_spe_pmu.c                   |  10 +-
 include/linux/perf/arm_pmu.h                 |  10 +
 4 files changed, 205 insertions(+), 75 deletions(-)

--
2.55.0