Skip to content

arm_mpam: Add basic mpam driver

James Morse linux-acpi linux-arm-kernel linux-devicetree lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest33 patches 132 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/33cacheinfo: Expose the code to generate a cache-id from a device_nodedrivers/base/cacheinfo.c include/linux/cacheinfo.h+14 -63 replies
1/33cacheinfo: Expose the code to generate a cache-id from a device_nodedrivers/base/cacheinfo.c include/linux/cacheinfo.h+14 -60 replies
2/33drivers: base: cacheinfo: Add helper to find the cache size from cpu+levelinclude/linux/cacheinfo.h+15 -06 replies
2/33drivers: base: cacheinfo: Add helper to find the cache size from cpu+levelinclude/linux/cacheinfo.h+15 -00 replies
3/33ACPI / PPTT: Add a helper to fill a cpumask from a processor containerdrivers/acpi/pptt.c include/linux/acpi.h+89 -06 replies
3/33ACPI / PPTT: Add a helper to fill a cpumask from a processor containerdrivers/acpi/pptt.c include/linux/acpi.h+89 -00 replies
4/33ACPI / PPTT: Stop acpi_count_levels() expecting callers to clear levelsdrivers/acpi/pptt.c+11 -73 replies
4/33ACPI / PPTT: Stop acpi_count_levels() expecting callers to clear levelsdrivers/acpi/pptt.c+11 -72 replies
5/33ACPI / PPTT: Find cache level by cache-iddrivers/acpi/pptt.c include/linux/acpi.h+81 -08 replies
5/33ACPI / PPTT: Find cache level by cache-iddrivers/acpi/pptt.c include/linux/acpi.h+81 -00 replies
6/33ACPI / PPTT: Add a helper to fill a cpumask from a cache_iddrivers/acpi/pptt.c include/linux/acpi.h+68 -04 replies
6/33ACPI / PPTT: Add a helper to fill a cpumask from a cache_iddrivers/acpi/pptt.c include/linux/acpi.h+68 -02 replies
7/33arm64: kconfig: Add Kconfig entry for MPAMarch/arm64/Kconfig+17 -06 replies
7/33arm64: kconfig: Add Kconfig entry for MPAMarch/arm64/Kconfig+17 -00 replies
8/33ACPI / MPAM: Parse the MPAM tablearch/arm64/Kconfig drivers/acpi/arm64/Kconfig drivers/acpi/arm64/Makefile +3 more+383 -16 replies
8/33ACPI / MPAM: Parse the MPAM tablearch/arm64/Kconfig drivers/acpi/arm64/Kconfig drivers/acpi/arm64/Makefile +3 more+383 -12 replies
9/33dt-bindings: arm: Add MPAM MSC bindingDocumentation/devicetree/bindings/arm/arm,mpam-msc.yaml+200 -03 replies
9/33dt-bindings: arm: Add MPAM MSC bindingDocumentation/devicetree/bindings/arm/arm,mpam-msc.yaml+200 -00 replies
10/33arm_mpam: Add probe/remove for mpam msc driver and kbuild boiler platearch/arm64/Kconfig drivers/Kconfig drivers/Makefile +4 more+417 -016 replies
10/33arm_mpam: Add probe/remove for mpam msc driver and kbuild boiler platearch/arm64/Kconfig drivers/Kconfig drivers/Makefile +4 more+417 -02 replies
11/33arm_mpam: Add support for memory controller MSC on DT platformsdrivers/resctrl/mpam_devices.c+47 -200 replies
11/33arm_mpam: Add support for memory controller MSC on DT platformsdrivers/resctrl/mpam_devices.c+47 -202 replies
12/33arm_mpam: Add the class and component structures for ris firmware describeddrivers/resctrl/mpam_devices.c drivers/resctrl/mpam_internal.h include/linux/arm_mpam.h+574 -136 replies
12/33arm_mpam: Add the class and component structures for ris firmware describeddrivers/resctrl/mpam_devices.c drivers/resctrl/mpam_internal.h include/linux/arm_mpam.h+574 -134 replies
13/33arm_mpam: Add MPAM MSC register layout definitionsdrivers/resctrl/mpam_internal.h+266 -04 replies
13/33arm_mpam: Add MPAM MSC register layout definitionsdrivers/resctrl/mpam_internal.h+266 -00 replies
14/33arm_mpam: Add cpuhp callbacks to probe MSC hardwaredrivers/resctrl/mpam_devices.c drivers/resctrl/mpam_internal.h+147 -55 replies
14/33arm_mpam: Add cpuhp callbacks to probe MSC hardwaredrivers/resctrl/mpam_devices.c drivers/resctrl/mpam_internal.h+147 -50 replies
15/33arm_mpam: Probe MSCs to find the supported partid/pmg valuesdrivers/resctrl/mpam_devices.c drivers/resctrl/mpam_internal.h include/linux/arm_mpam.h+171 -75 replies
15/33arm_mpam: Probe MSCs to find the supported partid/pmg valuesdrivers/resctrl/mpam_devices.c drivers/resctrl/mpam_internal.h include/linux/arm_mpam.h+171 -70 replies
16/33arm_mpam: Add helpers for managing the locking around the mon_sel registersdrivers/resctrl/mpam_internal.h+56 -14 replies
16/33arm_mpam: Add helpers for managing the locking around the mon_sel registersdrivers/resctrl/mpam_internal.h+56 -10 replies
17/33arm_mpam: Probe the hardware features resctrl supportsdrivers/resctrl/mpam_devices.c drivers/resctrl/mpam_internal.h+209 -13 replies
17/33arm_mpam: Probe the hardware features resctrl supportsdrivers/resctrl/mpam_devices.c drivers/resctrl/mpam_internal.h+209 -10 replies
18/33arm_mpam: Merge supported features during mpam_enable() into mpam_classdrivers/resctrl/mpam_devices.c drivers/resctrl/mpam_internal.h+223 -02 replies
18/33arm_mpam: Merge supported features during mpam_enable() into mpam_classdrivers/resctrl/mpam_devices.c drivers/resctrl/mpam_internal.h+223 -00 replies
19/33arm_mpam: Reset MSC controls from cpu hp callbacksdrivers/resctrl/mpam_devices.c drivers/resctrl/mpam_internal.h+129 -02 replies
19/33arm_mpam: Reset MSC controls from cpu hp callbacksdrivers/resctrl/mpam_devices.c drivers/resctrl/mpam_internal.h+129 -00 replies
20/33arm_mpam: Add a helper to touch an MSC from any CPUdrivers/resctrl/mpam_devices.c+34 -32 replies
20/33arm_mpam: Add a helper to touch an MSC from any CPUdrivers/resctrl/mpam_devices.c+34 -30 replies
21/33arm_mpam: Extend reset logic to allow devices to be reset any timedrivers/resctrl/mpam_devices.c drivers/resctrl/mpam_internal.h+61 -22 replies
21/33arm_mpam: Extend reset logic to allow devices to be reset any timedrivers/resctrl/mpam_devices.c drivers/resctrl/mpam_internal.h+61 -20 replies
22/33arm_mpam: Register and enable IRQsdrivers/resctrl/mpam_devices.c drivers/resctrl/mpam_internal.h+312 -81 reply
22/33arm_mpam: Register and enable IRQsdrivers/resctrl/mpam_devices.c drivers/resctrl/mpam_internal.h+312 -81 reply
23/33arm_mpam: Use a static key to indicate when mpam is enableddrivers/resctrl/mpam_devices.c drivers/resctrl/mpam_internal.h+16 -00 replies
23/33arm_mpam: Use a static key to indicate when mpam is enableddrivers/resctrl/mpam_devices.c drivers/resctrl/mpam_internal.h+16 -00 replies
24/33arm_mpam: Allow configuration to be applied and restored during cpu onlinedrivers/resctrl/mpam_devices.c drivers/resctrl/mpam_internal.h+251 -282 replies
24/33arm_mpam: Allow configuration to be applied and restored during cpu onlinedrivers/resctrl/mpam_devices.c drivers/resctrl/mpam_internal.h+251 -280 replies
25/33arm_mpam: Probe and reset the rest of the featuresdrivers/resctrl/mpam_devices.c drivers/resctrl/mpam_internal.h+189 -22 replies
25/33arm_mpam: Probe and reset the rest of the featuresdrivers/resctrl/mpam_devices.c drivers/resctrl/mpam_internal.h+189 -20 replies
26/33arm_mpam: Add helpers to allocate monitorsdrivers/resctrl/mpam_devices.c drivers/resctrl/mpam_internal.h+37 -01 reply
26/33arm_mpam: Add helpers to allocate monitorsdrivers/resctrl/mpam_devices.c drivers/resctrl/mpam_internal.h+37 -00 replies
27/33arm_mpam: Add mpam_msmon_read() to read monitor valuedrivers/resctrl/mpam_devices.c drivers/resctrl/mpam_internal.h+240 -02 replies
27/33arm_mpam: Add mpam_msmon_read() to read monitor valuedrivers/resctrl/mpam_devices.c drivers/resctrl/mpam_internal.h+240 -00 replies
28/33arm_mpam: Track bandwidth counter state for overflow and power managementdrivers/resctrl/mpam_devices.c drivers/resctrl/mpam_internal.h+200 -171 reply
28/33arm_mpam: Track bandwidth counter state for overflow and power managementdrivers/resctrl/mpam_devices.c drivers/resctrl/mpam_internal.h+200 -172 replies
29/33arm_mpam: Probe for long/lwd mbwu countersdrivers/resctrl/mpam_devices.c drivers/resctrl/mpam_internal.h+30 -12 replies
29/33arm_mpam: Probe for long/lwd mbwu countersdrivers/resctrl/mpam_devices.c drivers/resctrl/mpam_internal.h+30 -10 replies
30/33arm_mpam: Use long MBWU counters if supporteddrivers/resctrl/mpam_devices.c+80 -92 replies
30/33arm_mpam: Use long MBWU counters if supporteddrivers/resctrl/mpam_devices.c+80 -90 replies
31/33arm_mpam: Add helper to reset saved mbwu statedrivers/resctrl/mpam_devices.c drivers/resctrl/mpam_internal.h+51 -30 replies
31/33arm_mpam: Add helper to reset saved mbwu statedrivers/resctrl/mpam_devices.c drivers/resctrl/mpam_internal.h+51 -30 replies
32/33arm_mpam: Add kunit test for bitmap resetdrivers/resctrl/Kconfig drivers/resctrl/mpam_devices.c drivers/resctrl/test_mpam_devices.c+85 -02 replies
32/33arm_mpam: Add kunit test for bitmap resetdrivers/resctrl/Kconfig drivers/resctrl/mpam_devices.c drivers/resctrl/test_mpam_devices.c+85 -00 replies
33/33arm_mpam: Add kunit tests for props_mismatch()drivers/resctrl/mpam_internal.h drivers/resctrl/test_mpam_devices.c+329 -12 replies
33/33arm_mpam: Add kunit tests for props_mismatch()drivers/resctrl/mpam_internal.h drivers/resctrl/test_mpam_devices.c+329 -11 reply

