linux-stable/drivers/base
Pierre Gondois 23c33cc4f0 cacheinfo: Check sib_leaf in cache_leaves_are_shared()
[ Upstream commit 7a306e3eab ]

If there is no ACPI/DT information, it is assumed that L1 caches
are private and L2 (and higher) caches are shared. A cache is
'shared' between two CPUs if it is accessible from these two
CPUs.

Each CPU owns a representation (i.e. has a dedicated cacheinfo struct)
of the caches it has access to. cache_leaves_are_shared() tries to
identify whether two representations are designating the same actual
cache.

In cache_leaves_are_shared(), if 'this_leaf' is a L2 cache (or higher)
and 'sib_leaf' is a L1 cache, the caches are detected as shared as
only this_leaf's cache level is checked.
This is leads to setting sib_leaf as being shared with another CPU,
which is incorrect as this is a L1 cache.

Check 'sib_leaf->level'. Also update the comment as the function is
called when populating 'shared_cpu_map'.

Fixes: f16d1becf9 ("cacheinfo: Use cache identifiers to check if the caches are shared if available")
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20230414081453.244787-2-pierre.gondois@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-05-11 23:11:22 +09:00
..
firmware_loader Kbuild updates for v6.2 2022-12-19 12:33:32 -06:00
power PM: domains: fix memory leak with using debugfs_lookup() 2023-03-10 09:29:12 +01:00
regmap regmap: apply reg_base and reg_downshift for single register ops 2023-03-10 09:28:36 +01:00
test driver core: Fix test_async_probe_init saves device in wrong array 2023-01-19 17:27:36 +01:00
Kconfig devtmpfs: mount with noexec and nosuid 2021-12-30 13:54:42 +01:00
Makefile genirq: Get rid of GENERIC_MSI_IRQ_DOMAIN 2022-11-17 15:15:20 +01:00
arch_numa.c mm: percpu: add generic pcpu_populate_pte() function 2022-01-20 08:52:52 +02:00
arch_topology.c RISC-V Patches for the 6.1 Merge Window, Part 1 2022-10-09 13:24:01 -07:00
attribute_container.c
auxiliary.c Documentation/auxiliary_bus: Move the text into the code 2021-12-03 16:41:50 +01:00
base.h driver core: mark driver_allows_async_probing static 2022-11-10 18:31:04 +01:00
bus.c kobject: kset_uevent_ops: make filter() callback take a const * 2022-11-22 17:34:46 +01:00
cacheinfo.c cacheinfo: Check sib_leaf in cache_leaves_are_shared() 2023-05-11 23:11:22 +09:00
class.c kobject: make kobject_get_ownership() take a constant kobject * 2022-11-22 17:34:29 +01:00
component.c drivers: base: component: fix memory leak with using debugfs_lookup() 2023-03-11 13:50:45 +01:00
container.c
core.c driver core: fw_devlink: Avoid spurious error message 2023-03-10 09:29:22 +01:00
cpu.c tick/nohz: Fix cpu_is_hotpluggable() by checking with nohz subsystem 2023-05-11 23:10:51 +09:00
dd.c driver core: Don't require dynamic_debug for initcall_debug probe timing 2023-05-01 08:29:23 +09:00
devcoredump.c devcoredump : Serialize devcd_del work 2022-09-24 14:01:40 +02:00
devres.c devres: Use kmalloc_size_roundup() to match ksize() usage 2022-11-09 15:11:46 +01:00
devtmpfs.c devtmpfs: fix the dangling pointer of global devtmpfsd thread 2022-06-27 16:41:13 +02:00
driver.c driver core: fix driver_set_override() issue with empty strings 2022-09-05 13:01:34 +02:00
firmware.c
hypervisor.c
init.c init: Initialize noop_backing_dev_info early 2022-06-16 10:55:57 +02:00
isa.c bus: Make remove callback return void 2021-07-21 11:53:42 +02:00
map.c driver: base: Prefer unsigned int to bare use of unsigned 2021-07-21 17:30:09 +02:00
memory.c mm/hwpoison: introduce per-memory_block hwpoison counter 2022-11-08 17:37:22 -08:00
module.c
node.c - Yu Zhao's Multi-Gen LRU patches are here. They've been under test in 2022-10-10 17:53:04 -07:00
physical_location.c driver core: location: Free struct acpi_pld_info *pld before return false 2023-03-10 09:28:51 +01:00
physical_location.h driver core: Add sysfs support for physical location of a device 2022-04-27 09:51:57 +02:00
pinctrl.c
platform-msi.c genirq/msi, platform-msi: Ensure that MSI descriptors are unreferenced 2023-03-10 09:29:48 +01:00
platform.c platform: Provide a remove callback that returns no value 2023-05-11 23:11:06 +09:00
property.c device property: fix of node refcount leak in fwnode_graph_get_next_endpoint() 2023-01-19 14:45:41 +01:00
soc.c base: soc: Make soc_device_match() simpler and easier to read 2022-03-18 14:28:07 +01:00
swnode.c software node: fix wrong node passed to find nargs_prop 2021-12-22 18:26:18 +01:00
syscore.c
topology.c drivers/base: fix userspace break from using bin_attributes for cpumap and cpulist 2022-07-15 17:36:33 +02:00
trace.c
trace.h
transport_class.c drivers: base: transport_class: fix resource leak when transport_add_device() fails 2023-03-10 09:28:52 +01:00