1. 30 Jan, 2023 1 commit
  2. 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
  3. 11 Jan, 2023 4 commits
  4. 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
  5. 09 Jan, 2023 1 commit
  6. 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
  7. 01 Jan, 2023 6 commits
  8. 31 Dec, 2022 2 commits
  9. 30 Dec, 2022 19 commits
  10. 29 Dec, 2022 2 commits
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm · 2258c2dc
      Linus Torvalds authored
      Pull kvm fixes from Paolo Bonzini:
       "Changes that were posted too late for 6.1, or after the release.
      
        x86:
      
         - several fixes to nested VMX execution controls
      
         - fixes and clarification to the documentation for Xen emulation
      
         - do not unnecessarily release a pmu event with zero period
      
         - MMU fixes
      
         - fix Coverity warning in kvm_hv_flush_tlb()
      
        selftests:
      
         - fixes for the ucall mechanism in selftests
      
         - other fixes mostly related to compilation with clang"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (41 commits)
        KVM: selftests: restore special vmmcall code layout needed by the harness
        Documentation: kvm: clarify SRCU locking order
        KVM: x86: fix deadlock for KVM_XEN_EVTCHN_RESET
        KVM: x86/xen: Documentation updates and clarifications
        KVM: x86/xen: Add KVM_XEN_INVALID_GPA and KVM_XEN_INVALID_GFN to uapi
        KVM: x86/xen: Simplify eventfd IOCTLs
        KVM: x86/xen: Fix SRCU/RCU usage in readers of evtchn_ports
        KVM: x86/xen: Use kvm_read_guest_virt() instead of open-coding it badly
        KVM: x86/xen: Fix memory leak in kvm_xen_write_hypercall_page()
        KVM: Delete extra block of "};" in the KVM API documentation
        kvm: x86/mmu: Remove duplicated "be split" in spte.h
        kvm: Remove the unused macro KVM_MMU_READ_{,UN}LOCK()
        MAINTAINERS: adjust entry after renaming the vmx hyperv files
        KVM: selftests: Mark correct page as mapped in virt_map()
        KVM: arm64: selftests: Don't identity map the ucall MMIO hole
        KVM: selftests: document the default implementation of vm_vaddr_populate_bitmap
        KVM: selftests: Use magic value to signal ucall_alloc() failure
        KVM: selftests: Disable "gnu-variable-sized-type-not-at-end" warning
        KVM: selftests: Include lib.mk before consuming $(CC)
        KVM: selftests: Explicitly disable builtins for mem*() overrides
        ...
      2258c2dc
    • Jens Axboe's avatar
      Merge tag 'nvme-6.2-2022-12-29' of git://git.infradead.org/nvme into block-6.2 · 1551ed5a
      Jens Axboe authored
      Pull NVMe fixes from Christoph:
      
      "nvme fixes for Linux 6.2
      
       - fix various problems in handling the Command Supported and Effects log
         (Christoph Hellwig)
       - don't allow unprivileged passthrough of commands that don't transfer
         data but modify logical block content (Christoph Hellwig)
       - add a features and quirks policy document (Christoph Hellwig)
       - fix some really nasty code that was correct but made smatch complain
         (Sagi Grimberg)"
      
      * tag 'nvme-6.2-2022-12-29' of git://git.infradead.org/nvme:
        nvme-auth: fix smatch warning complaints
        nvme: consult the CSE log page for unprivileged passthrough
        nvme: also return I/O command effects from nvme_command_effects
        nvmet: don't defer passthrough commands with trivial effects to the workqueue
        nvmet: set the LBCC bit for commands that modify data
        nvmet: use NVME_CMD_EFFECTS_CSUPP instead of open coding it
        nvme: fix the NVME_CMD_EFFECTS_CSE_MASK definition
        docs, nvme: add a feature and quirk policy document
      1551ed5a