]> git.baikalelectronics.ru Git - kernel.git/commit
s390/hibernate: fix error handling when suspend cpu != resume cpu
authorGerald Schaefer <gerald.schaefer@de.ibm.com>
Mon, 10 Sep 2018 16:03:29 +0000 (18:03 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Thu, 20 Sep 2018 11:20:23 +0000 (13:20 +0200)
commitc06d6bc4042ad49858814192134adc99e3dd8918
tree9f2523b7eecc6bf10eda1b8769af7c6650fdbfb4
parenteb5a5845bf6d8edc8121feb8fa2323e552472ba6
s390/hibernate: fix error handling when suspend cpu != resume cpu

The resume code checks if the resume cpu is the same as the suspend cpu.
If not, and if it is also not possible to switch to the suspend cpu, an
error message should be printed and the resume process should be stopped
by loading a disabled wait psw.

The current logic is broken in multiple ways, the message is never printed,
and the disabled wait psw never loaded because the kernel panics before that:
- sam31 and SIGP_SET_ARCHITECTURE to ESA mode is wrong, this will break
  on the first 64bit instruction in sclp_early_printk().
- The init stack should be used, but the stack pointer is not set up correctly
  (missing aghi %r15,-STACK_FRAME_OVERHEAD).
- __sclp_early_printk() checks the sclp_init_state. If it is not
  sclp_init_state_uninitialized, it simply returns w/o printing anything.
  In the resumed kernel however, sclp_init_state will never be uninitialized.

This patch fixes those issues by removing the sam31/ESA logic, adding a
correct init stack pointer, and also introducing sclp_early_printk_force()
to allow using sclp_early_printk() even when sclp_init_state is not
uninitialized.

Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/include/asm/sclp.h
arch/s390/kernel/early_printk.c
arch/s390/kernel/swsusp.S
drivers/s390/char/sclp_early_core.c