linux-stable/arch/s390
Valentin Schneider ce04375e2d s390: preempt: Fix preempt_count initialization
commit 6a942f5780 upstream.

S390's init_idle_preempt_count(p, cpu) doesn't actually let us initialize the
preempt_count of the requested CPU's idle task: it unconditionally writes
to the current CPU's. This clearly conflicts with idle_threads_init(),
which intends to initialize *all* the idle tasks, including their
preempt_count (or their CPU's, if the arch uses a per-CPU preempt_count).

Unfortunately, it seems the way s390 does things doesn't let us initialize
every possible CPU's preempt_count early on, as the pages where this
resides are only allocated when a CPU is brought up and are freed when it
is brought down.

Let the arch-specific code set a CPU's preempt_count when its lowcore is
allocated, and turn init_idle_preempt_count() into an empty stub.

Fixes: f1a0a376ca ("sched/core: Initialize the idle task with preemption disabled")
Reported-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Valentin Schneider <valentin.schneider@arm.com>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Link: https://lore.kernel.org/r/20210707163338.1623014-1-valentin.schneider@arm.com
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-07-14 16:56:54 +02:00
..
appldata s390/appldata: use struct_size() helper 2020-06-29 16:32:34 +02:00
boot s390: mm: Fix secure storage access exception handling 2021-07-14 16:55:43 +02:00
configs s390: update defconfigs 2020-11-12 12:10:36 +01:00
crypto s390/archrandom: add parameter check for s390_arch_random_generate 2021-05-11 14:47:31 +02:00
hypfs
include s390: preempt: Fix preempt_count initialization 2021-07-14 16:56:54 +02:00
kernel s390: preempt: Fix preempt_count initialization 2021-07-14 16:56:54 +02:00
kvm KVM: s390: get rid of register asm usage 2021-07-14 16:55:56 +02:00
lib s390/test_unwind: fix CALL_ON_STACK tests 2020-12-30 11:53:56 +01:00
mm s390: mm: Fix secure storage access exception handling 2021-07-14 16:55:43 +02:00
net s390/bpf: Fix multiple tail calls 2020-09-14 18:21:31 -07:00
oprofile
pci s390/pci: fix leak of PCI device structure 2021-03-25 09:04:05 +01:00
purgatory s390/kexec_file: fix diag308 subcode when loading crash kernel 2020-12-30 11:54:08 +01:00
tools
Kbuild s390/numa: move code to arch/s390/kernel 2020-08-11 18:16:55 +02:00
Kconfig s390: appldata depends on PROC_SYSCTL 2021-07-14 16:56:42 +02:00
Kconfig.debug s390/mm,ptdump: convert to generic page table dumper 2020-09-14 11:38:34 +02:00
Makefile kbuild: remove cc-option test of -ffreestanding 2020-07-07 11:13:10 +09:00