s390/topology: honour nr_cpu_ids when adding CPUs
authorAlexander Gordeev <agordeev@linux.ibm.com>
Thu, 4 May 2023 14:21:48 +0000 (16:21 +0200)
committerAlexander Gordeev <agordeev@linux.ibm.com>
Mon, 15 May 2023 12:20:14 +0000 (14:20 +0200)
commita33239be2d38ff5a44427db1707c08787508d34a
tree8d100be7bfae7633e05e4c1b8cfc7387b5a3bf4f
parentb1b0d5aec1cf9f9a900a14964f869c68688d923e
s390/topology: honour nr_cpu_ids when adding CPUs

When SMT thread CPUs are added to CPU masks the nr_cpu_ids
limit is not checked and could be exceeded. This leads to
a warning for example if CONFIG_DEBUG_PER_CPU_MAPS is set
and the command line parameter nr_cpus is set to 1.

Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
arch/s390/kernel/topology.c