• Gerald Schaefer's avatar
    s390/hibernate: fix error handling when suspend cpu != resume cpu · 55a5542a
    Gerald Schaefer authored
    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: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
    Signed-off-by: default avatarGerald Schaefer <gerald.schaefer@de.ibm.com>
    Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
    55a5542a
sclp_early_core.c 6.21 KB