Reviews trailers per patch

20 of 66 patches have a Reviewed-by or Acked-by.

PatchSudeep HollaJonathan CameronRohit MathewBen HorganLorenzo Pieralisi
1/33
1/33
2/33
2/33
3/33R-b R-b
3/33R-b R-b
4/33R-b
4/33R-b
5/33
5/33
6/33R-b R-b R-b
6/33R-b R-b R-b
7/33R-b R-b
7/33R-b R-b
8/33
8/33
9/33
9/33
10/33
10/33
11/33
11/33
12/33
12/33
13/33R-b
13/33R-b
14/33
14/33
15/33
15/33
16/33
16/33
17/33
17/33
18/33R-b
18/33R-b
19/33
19/33
20/33R-b
20/33R-b
21/33
21/33
22/33T-b T-b
22/33T-b T-b
23/33
23/33
24/33
24/33
25/33
25/33
26/33R-b
26/33R-b
27/33
27/33
28/33
28/33
29/33R-b
29/33R-b
30/33R-b
30/33R-b
31/33
31/33
32/33
32/33
33/33
33/33

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.

Read the v1 thread

Cover letter [PATCH 00/33] arm_mpam: Add basic mpam driver

Hello,

This is just enough MPAM driver for the ACPI and DT pre-requisites. It doesn't contain any of the resctrl code, meaning you can't actually drive it from user-space yet. Becuase of that, its hidden behind CONFIG_EXPERT. This will change once the user interface is connected up.

