mirror-linux/arch
James Morse cbf218627d arm64: cacheinfo: Provide helper to compress MPIDR value into u32
Filesystems like resctrl use the cache-id exposed via sysfs to identify
groups of CPUs. The value is also used for PCIe cache steering tags. On
DT platforms cache-id is not something that is described in the
device-tree, but instead generated from the smallest MPIDR of the CPUs
associated with that cache. The cache-id exposed to user-space has
historically been 32 bits.

MPIDR values may be larger than 32 bits.

MPIDR only has 32 bits worth of affinity data, but the aff3 field lives
above 32bits. The corresponding lower bits are masked out by
MPIDR_HWID_BITMASK and contain an SMT flag and Uni-Processor flag.

Swizzzle the aff3 field into the bottom 32 bits and using that.

In case more affinity fields are added in the future, the upper RES0
area should be checked. Returning a value greater than 32 bits from
this helper will cause the caller to give up on allocating cache-ids.

Signed-off-by: James Morse <james.morse@arm.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Reviewed-by: Gavin Shan <gshan@redhat.com>
Link: https://lore.kernel.org/r/20250711182743.30141-4-james.morse@arm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-07-16 15:04:31 +02:00
..
alpha mm: pgtable: fix pte_swp_exclusive 2025-06-11 14:52:08 -07:00
arc ARC fixes for 6.16 2025-06-12 08:17:56 -07:00
arm mm: pgtable: fix pte_swp_exclusive 2025-06-11 14:52:08 -07:00
arm64 arm64: cacheinfo: Provide helper to compress MPIDR value into u32 2025-07-16 15:04:31 +02:00
csky mm: pgtable: fix pte_swp_exclusive 2025-06-11 14:52:08 -07:00
hexagon mm: pgtable: fix pte_swp_exclusive 2025-06-11 14:52:08 -07:00
loongarch mm: pgtable: fix pte_swp_exclusive 2025-06-11 14:52:08 -07:00
m68k mm: pgtable: fix pte_swp_exclusive 2025-06-11 14:52:08 -07:00
microblaze mm: pgtable: fix pte_swp_exclusive 2025-06-11 14:52:08 -07:00
mips mm: pgtable: fix pte_swp_exclusive 2025-06-11 14:52:08 -07:00
nios2 mm: pgtable: fix pte_swp_exclusive 2025-06-11 14:52:08 -07:00
openrisc mm: pgtable: fix pte_swp_exclusive 2025-06-11 14:52:08 -07:00
parisc mm: pgtable: fix pte_swp_exclusive 2025-06-11 14:52:08 -07:00
powerpc Merge 6.16-rc3 into driver-core-next 2025-06-23 07:53:36 +02:00
riscv RISC-V: KVM: Don't treat SBI HFENCE calls as NOPs 2025-06-17 10:18:40 +05:30
s390 Merge 6.16-rc3 into driver-core-next 2025-06-23 07:53:36 +02:00
sh mm: pgtable: fix pte_swp_exclusive 2025-06-11 14:52:08 -07:00
sparc mm: pgtable: fix pte_swp_exclusive 2025-06-11 14:52:08 -07:00
um mm: pgtable: fix pte_swp_exclusive 2025-06-11 14:52:08 -07:00
x86 Merge 6.16-rc3 into driver-core-next 2025-06-23 07:53:36 +02:00
xtensa mm: pgtable: fix pte_swp_exclusive 2025-06-11 14:52:08 -07:00
.gitignore
Kconfig fs/resctrl: Add boiler plate for external resctrl code 2025-05-16 11:05:40 +02:00