linux-stable/arch
Gautham R. Shenoy a4bec516b9 powerpc/cacheinfo: Lookup cache by dt node and thread-group id
Currently the cacheinfo code on powerpc indexes the "cache" objects
(modelling the L1/L2/L3 caches) where the key is device-tree node
corresponding to that cache. On some of the POWER server platforms
thread-groups within the core share different sets of caches (Eg: On
SMT8 POWER9 systems, threads 0,2,4,6 of a core share L1 cache and
threads 1,3,5,7 of the same core share another L1 cache). On such
platforms, there is a single device-tree node corresponding to that
cache and the cache-configuration within the threads of the core is
indicated via "ibm,thread-groups" device-tree property.

Since the current code is not aware of the "ibm,thread-groups"
property, on the aforementoined systems, cacheinfo code still treats
all the threads in the core to be sharing the cache because of the
single device-tree node (In the earlier example, the cacheinfo code
would says CPUs 0-7 share L1 cache).

In this patch, we make the powerpc cacheinfo code aware of the
"ibm,thread-groups" property. We indexe the "cache" objects by the
key-pair (device-tree node, thread-group id). For any CPUX, for a
given level of cache, the thread-group id is defined to be the first
CPU in the "ibm,thread-groups" cache-group containing CPUX. For levels
of cache which are not represented in "ibm,thread-groups" property,
the thread-group id is -1.

[parth: Remove "static" keyword for the definition of "thread_group_l1_cache_map"
and "thread_group_l2_cache_map" to get rid of the compile error.]

Signed-off-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>
Signed-off-by: Parth Shah <parth@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210728175607.591679-2-parth@linux.ibm.com
2021-08-04 10:53:39 +10:00
..
alpha Kbuild updates for v5.14 2021-07-10 11:01:38 -07:00
arc Kbuild updates for v5.14 2021-07-10 11:01:38 -07:00
arm ARM: SoC fixes for v5.14 2021-07-17 15:58:24 -07:00
arm64 ARM: SoC fixes for v5.14 2021-07-17 15:58:24 -07:00
csky Kbuild updates for v5.14 2021-07-10 11:01:38 -07:00
h8300 Kbuild updates for v5.14 2021-07-10 11:01:38 -07:00
hexagon Kbuild updates for v5.14 2021-07-10 11:01:38 -07:00
ia64 Kbuild updates for v5.14 2021-07-10 11:01:38 -07:00
m68k Kbuild updates for v5.14 2021-07-10 11:01:38 -07:00
microblaze Kbuild updates for v5.14 2021-07-10 11:01:38 -07:00
mips Merge tag 'kvm-s390-master-5.14-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux into HEAD 2021-07-14 12:14:27 -04:00
nds32 Kbuild updates for v5.14 2021-07-10 11:01:38 -07:00
nios2 Kbuild updates for v5.14 2021-07-10 11:01:38 -07:00
openrisc Kbuild updates for v5.14 2021-07-10 11:01:38 -07:00
parisc Kbuild updates for v5.14 2021-07-10 11:01:38 -07:00
powerpc powerpc/cacheinfo: Lookup cache by dt node and thread-group id 2021-08-04 10:53:39 +10:00
riscv Kbuild updates for v5.14 2021-07-10 11:01:38 -07:00
s390 Merge tag 'kvm-s390-master-5.14-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux into HEAD 2021-07-14 12:14:27 -04:00
sh Kbuild updates for v5.14 2021-07-10 11:01:38 -07:00
sparc Locking fixes: 2021-07-11 11:06:09 -07:00
um Kbuild updates for v5.14 2021-07-10 11:01:38 -07:00
x86 * Allow again loading KVM on 32-bit non-PAE builds 2021-07-15 11:56:07 -07:00
xtensa Kbuild updates for v5.14 2021-07-10 11:01:38 -07:00
.gitignore
Kconfig Kconfig: Introduce ARCH_WANTS_NO_INSTR and CC_HAS_NO_PROFILE_FN_ATTR 2021-06-22 11:07:18 -07:00