s390/smp: ensure global control register contents are in sync
authorHeiko Carstens <hca@linux.ibm.com>
Tue, 1 Aug 2023 13:05:30 +0000 (15:05 +0200)
committerHeiko Carstens <hca@linux.ibm.com>
Wed, 9 Aug 2023 13:20:50 +0000 (15:20 +0200)
commite1b9c2749af020e6c915eb07fcd53fa3a1a074e6
treee566d797a3753a6792b2e002436708f791b0bfba
parent481daa505bc3eb4ac7991e2e7a981506639935fd
s390/smp: ensure global control register contents are in sync

Globally setting a bit in control registers is done with
smp_ctl_set_clear_bit(). This is using on_each_cpu() to execute a function
which actually sets the control register bit on each online CPU. This can
be problematic since on_each_cpu() does not prevent that new CPUs come
online while it is executed, which in turn means that control register
updates could be missing on new CPUs.

In order to prevent this problem make sure that global control register
contents cannot change until new CPUs have initialized their control
registers, and marked themselves online, so they are included in subsequent
on_each_cpu() calls.

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