1. 06 Jul, 2018 3 commits
    • Philipp Rudo's avatar
      s390/purgatory: Remove duplicate variable definitions · 287d6070
      Philipp Rudo authored
      Currently there are some variables in the purgatory (e.g. kernel_entry)
      which are defined twice, once in assembler- and once in c-code. The reason
      for this is that these variables are set during purgatory load, where
      sanity checks on the corresponding Elf_Sym's are made, while they are used
      in assembler-code. Thus adding a second definition in c-code is a handy
      workaround to guarantee correct Elf_Sym's are created.
      
      When the purgatory is compiled with -fcommon (default for gcc on s390) this
      is no problem because both symbols are merged by the linker. However this
      is not required by ISO C and when the purgatory is built with -fno-common
      the linker fails with errors like
      
      arch/s390/purgatory/purgatory.o:(.bss+0x18): multiple definition of `kernel_entry'
      arch/s390/purgatory/head.o:/.../arch/s390/purgatory/head.S:230: first defined here
      
      Thus remove the duplicate definitions and add the required size and type
      information to the assembler definition. Also add -fno-common to the
      command line options to prevent similar hacks in the future.
      Signed-off-by: default avatarPhilipp Rudo <prudo@linux.ibm.com>
      Acked-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      287d6070
    • Philipp Rudo's avatar
      s390/purgatory: Add missing FORCE to Makefile targets · c315e693
      Philipp Rudo authored
      Without FORCE make does not detect changes only made to the command line
      options. So object files might not be re-built even when they should be.
      Fix this by adding FORCE where it is missing.
      
      Fixes: 840798a1 ("s390/kexec_file: Add purgatory")
      Cc: <stable@vger.kernel.org> # 4.17
      Signed-off-by: default avatarPhilipp Rudo <prudo@linux.ibm.com>
      Acked-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      c315e693
    • Philipp Rudo's avatar
      s390/purgatory: Fix crash with expoline enabled · ad03b821
      Philipp Rudo authored
      When the kernel is built with CONFIG_EXPOLINE=y and a compiler with
      indirect branch mitigation enabled the purgatory crashes. The reason for
      that is that the macros defined for expoline are used in mem.S. These
      macros define new sections (.text.__s390x_indirect_*) which are marked
      executable. Due to the missing linker script those sections are linked to
      address 0, just as the .text section. In combination with the entry point
      also being at address 0 this causes the purgatory load code
      (kernel/kexec_file.c: kexec_purgatory_setup_sechdrs) to update the entry
      point twice. Thus the old kernel jumps to some 'random' address causing the
      crash.
      
      To fix this turn off expolines for the purgatory. There is no problem with
      this in this case due to the fact that the purgatory only runs once and the
      tlb is purged (diag 308) in the end.
      
      Fixes: 840798a1 ("s390/kexec_file: Add purgatory")
      Cc: <stable@vger.kernel.org> # 4.17
      Signed-off-by: default avatarPhilipp Rudo <prudo@linux.ibm.com>
      Reviewed-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      ad03b821
  2. 04 Jul, 2018 3 commits
  3. 02 Jul, 2018 26 commits
  4. 25 Jun, 2018 8 commits