Skip to content

ANDROID: MPAM policy and arch drivers

System requirements

For MPAM to be usable at EL1, the following requirements must be met:

EL3 needs to:

set MPAM3_EL3.MPAMEN to 1

EL2 needs to:


Assuming Linux is booted at EL2, the patches take care of doing the EL2 setup. EL3 setup is the responsibility of whichever bootloader/firmware you are using (arm-trusted-firmware was used to test this).

Code layout

Architecture feature handling

With one exception in the EL2 setup code (cf. EL2 requirements: System requirements: EL2), all of the MPAM architecture feature handling lives in the mpam_arch.c module.

System validation

The module verifies whether all CPUs in the system support MPAM and have MPAM enabled, and aggregates the minimum usable PARTID count accross all CPUs.

MSC discovery

The MSC platform_driver matches against "arm,mpam-msc" DT entries.

Features are discovered at probe time, and are exposed through the platform_driver's sysfs interface in an "mpam" directory.

Limitations: System-wide cache MSC only. No support for multiple MSCs. (more info available at Limitations)

Devicetree (DT) bindings for MPAM MSC:

Required properties:

  • compatible : expected: "arm,mpam-msc"
  • reg : physical base address and length of the register set


msc@0 {
      compatible = "arm,mpam-msc";
      reg = <0x0 0x30000000 0x0 0x3000>;

MSC configuration

# Default setup with 64 partitions, 16 portions
└── mpam/
    ├── partitions/
    │   ├── 0/
    │   │   └── cpbm -> 0-15
    │   ├── 1/
    │   │   └── cpbm -> 0-15
    │   ...
    │   └── 63/
    │       └── cpbm -> 0-15
    └── cpbm_nbits -> 16

The interface for cache portion partitionning follow the bitmap list format. For instance, the default setup (with default PARTID) for a 16-portion cache is all portions enabled, which shows as:

cat mpam/partitions/0/cpbm

Configuring the portions for a partition follows the same format:

echo 0-7 > mpam/partitions/42/cpbm

echo 8-15 > mpam/partitions/43/cpbm

echo 6,9 > mpam/partitions/44/cpbm

Task : partition mapping

The assignment of a PARTID to a given PID is handled by the mpam_policy.c module.

It creates a mount point at /sys/fs/mpam, and the interface can be mounted via:

mount -t mpam mpam /sys/fs/mpam 
cat /sys/fs/mpam/partitions/0/tasks
echo 141 > /sys/fs/mpam/partitions/1/tasks

Forked tasks inherit their parents' partid, unless SCHED_RESET_ON_FORK is used.

Module dependency

mpam_arch must be loaded before mpam_policy (moddep will enforce this).


  • Assumes MSC features do not change after being read (no locking around accessing MSC data, only accessing the MSC registers)
  • System-wide single MSC support only; no private L2 or multi-cluster (i.e. multiple DSUs) support.


Limited scope of functional validation for both modules have been performed based on a simulated environment setup. The implementation provided is a basic one though, enabling cache portion partitioning only and in no means does it explore full MPAM functionality.

Edited by Beata Michalska

Merge request reports