Skip to content
Commit 198102c9 authored by Yong-Xuan Wang's avatar Yong-Xuan Wang Committed by Sudeep Holla
Browse files

cacheinfo: Fix shared_cpu_map to handle shared caches at different levels



The cacheinfo sets up the shared_cpu_map by checking whether the caches
with the same index are shared between CPUs. However, this will trigger
slab-out-of-bounds access if the CPUs do not have the same cache hierarchy.
Another problem is the mismatched shared_cpu_map when the shared cache does
not have the same index between CPUs.

CPU0	I	D	L3
index	0	1	2	x
	^	^	^	^
index	0	1	2	3
CPU1	I	D	L2	L3

This patch checks each cache is shared with all caches on other CPUs.

Reviewed-by: default avatarPierre Gondois <pierre.gondois@arm.com>
Signed-off-by: default avatarYong-Xuan Wang <yongxuan.wang@sifive.com>
Link: https://lore.kernel.org/r/20230117105133.4445-2-yongxuan.wang@sifive.com


Signed-off-by: default avatarSudeep Holla <sudeep.holla@arm.com>
parent 5944ce09
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment