1. 31 Jan, 2023 1 commit
  2. 30 Jan, 2023 2 commits
  3. 17 Jan, 2023 1 commit
    • Heiko Carstens's avatar
      s390: workaround invalid gcc-11 out of bounds read warning · 41e19926
      Heiko Carstens authored
      GCC 11.1.0 and 11.2.0 generate a wrong warning when compiling the
      kernel e.g. with allmodconfig:
      
      arch/s390/kernel/setup.c: In function ‘setup_lowcore_dat_on’:
      ./include/linux/fortify-string.h:57:33: error: ‘__builtin_memcpy’ reading 128 bytes from a region of size 0 [-Werror=stringop-overread]
      ...
      arch/s390/kernel/setup.c:526:9: note: in expansion of macro ‘memcpy’
        526 |         memcpy(abs_lc->cregs_save_area, S390_lowcore.cregs_save_area,
            |         ^~~~~~
      
      This could be addressed by using absolute_pointer() with the
      S390_lowcore macro, but this is not a good idea since this generates
      worse code for performance critical paths.
      
      Therefore simply use a for loop to copy the array in question and get
      rid of the warning.
      Reported-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
      41e19926
  4. 11 Jan, 2023 4 commits
  5. 10 Jan, 2023 1 commit
    • Alexander Egorenkov's avatar
      s390/kexec: fix ipl report address for kdump · c2337a40
      Alexander Egorenkov authored
      This commit addresses the following erroneous situation with file-based
      kdump executed on a system with a valid IPL report.
      
      On s390, a kdump kernel, its initrd and IPL report if present are loaded
      into a special and reserved on boot memory region - crashkernel. When
      a system crashes and kdump was activated before, the purgatory code
      is entered first which swaps the crashkernel and [0 - crashkernel size]
      memory regions. Only after that the kdump kernel is entered. For this
      reason, the pointer to an IPL report in lowcore must point to the IPL report
      after the swap and not to the address of the IPL report that was located in
      crashkernel memory region before the swap. Failing to do so, makes the
      kdump's decompressor try to read memory from the crashkernel memory region
      which already contains the production's kernel memory.
      
      The situation described above caused spontaneous kdump failures/hangs
      on systems where the Secure IPL is activated because on such systems
      an IPL report is always present. In that case kdump's decompressor tried
      to parse an IPL report which frequently lead to illegal memory accesses
      because an IPL report contains addresses to various data.
      
      Cc: <stable@vger.kernel.org>
      Fixes: 99feaa71 ("s390/kexec_file: Create ipl report and pass to next kernel")
      Reviewed-by: default avatarVasily Gorbik <gor@linux.ibm.com>
      Signed-off-by: default avatarAlexander Egorenkov <egorenar@linux.ibm.com>
      Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
      c2337a40
  6. 09 Jan, 2023 1 commit
  7. 06 Jan, 2023 3 commits
    • Masahiro Yamada's avatar
      s390: define RUNTIME_DISCARD_EXIT to fix link error with GNU ld < 2.36 · a494398b
      Masahiro Yamada authored
      Nathan Chancellor reports that the s390 vmlinux fails to link with
      GNU ld < 2.36 since commit 99cb0d91 ("arch: fix broken BuildID
      for arm64 and riscv").
      
      It happens for defconfig, or more specifically for CONFIG_EXPOLINE=y.
      
        $ s390x-linux-gnu-ld --version | head -n1
        GNU ld (GNU Binutils for Debian) 2.35.2
        $ make -s ARCH=s390 CROSS_COMPILE=s390x-linux-gnu- allnoconfig
        $ ./scripts/config -e CONFIG_EXPOLINE
        $ make -s ARCH=s390 CROSS_COMPILE=s390x-linux-gnu- olddefconfig
        $ make -s ARCH=s390 CROSS_COMPILE=s390x-linux-gnu-
        `.exit.text' referenced in section `.s390_return_reg' of drivers/base/dd.o: defined in discarded section `.exit.text' of drivers/base/dd.o
        make[1]: *** [scripts/Makefile.vmlinux:34: vmlinux] Error 1
        make: *** [Makefile:1252: vmlinux] Error 2
      
      arch/s390/kernel/vmlinux.lds.S wants to keep EXIT_TEXT:
      
              .exit.text : {
                      EXIT_TEXT
              }
      
      But, at the same time, EXIT_TEXT is thrown away by DISCARD because
      s390 does not define RUNTIME_DISCARD_EXIT.
      
      I still do not understand why the latter wins after 99cb0d91,
      but defining RUNTIME_DISCARD_EXIT seems correct because the comment
      line in arch/s390/kernel/vmlinux.lds.S says:
      
              /*
               * .exit.text is discarded at runtime, not link time,
               * to deal with references from __bug_table
               */
      
      Nathan also found that binutils commit 21401fc7bf67 ("Duplicate output
      sections in scripts") cured this issue, so we cannot reproduce it with
      binutils 2.36+, but it is better to not rely on it.
      
      Fixes: 99cb0d91 ("arch: fix broken BuildID for arm64 and riscv")
      Link: https://lore.kernel.org/all/Y7Jal56f6UBh1abE@dev-arch.thelio-3990X/Reported-by: default avatarNathan Chancellor <nathan@kernel.org>
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      Link: https://lore.kernel.org/r/20230105031306.1455409-1-masahiroy@kernel.orgSigned-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
      a494398b
    • Alexander Gordeev's avatar
      s390: expicitly align _edata and _end symbols on page boundary · 45d619bd
      Alexander Gordeev authored
      Symbols _edata and _end in the linker script are the
      only unaligned expicitly on page boundary. Although
      _end is aligned implicitly by BSS_SECTION macro that
      is still inconsistent and could lead to a bug if a tool
      or function would assume that _edata is as aligned as
      others.
      
      For example, vmem_map_init() function does not align
      symbols _etext, _einittext etc. Should these symbols
      be unaligned as well, the size of ranges to update
      were short on one page.
      
      Instead of fixing every occurrence of this kind in the
      code and external tools just force the alignment on
      these two symbols.
      Reviewed-by: default avatarHeiko Carstens <hca@linux.ibm.com>
      Signed-off-by: default avatarAlexander Gordeev <agordeev@linux.ibm.com>
      Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
      45d619bd
    • Niklas Schnelle's avatar
      s390/debug: add _ASM_S390_ prefix to header guard · 0d4d5236
      Niklas Schnelle authored
      Using DEBUG_H without a prefix is very generic and inconsistent with
      other header guards in arch/s390/include/asm. In fact it collides with
      the same name in the ath9k wireless driver though that depends on !S390
      via disabled wireless support. Let's just use a consistent header guard
      name and prevent possible future trouble.
      Signed-off-by: default avatarNiklas Schnelle <schnelle@linux.ibm.com>
      Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
      0d4d5236
  8. 01 Jan, 2023 6 commits
  9. 31 Dec, 2022 2 commits
  10. 30 Dec, 2022 19 commits