This is the initial group of patches that allows the resctrl code to be built on top. Including that will increase the number of trees that may need to coordinate, so breaking it up make sense.

The locking looks very strange - but is influenced by the 'mpam-fb' firmware interface specification that is still alpha. That thing needs to wait for an interrupt after every system register write, which significantly impacts the driver. Some features just won't work, e.g. reading the monitor registers via perf.
The aim is to not have to make invasive changes to the locking to support the firmware interface, hence it looks strange from day-1.

I've not found a platform that can test all the behaviours around the monitors, so this is where I'd expect the most bugs.

The MPAM spec that describes all the system and MMIO registers can be found here:
https://developer.arm.com/documentation/ddi0598/db/?lang=en
(Ignored the 'RETIRED' warning - that is just arm moving the documentation around.
This document has the best overview)

The expectation is this will go via the arm64 tree.

This series is based on v6.17-rc2, and can be retrieved from:
https://git.kernel.org/pub/scm/linux/kernel/git/morse/linux.git mpam/driver/rv1

The rest of the driver can be found here:
https://git.kernel.org/pub/scm/linux/kernel/git/morse/linux.git mpam/snapshot/v6.17-rc2

What is MPAM? Set your time-machine to 2020:
https://lore.kernel.org/lkml/[email protected]/

