mirror-linux/drivers/base
James Morse 9a697eff25 cacheinfo: Add arch hook to compress CPU h/w id into 32 bits for cache-id
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 CPU h/w id of the
CPUs associated with that cache.

CPU h/w ids may be larger than 32 bits.

Add a hook to allow architectures to compress the value from the devicetree
into 32 bits. Returning the same value is always safe as cache_of_set_id()
will stop if a value larger than 32 bits is seen.

For example, on arm64 the value is the MPIDR affinity register, which only
has 32 bits of affinity data, but spread accross the 64 bit field. An
arch-specific bit swizzle gives a 32 bit value.

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-3-james.morse@arm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-07-16 15:04:27 +02:00
..
firmware_loader sysfs: treewide: switch back to attribute_group::bin_attrs 2025-06-17 10:44:15 +02:00
power driver core: Add device_link_test() for testing device link flags 2025-06-17 10:57:56 +02:00
regmap regmap: get rid of redundant debugfs_file_{get,put}() 2025-07-09 13:30:28 +02:00
test drivers: base: test: Add ...find_device_by...(... NULL) tests 2024-12-24 09:48:09 +01:00
Kconfig arch_numa: switch over to numa_memblks 2024-09-03 21:15:32 -07:00
Makefile driver core: add a faux bus for use when a simple device/bus is needed 2025-02-13 16:58:51 +01:00
arch_numa.c arch_numa: Restore nid checks before registering a memblock with a node 2024-12-01 22:04:52 +02:00
arch_topology.c arch_topology: Relocate cpu_scale to topology.[h|c] 2025-05-07 21:56:55 +02:00
attribute_container.c driver core: attribute_container: Remove unused functions 2024-09-13 15:41:42 +02:00
auxiliary.c driver core: auxiliary bus: fix OF node leak 2025-07-16 13:40:39 +02:00
auxiliary_sysfs.c driver core: auxiliary bus: show auxiliary device IRQs 2024-07-11 14:17:03 -07:00
base.h driver core: fix potential NULL pointer dereference in dev_uevent() 2025-04-15 17:04:35 +02:00
bus.c driver core: fix potential NULL pointer dereference in dev_uevent() 2025-04-15 17:04:35 +02:00
cacheinfo.c cacheinfo: Add arch hook to compress CPU h/w id into 32 bits for cache-id 2025-07-16 15:04:27 +02:00
class.c drivers: core: remove device_link argument from class_compat_[create|remove]_link 2025-01-10 15:42:20 +01:00
component.c component: do not try to unbind unbound components 2025-04-15 18:05:40 +02:00
container.c driver core: container: make container_subsys const 2023-12-21 13:56:10 +01:00
core.c driver core: Add device_link_test() for testing device link flags 2025-06-17 10:57:56 +02:00
cpu.c Merge commit 'its-for-linus-20250509-merge' into x86/core, to resolve conflicts 2025-05-13 10:47:10 +02:00
dd.c driver core: introduce device_set_driver() helper 2025-04-15 17:04:35 +02:00
devcoredump.c sysfs: treewide: switch back to attribute_group::bin_attrs 2025-06-17 10:44:15 +02:00
devres.c Immutable tag for the driver core tree to pull from 2025-04-28 10:18:29 +02:00
devtmpfs.c devtmpfs: don't use vfs_getattr_nosec to query i_mode 2025-04-25 12:11:45 +02:00
driver.c driver core: Introduce device_iter_t for device iterating APIs 2025-01-10 15:26:12 +01:00
faux.c driver core: faux: Quiet probe failures 2025-06-10 19:23:25 +02:00
firmware.c
hypervisor.c
init.c driver core: add a faux bus for use when a simple device/bus is needed 2025-02-13 16:58:51 +01:00
isa.c driver core: have match() callback in struct bus_type take a const * 2024-07-03 15:16:54 +02:00
map.c
memory.c memory: implement memory_block_advise/probe_max_size 2025-05-11 17:48:07 -07:00
module.c drivers: base: handle module_kobject creation 2025-04-16 15:10:55 +02:00
node.c sysfs: treewide: switch back to attribute_group::bin_attrs 2025-06-17 10:44:15 +02:00
physical_location.c driver core: location: Use str_yes_no() helper function 2025-02-21 09:20:30 +01:00
physical_location.h
pinctrl.c
platform-msi.c platform-msi: Add msi_remove_device_irq_domain() in platform_device_msi_free_irqs_all() 2025-05-07 17:49:00 +02:00
platform.c Merge 6.15-rc6 into driver-core-next 2025-05-12 14:16:34 +02:00
property.c Char/Misc/IIO pull request for 6.16-rc1 2025-06-06 11:50:47 -07:00
soc.c driver core: mark remaining local bus_type variables as const 2023-12-21 13:56:30 +01:00
swnode.c Linux 6.15-rc4 2025-04-28 09:51:34 +02:00
syscore.c
topology.c sysfs: treewide: switch back to attribute_group::bin_attrs 2025-06-17 10:44:15 +02:00
trace.c
trace.h devres: Fix page faults when tracing devres from unloaded modules 2024-10-14 08:21:09 +02:00
transport_class.c