linux-stable/arch/s390
Alexander Gordeev 915fea04f9 s390/smp: enable DAT before CPU restart callback is called
The restart interrupt is triggered whenever a secondary CPU is
brought online, a remote function call dispatched from another
CPU or a manual PSW restart is initiated and causes the system
to kdump. The handling routine is always called with DAT turned
off. It then initializes the stack frame and invokes a callback.

The existing callbacks handle DAT as follows:

  * __do_restart() and __machine_kexec() turn in on upon entry;
  * __ipl_run(), __reipl_run() and __dump_run() do not turn it
    right away, but all of them call diag308() - which turns DAT
    on, but only if kasan is enabled;

In addition to the described complexity all callbacks (and the
functions they call) should avoid kasan instrumentation while
DAT is off.

This update enables DAT in the assembler restart handler and
relieves any callbacks (which are mostly C functions) from
dealing with DAT altogether.

There are four types of CPU restart that initialize control
registers in different ways:

  1. Start of secondary CPU on boot - control registers are
     inherited from the IPL CPU;
  2. Restart of online CPU - control registers of the CPU being
     restarted are kept;
  3. Hotplug of offline CPU - control registers are inherited
     from the starting CPU;
  4. Start of offline CPU triggered by manual PSW restart -
     the control registers are read from the absolute lowcore
     and contain the boot time IPL CPU values updated with all
     follow-up calls of smp_ctl_set_bit() and smp_ctl_clear_bit()
     routines;

In first three cases contents of the control registers is the
most recent. In the latter case control registers are good
enough to facilitate successful completion of kdump operation.

Suggested-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2021-08-26 20:22:12 +02:00
..
appldata s390/appldata: use struct_size() helper 2020-06-29 16:32:34 +02:00
boot s390/boot: factor out offset_vmlinux_info() function 2021-08-25 11:03:33 +02:00
configs s390: update defconfigs 2021-08-26 20:22:12 +02:00
crypto s390/archrandom: add parameter check for s390_arch_random_generate 2021-04-21 12:32:12 +02:00
hypfs s390: rename dma section to amode31 2021-08-05 14:10:53 +02:00
include s390/smp: enable DAT before CPU restart callback is called 2021-08-26 20:22:12 +02:00
kernel s390/smp: enable DAT before CPU restart callback is called 2021-08-26 20:22:12 +02:00
kvm s390 updates for the 5.14 merge window 2021-07-04 12:17:38 -07:00
lib s390/delay: get rid of not needed header includes 2021-07-27 09:39:22 +02:00
mm s390/mm,pageattr: fix walk_pte_level() early exit 2021-08-25 11:03:34 +02:00
net s390/bpf: Perform r1 range checking before accessing jit->seen_reg[r1] 2021-07-15 19:47:25 +02:00
pci s390/pci: improve DMA translation init and exit 2021-08-25 11:03:34 +02:00
purgatory s390: enable KCSAN 2021-07-30 17:09:23 +02:00
tools s390/disassembler: add instructions 2021-07-27 09:39:19 +02:00
Kbuild s390/numa: move code to arch/s390/kernel 2020-08-11 18:16:55 +02:00
Kconfig s390: enable KCSAN 2021-07-30 17:09:23 +02:00
Kconfig.debug s390/cio: add CRW inject functionality 2021-03-22 11:36:04 +01:00
Makefile s390: move the install rule to arch/s390/Makefile 2021-07-30 17:09:36 +02:00