This series was previously posted here:
[RFC] lore.kernel.org/r/[email protected]

Bugs welcome,
Thanks,

James Morse (29):
cacheinfo: Expose the code to generate a cache-id from a device_node
drivers: base: cacheinfo: Add helper to find the cache size from
cpu+level
ACPI / PPTT: Add a helper to fill a cpumask from a processor container ACPI / PPTT: Stop acpi_count_levels() expecting callers to clear
levels
ACPI / PPTT: Find cache level by cache-id
ACPI / PPTT: Add a helper to fill a cpumask from a cache_id
arm64: kconfig: Add Kconfig entry for MPAM
ACPI / MPAM: Parse the MPAM table
arm_mpam: Add probe/remove for mpam msc driver and kbuild boiler plate
arm_mpam: Add the class and component structures for ris firmware
described
arm_mpam: Add MPAM MSC register layout definitions
arm_mpam: Add cpuhp callbacks to probe MSC hardware
arm_mpam: Probe MSCs to find the supported partid/pmg values
arm_mpam: Add helpers for managing the locking around the mon_sel
registers
arm_mpam: Probe the hardware features resctrl supports
arm_mpam: Merge supported features during mpam_enable() into
mpam_class
arm_mpam: Reset MSC controls from cpu hp callbacks
arm_mpam: Add a helper to touch an MSC from any CPU
arm_mpam: Extend reset logic to allow devices to be reset any time
arm_mpam: Register and enable IRQs
arm_mpam: Use a static key to indicate when mpam is enabled
arm_mpam: Allow configuration to be applied and restored during cpu
online
arm_mpam: Probe and reset the rest of the features
arm_mpam: Add helpers to allocate monitors
arm_mpam: Add mpam_msmon_read() to read monitor value
arm_mpam: Track bandwidth counter state for overflow and power
management
arm_mpam: Add helper to reset saved mbwu state
arm_mpam: Add kunit test for bitmap reset
arm_mpam: Add kunit tests for props_mismatch()

Rob Herring (1):
dt-bindings: arm: Add MPAM MSC binding

Rohit Mathew (2):
arm_mpam: Probe for long/lwd mbwu counters
arm_mpam: Use long MBWU counters if supported

Shanker Donthineni (1):
arm_mpam: Add support for memory controller MSC on DT platforms

 .../devicetree/bindings/arm/arm,mpam-msc.yaml |  200 ++
 arch/arm64/Kconfig                            |   19 +
 drivers/Kconfig                               |    2 +
 drivers/Makefile                              |    1 +
 drivers/acpi/arm64/Kconfig                    |    3 +
 drivers/acpi/arm64/Makefile                   |    1 +
 drivers/acpi/arm64/mpam.c                     |  331 ++
 drivers/acpi/pptt.c                           |  230 +-
 drivers/acpi/tables.c                         |    2 +-
 drivers/base/cacheinfo.c                      |   19 +-
 drivers/resctrl/Kconfig                       |   24 +
 drivers/resctrl/Makefile                      |    4 +
 drivers/resctrl/mpam_devices.c                | 2909 +++++++++++++++++
 drivers/resctrl/mpam_internal.h               |  692 ++++
 drivers/resctrl/test_mpam_devices.c           |  390 +++
 include/linux/acpi.h                          |   26 +
 include/linux/arm_mpam.h                      |   56 +
 include/linux/cacheinfo.h                     |   16 +
 18 files changed, 4911 insertions(+), 14 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arm/arm,mpam-msc.yaml
 create mode 100644 drivers/acpi/arm64/mpam.c
 create mode 100644 drivers/resctrl/Kconfig
 create mode 100644 drivers/resctrl/Makefile
 create mode 100644 drivers/resctrl/mpam_devices.c
 create mode 100644 drivers/resctrl/mpam_internal.h
 create mode 100644 drivers/resctrl/test_mpam_devices.c
 create mode 100644 include/linux/arm_mpam.h
Signature · 1 line
2.20.1