Skip to content
  1. Apr 26, 2021
    • Liao Chang's avatar
      riscv/kprobe: fix kernel panic when invoking sys_read traced by kprobe · b1ebaa0e
      Liao Chang authored
      The execution of sys_read end up hitting a BUG_ON() in __find_get_block
      after installing kprobe at sys_read, the BUG message like the following:
      
      [   65.708663] ------------[ cut here ]------------
      [   65.709987] kernel BUG at fs/buffer.c:1251!
      [   65.711283] Kernel BUG [#1]
      [   65.712032] Modules linked in:
      [   65.712925] CPU: 0 PID: 51 Comm: sh Not tainted 5.12.0-rc4 #1
      [   65.714407] Hardware name: riscv-virtio,qemu (DT)
      [   65.715696] epc : __find_get_block+0x218/0x2c8
      [   65.716835]  ra : __getblk_gfp+0x1c/0x4a
      [   65.717831] epc : ffffffe00019f11e ra : ffffffe00019f56a sp : ffffffe002437930
      [   65.719553]  gp : ffffffe000f06030 tp : ffffffe0015abc00 t0 : ffffffe00191e038
      [   65.721290]  t1 : ffffffe00191e038 t2 : 000000000000000a s0 : ffffffe002437960
      [   65.723051]  s1 : ffffffe00160ad00 a0 : ffffffe00160ad00 a1 : 000000000000012a
      [   65.724772]  a2 : 0000000000000400 a3 : 0000000000000008 a4 : 0000000000000040
      [   65.726545]  a5 : 0000000000000000 a6 : ffffffe00191e000 a7 : 0000000000000000
      [   65.728308]  s2 : 000000000000012a s3 : 0000000000000400 s4 : 0000000000000008
      [   65.730049]  s5 : 000000000000006c s6 : ffffffe00240f800 s7 : ffffffe000f080a8
      [   65.731802]  s8 : 0000000000000001 s9 : 000000000000012a s10: 0000000000000008
      [   65.733516]  s11: 0000000000000008 t3 : 00000000000003ff t4 : 000000000000000f
      [   65.734434]  t5 : 00000000000003ff t6 : 0000000000040000
      [   65.734613] status: 0000000000000100 badaddr: 0000000000000000 cause: 0000000000000003
      [   65.734901] Call Trace:
      [   65.735076] [<ffffffe00019f11e>] __find_get_block+0x218/0x2c8
      [   65.735417] [<ffffffe00020017a>] __ext4_get_inode_loc+0xb2/0x2f6
      [   65.735618] [<ffffffe000201b6c>] ext4_get_inode_loc+0x3a/0x8a
      [   65.735802] [<ffffffe000203380>] ext4_reserve_inode_write+0x2e/0x8c
      [   65.735999] [<ffffffe00020357a>] __ext4_mark_inode_dirty+0x4c/0x18e
      [   65.736208] [<ffffffe000206bb0>] ext4_dirty_inode+0x46/0x66
      [   65.736387] [<ffffffe000192914>] __mark_inode_dirty+0x12c/0x3da
      [   65.736576] [<ffffffe000180dd2>] touch_atime+0x146/0x150
      [   65.736748] [<ffffffe00010d762>] filemap_read+0x234/0x246
      [   65.736920] [<ffffffe00010d834>] generic_file_read_iter+0xc0/0x114
      [   65.737114] [<ffffffe0001f5d7a>] ext4_file_read_iter+0x42/0xea
      [   65.737310] [<ffffffe000163f2c>] new_sync_read+0xe2/0x15a
      [   65.737483] [<ffffffe000165814>] vfs_read+0xca/0xf2
      [   65.737641] [<ffffffe000165bae>] ksys_read+0x5e/0xc8
      [   65.737816] [<ffffffe000165c26>] sys_read+0xe/0x16
      [   65.737973] [<ffffffe000003972>] ret_from_syscall+0x0/0x2
      [   65.738858] ---[ end trace fe93f985456c935d ]---
      
      A simple reproducer looks like:
      	echo 'p:myprobe sys_read fd=%a0 buf=%a1 count=%a2' > /sys/kernel/debug/tracing/kprobe_events
      	echo 1 > /sys/kernel/debug/tracing/events/kprobes/myprobe/enable
      	cat /sys/kernel/debug/tracing/trace
      
      Here's what happens to hit that BUG_ON():
      
      1) After installing kprobe at entry of sys_read, the first instruction
         is replaced by 'ebreak' instruction on riscv64 platform.
      
      2) Once kernel reach the 'ebreak' instruction at the entry of sys_read,
         it trap into the riscv breakpoint handler, where it do something to
         setup for coming single-step of origin instruction, including backup
         the 'sstatus' in pt_regs, followed by disable interrupt during single
         stepping via clear 'SIE' bit of 'sstatus' in pt_regs.
      
      3) Then kernel restore to the instruction slot contains two instructions,
         one is original instruction at entry of sys_read, the other is 'ebreak'.
         Here it trigger a 'Instruction page fault' exception (value at 'scause'
         is '0xc'), if PF is not filled into PageTabe for that slot yet.
      
      4) Again kernel trap into page fault exception handler, where it choose
         different policy according to the state of running kprobe. Because
         afte 2) the state is KPROBE_HIT_SS, so kernel reset the current kprobe
         and 'pc' points back to the probe address.
      
      5) Because 'epc' point back to 'ebreak' instrution at sys_read probe,
         kernel trap into breakpoint handler again, and repeat the operations
         at 2), however 'sstatus' without 'SIE' is keep at 4), it cause the
         real 'sstatus' saved at 2) is overwritten by the one withou 'SIE'.
      
      6) When kernel cross the probe the 'sstatus' CSR restore with value
         without 'SIE', and reach __find_get_block where it requires the
         interrupt must be enabled.
      
      Fix this is very trivial, just restore the value of 'sstatus' in pt_regs
      with backup one at 2) when the instruction being single stepped cause a
      page fault.
      
      Fixes: c22b0bcb
      
       ("riscv: Add kprobes supported")
      Signed-off-by: default avatarLiao Chang <liaochang1@huawei.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
      b1ebaa0e
    • Jisheng Zhang's avatar
      riscv: Set ARCH_HAS_STRICT_MODULE_RWX if MMU · a9451b8e
      Jisheng Zhang authored
      
      
      Now we can set ARCH_HAS_STRICT_MODULE_RWX for MMU riscv platforms, this
      is good from security perspective.
      
      Signed-off-by: default avatarJisheng Zhang <jszhang@kernel.org>
      Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
      a9451b8e
    • Jisheng Zhang's avatar
      riscv: module: Create module allocations without exec permissions · 5387054b
      Jisheng Zhang authored
      
      
      The core code manages the executable permissions of code regions of
      modules explicitly, it is not necessary to create the module vmalloc
      regions with RWX permissions. Create them with RW- permissions instead.
      
      Signed-off-by: default avatarJisheng Zhang <jszhang@kernel.org>
      Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
      5387054b
    • Jisheng Zhang's avatar
      riscv: bpf: Avoid breaking W^X · fc850476
      Jisheng Zhang authored
      
      
      We allocate Non-executable pages, then call bpf_jit_binary_lock_ro()
      to enable executable permission after mapping them read-only. This is
      to prepare for STRICT_MODULE_RWX in following patch.
      
      Signed-off-by: default avatarJisheng Zhang <jszhang@kernel.org>
      Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
      fc850476
    • Jisheng Zhang's avatar
      riscv: bpf: Move bpf_jit_alloc_exec() and bpf_jit_free_exec() to core · 1d27d854
      Jisheng Zhang authored
      
      
      We will drop the executable permissions of the code pages from the
      mapping at allocation time soon. Move bpf_jit_alloc_exec() and
      bpf_jit_free_exec() to bpf_jit_core.c so that they can be shared by
      both RV64I and RV32I.
      
      Signed-off-by: default avatarJisheng Zhang <jszhang@kernel.org>
      Acked-by: default avatarLuke Nelson <luke.r.nels@gmail.com>
      Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
      1d27d854
    • Jisheng Zhang's avatar
      riscv: kprobes: Implement alloc_insn_page() · cdd1b2bd
      Jisheng Zhang authored
      
      
      Allocate PAGE_KERNEL_READ_EXEC(read only, executable) page for kprobes
      insn page. This is to prepare for STRICT_MODULE_RWX.
      
      Signed-off-by: default avatarJisheng Zhang <jszhang@kernel.org>
      Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
      cdd1b2bd
    • Jisheng Zhang's avatar
      riscv: Constify sbi_ipi_ops · 300f62c3
      Jisheng Zhang authored
      
      
      Constify the sbi_ipi_ops so that it will be placed in the .rodata
      section. This will cause attempts to modify it to fail when strict
      page permissions are in place.
      
      Signed-off-by: default avatarJisheng Zhang <jszhang@kernel.org>
      Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
      300f62c3
    • Jisheng Zhang's avatar
      riscv: Constify sys_call_table · e6a30224
      Jisheng Zhang authored
      
      
      Constify the sys_call_table so that it will be placed in the .rodata
      section. This will cause attempts to modify the table to fail when
      strict page permissions are in place.
      
      Signed-off-by: default avatarJisheng Zhang <jszhang@kernel.org>
      Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
      e6a30224
    • Jisheng Zhang's avatar
      riscv: Mark some global variables __ro_after_init · de31ea4a
      Jisheng Zhang authored
      
      
      All of these are never modified after init, so they can be
      __ro_after_init.
      
      Signed-off-by: default avatarJisheng Zhang <jszhang@kernel.org>
      Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
      de31ea4a
    • Jisheng Zhang's avatar
      riscv: add __init section marker to some functions · 1987501b
      Jisheng Zhang authored
      
      
      They are not needed after booting, so mark them as __init to move them
      to the __init section.
      
      Signed-off-by: default avatarJisheng Zhang <jszhang@kernel.org>
      Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
      1987501b
    • Alexandre Ghiti's avatar
      riscv: Prepare ptdump for vm layout dynamic addresses · 0df68ce4
      Alexandre Ghiti authored
      
      
      This is a preparatory patch for sv48 support that will introduce
      dynamic PAGE_OFFSET.
      
      Dynamic PAGE_OFFSET implies that all zones (vmalloc, vmemmap, fixaddr...)
      whose addresses depend on PAGE_OFFSET become dynamic and can't be used
      to statically initialize the array used by ptdump to identify the
      different zones of the vm layout.
      
      Signed-off-by: default avatarAlexandre Ghiti <alex@ghiti.fr>
      Reviewed-by: default avatarAnup Patel <anup@brainfault.org>
      Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
      0df68ce4
    • Alexandre Ghiti's avatar
      Documentation: riscv: Add documentation that describes the VM layout · 2a433cf8
      Alexandre Ghiti authored
      
      
      This new document presents the RISC-V virtual memory layout and is based
      one the x86 one: it describes the different limits of the different regions
      of the virtual address space.
      
      Signed-off-by: default avatarAlexandre Ghiti <alex@ghiti.fr>
      Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
      2a433cf8
    • Alexandre Ghiti's avatar
      riscv: Move kernel mapping outside of linear mapping · 2bfc6cd8
      Alexandre Ghiti authored
      
      
      This is a preparatory patch for relocatable kernel and sv48 support.
      
      The kernel used to be linked at PAGE_OFFSET address therefore we could use
      the linear mapping for the kernel mapping. But the relocated kernel base
      address will be different from PAGE_OFFSET and since in the linear mapping,
      two different virtual addresses cannot point to the same physical address,
      the kernel mapping needs to lie outside the linear mapping so that we don't
      have to copy it at the same physical offset.
      
      The kernel mapping is moved to the last 2GB of the address space, BPF
      is now always after the kernel and modules use the 2GB memory range right
      before the kernel, so BPF and modules regions do not overlap. KASLR
      implementation will simply have to move the kernel in the last 2GB range
      and just take care of leaving enough space for BPF.
      
      In addition, by moving the kernel to the end of the address space, both
      sv39 and sv48 kernels will be exactly the same without needing to be
      relocated at runtime.
      
      Suggested-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarAlexandre Ghiti <alex@ghiti.fr>
      [Palmer: Squash the STRICT_RWX fix, and a !MMU fix]
      Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
      2bfc6cd8
    • Jisheng Zhang's avatar
      samples/kprobes: Add riscv support · 8a07ac39
      Jisheng Zhang authored
      
      
      Add riscv specific info dump in both handler_pre() and handler_post().
      
      Signed-off-by: default avatarJisheng Zhang <jszhang@kernel.org>
      Acked-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
      Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
      8a07ac39
    • Nathan Chancellor's avatar
      riscv: Select HAVE_DYNAMIC_FTRACE when -fpatchable-function-entry is available · adebc881
      Nathan Chancellor authored
      clang prior to 13.0.0 does not support -fpatchable-function-entry for
      RISC-V.
      
      clang: error: unsupported option '-fpatchable-function-entry=8' for target 'riscv64-unknown-linux-gnu'
      
      To avoid this error, only select HAVE_DYNAMIC_FTRACE when this option is
      not available.
      
      Fixes: afc76b8b
      
       ("riscv: Using PATCHABLE_FUNCTION_ENTRY instead of MCOUNT")
      Link: https://github.com/ClangBuiltLinux/linux/issues/1268
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Signed-off-by: default avatarNathan Chancellor <nathan@kernel.org>
      Reviewed-by: default avatarFangrui Song <maskray@google.com>
      Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
      adebc881
    • Nathan Chancellor's avatar
      riscv: Workaround mcount name prior to clang-13 · 7ce04771
      Nathan Chancellor authored
      
      
      Prior to clang 13.0.0, the RISC-V name for the mcount symbol was
      "mcount", which differs from the GCC version of "_mcount", which results
      in the following errors:
      
      riscv64-linux-gnu-ld: init/main.o: in function `__traceiter_initcall_level':
      main.c:(.text+0xe): undefined reference to `mcount'
      riscv64-linux-gnu-ld: init/main.o: in function `__traceiter_initcall_start':
      main.c:(.text+0x4e): undefined reference to `mcount'
      riscv64-linux-gnu-ld: init/main.o: in function `__traceiter_initcall_finish':
      main.c:(.text+0x92): undefined reference to `mcount'
      riscv64-linux-gnu-ld: init/main.o: in function `.LBB32_28':
      main.c:(.text+0x30c): undefined reference to `mcount'
      riscv64-linux-gnu-ld: init/main.o: in function `free_initmem':
      main.c:(.text+0x54c): undefined reference to `mcount'
      
      This has been corrected in https://reviews.llvm.org/D98881 but the
      minimum supported clang version is 10.0.1. To avoid build errors and to
      gain a working function tracer, adjust the name of the mcount symbol for
      older versions of clang in mount.S and recordmcount.pl.
      
      Link: https://github.com/ClangBuiltLinux/linux/issues/1331
      Signed-off-by: default avatarNathan Chancellor <nathan@kernel.org>
      Reviewed-by: default avatarNick Desaulniers <ndesaulniers@google.com>
      Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
      7ce04771
    • Nathan Chancellor's avatar
      scripts/recordmcount.pl: Fix RISC-V regex for clang · 2f095504
      Nathan Chancellor authored
      
      
      Clang can generate R_RISCV_CALL_PLT relocations to _mcount:
      
      $ llvm-objdump -dr build/riscv/init/main.o | rg mcount
                      000000000000000e:  R_RISCV_CALL_PLT     _mcount
                      000000000000004e:  R_RISCV_CALL_PLT     _mcount
      
      After this, the __start_mcount_loc section is properly generated and
      function tracing still works.
      
      Link: https://github.com/ClangBuiltLinux/linux/issues/1331
      Signed-off-by: default avatarNathan Chancellor <nathan@kernel.org>
      Reviewed-by: default avatarFangrui Song <maskray@google.com>
      Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
      2f095504
    • Nathan Chancellor's avatar
      riscv: Use $(LD) instead of $(CC) to link vDSO · 7f3d3490
      Nathan Chancellor authored
      Currently, the VDSO is being linked through $(CC). This does not match
      how the rest of the kernel links objects, which is through the $(LD)
      variable.
      
      When linking with clang, there are a couple of warnings about flags that
      will not be used during the link:
      
      clang-12: warning: argument unused during compilation: '-no-pie' [-Wunused-command-line-argument]
      clang-12: warning: argument unused during compilation: '-pg' [-Wunused-command-line-argument]
      
      '-no-pie' was added in commit 85602bea ("RISC-V: build vdso-dummy.o
      with -no-pie") to override '-pie' getting added to the ld command from
      distribution versions of GCC that enable PIE by default. It is
      technically no longer needed after commit c2c81bb2 ("RISC-V: Fix the
      VDSO symbol generaton for binutils-2.35+"), which removed vdso-dummy.o
      in favor of generating vdso-syms.S from vdso.so with $(NM) but this also
      resolves the issue in case it ever comes back due to having full control
      over the $(LD) command. '-pg' is for function tracing, it is not used
      during linking as clang states.
      
      These flags could be removed/filtered to fix the warnings but it is
      easier to just match the rest of the kernel and use $(LD) directly for
      linking. See commits
      
        fe00e50b ("ARM: 8858/1: vdso: use $(LD) instead of $(CC) to link VDSO")
        691efbed ("arm64: vdso: use $(LD) instead of $(CC) to link VDSO")
        2ff90699 ("MIPS: VDSO: Use $(LD) instead of $(CC) to link VDSO")
        2b2a2584
      
       ("s390/vdso: Use $(LD) instead of $(CC) to link vDSO")
      
      for more information.
      
      The flags are converted to linker flags and '--eh-frame-hdr' is added to
      match what is added by GCC implicitly, which can be seen by adding '-v'
      to GCC's invocation.
      
      Additionally, since this area is being modified, use the $(OBJCOPY)
      variable instead of an open coded $(CROSS_COMPILE)objcopy so that the
      user's choice of objcopy binary is respected.
      
      Link: https://github.com/ClangBuiltLinux/linux/issues/803
      Link: https://github.com/ClangBuiltLinux/linux/issues/970
      Signed-off-by: default avatarNathan Chancellor <nathan@kernel.org>
      Reviewed-by: default avatarFangrui Song <maskray@google.com>
      Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
      7f3d3490
    • Vincent Chen's avatar
      riscv: sifive: Apply errata "cip-1200" patch · bff3ff52
      Vincent Chen authored
      
      
      For certain SiFive CPUs, "sfence.vma addr" cannot exactly flush addr
      from TLB in the particular cases. The details could be found here:
      https://sifive.cdn.prismic.io/sifive/167a1a56-03f4-4615-a79e-b2a86153148f_FU740_errata_20210205.pdf
      In order to ensure the functionality, this patch uses the Alternative
      scheme to replace all "sfence.vma addr" with "sfence.vma" at runtime.
      
      Signed-off-by: default avatarVincent Chen <vincent.chen@sifive.com>
      Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
      bff3ff52
    • Vincent Chen's avatar
      riscv: sifive: Apply errata "cip-453" patch · 800149a7
      Vincent Chen authored
      
      
      Add sign extension to the $badaddr before addressing the instruction page
      fault and instruction access fault to workaround the issue "cip-453".
      
      To avoid affecting the existing code sequence, this patch will creates two
      trampolines to add sign extension to the $badaddr. By the "alternative"
      mechanism, these two trampolines will replace the original exception
      handler of instruction page fault and instruction access fault in the
      excp_vect_table. In this case, only the specific SiFive CPU core jumps to
      the do_page_fault and do_trap_insn_fault through these two trampolines.
      Other CPUs are not affected.
      
      Signed-off-by: default avatarVincent Chen <vincent.chen@sifive.com>
      Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
      800149a7
    • Vincent Chen's avatar
      riscv: sifive: Add SiFive alternative ports · 1a0e5dbd
      Vincent Chen authored
      
      
      Add required ports of the Alternative scheme for SiFive.
      
      Signed-off-by: default avatarVincent Chen <vincent.chen@sifive.com>
      Reviewed-by: default avatarAnup Patel <anup@brainfault.org>
      Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
      1a0e5dbd
    • Vincent Chen's avatar
      riscv: Introduce alternative mechanism to apply errata solution · 6f4eea90
      Vincent Chen authored
      
      
      Introduce the "alternative" mechanism from ARM64 and x86 to apply the CPU
      vendors' errata solution at runtime. The main purpose of this patch is
      to provide a framework. Therefore, the implementation is quite basic for
      now so that some scenarios could not use this schemei, such as patching
      code to a module, relocating the patching code and heterogeneous CPU
      topology.
      
      Users could use the macro ALTERNATIVE to apply an errata to the existing
      code flow. In the macro ALTERNATIVE, users need to specify the manufacturer
      information(vendorid, archid, and impid) for this errata. Therefore, kernel
      will know this errata is suitable for which CPU core. During the booting
      procedure, kernel will select the errata required by the CPU core and then
      patch it. It means that the kernel only applies the errata to the specified
      CPU core. In this case, the vendor's errata does not affect each other at
      runtime. The above patching procedure only occurs during the booting phase,
      so we only take the overhead of the "alternative" mechanism once.
      
      This "alternative" mechanism is enabled by default to ensure that all
      required errata will be applied. However, users can disable this feature by
      the Kconfig "CONFIG_RISCV_ERRATA_ALTERNATIVE".
      
      Signed-off-by: default avatarVincent Chen <vincent.chen@sifive.com>
      Reviewed-by: default avatarAnup Patel <anup@brainfault.org>
      Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
      6f4eea90
    • Vincent Chen's avatar
      riscv: Add 3 SBI wrapper functions to get cpu manufacturer information · 183787c6
      Vincent Chen authored
      
      
      Add 3 wrapper functions to get vendor id, architecture id and implement id
      from M-mode
      
      Signed-off-by: default avatarVincent Chen <vincent.chen@sifive.com>
      Reviewed-by: default avatarAnup Patel <anup@brainfault.org>
      Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
      183787c6
  2. Mar 30, 2021
  3. Mar 17, 2021
  4. Mar 10, 2021
  5. Mar 06, 2021
    • Linus Torvalds's avatar
      Linux 5.12-rc2 · a38fd874
      Linus Torvalds authored
      a38fd874
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma · f3ed4de6
      Linus Torvalds authored
      Pull rdma fixes from Jason Gunthorpe:
       "Nothing special here, though Bob's regression fixes for rxe would have
        made it before the rc cycle had there not been such strong winter
        weather!
      
         - Fix corner cases in the rxe reference counting cleanup that are
           causing regressions in blktests for SRP
      
         - Two kdoc fixes so W=1 is clean
      
         - Missing error return in error unwind for mlx5
      
         - Wrong lock type nesting in IB CM"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma:
        RDMA/rxe: Fix errant WARN_ONCE in rxe_completer()
        RDMA/rxe: Fix extra deref in rxe_rcv_mcast_pkt()
        RDMA/rxe: Fix missed IB reference counting in loopback
        RDMA/uverbs: Fix kernel-doc warning of _uverbs_alloc
        RDMA/mlx5: Set correct kernel-doc identifier
        IB/mlx5: Add missing error code
        RDMA/rxe: Fix missing kconfig dependency on CRYPTO
        RDMA/cm: Fix IRQ restore in ib_send_cm_sidr_rep
      f3ed4de6
    • Linus Torvalds's avatar
      Merge tag 'gcc-plugins-v5.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux · de5bd6c5
      Linus Torvalds authored
      Pull gcc-plugins fixes from Kees Cook:
       "Tiny gcc-plugin fixes for v5.12-rc2. These issues are small but have
        been reported a couple times now by static analyzers, so best to get
        them fixed to reduce the noise. :)
      
         - Fix coding style issues (Jason Yan)"
      
      * tag 'gcc-plugins-v5.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
        gcc-plugins: latent_entropy: remove unneeded semicolon
        gcc-plugins: structleak: remove unneeded variable 'ret'
      de5bd6c5
    • Linus Torvalds's avatar
      Merge tag 'pstore-v5.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux · 8b24ef44
      Linus Torvalds authored
      Pull pstore fixes from Kees Cook:
      
       - Rate-limit ECC warnings (Dmitry Osipenko)
      
       - Fix error path check for NULL (Tetsuo Handa)
      
      * tag 'pstore-v5.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
        pstore/ram: Rate-limit "uncorrectable error in header" message
        pstore: Fix warning in pstore_kill_sb()
      8b24ef44
    • Linus Torvalds's avatar
      Merge tag 'for-5.12/dm-fixes' of... · 63dcd69d
      Linus Torvalds authored
      Merge tag 'for-5.12/dm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm
      
      Pull device mapper fixes from Mike Snitzer:
       "Fix DM verity target's optional Forward Error Correction (FEC) for
        Reed-Solomon roots that are unaligned to block size"
      
      * tag 'for-5.12/dm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
        dm verity: fix FEC for RS roots unaligned to block size
        dm bufio: subtract the number of initial sectors in dm_bufio_get_device_size
      63dcd69d
    • Linus Torvalds's avatar
      Merge tag 'block-5.12-2021-03-05' of git://git.kernel.dk/linux-block · 47454caf
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
      
       - NVMe fixes:
            - more device quirks (Julian Einwag, Zoltán Böszörményi, Pascal
              Terjan)
            - fix a hwmon error return (Daniel Wagner)
            - fix the keep alive timeout initialization (Martin George)
            - ensure the model_number can't be changed on a used subsystem
              (Max Gurtovoy)
      
       - rsxx missing -EFAULT on copy_to_user() failure (Dan)
      
       - rsxx remove unused linux.h include (Tian)
      
       - kill unused RQF_SORTED (Jean)
      
       - updated outdated BFQ comments (Joseph)
      
       - revert work-around commit for bd_size_lock, since we removed the
         offending user in this merge window (Damien)
      
      * tag 'block-5.12-2021-03-05' of git://git.kernel.dk/linux-block:
        nvmet: model_number must be immutable once set
        nvme-fabrics: fix kato initialization
        nvme-hwmon: Return error code when registration fails
        nvme-pci: add quirks for Lexar 256GB SSD
        nvme-pci: mark Kingston SKC2000 as not supporting the deepest power state
        nvme-pci: mark Seagate Nytro XM1440 as QUIRK_NO_NS_DESC_LIST.
        rsxx: Return -EFAULT if copy_to_user() fails
        block/bfq: update comments and default value in docs for fifo_expire
        rsxx: remove unused including <linux/version.h>
        block: Drop leftover references to RQF_SORTED
        block: revert "block: fix bd_size_lock use"
      47454caf
    • Linus Torvalds's avatar
      Merge tag 'io_uring-5.12-2021-03-05' of git://git.kernel.dk/linux-block · f292e873
      Linus Torvalds authored
      Pull io_uring fixes from Jens Axboe:
       "A bit of a mix between fallout from the worker change, cleanups and
        reductions now possible from that change, and fixes in general. In
        detail:
      
         - Fully serialize manager and worker creation, fixing races due to
           that.
      
         - Clean up some naming that had gone stale.
      
         - SQPOLL fixes.
      
         - Fix race condition around task_work rework that went into this
           merge window.
      
         - Implement unshare. Used for when the original task does unshare(2)
           or setuid/seteuid and friends, drops the original workers and forks
           new ones.
      
         - Drop the only remaining piece of state shuffling we had left, which
           was cred. Move it into issue instead, and we can drop all of that
           code too.
      
         - Kill f_op->flush() usage. That was such a nasty hack that we had
           out of necessity, we no longer need it.
      
         - Following from ->flush() removal, we can also drop various bits of
           ctx state related to SQPOLL and cancelations.
      
         - Fix an issue with IOPOLL retry, which originally was fallout from a
           filemap change (removing iov_iter_revert()), but uncovered an issue
           with iovec re-import too late.
      
         - Fix an issue with system suspend.
      
         - Use xchg() for fallback work, instead of cmpxchg().
      
         - Properly destroy io-wq on exec.
      
         - Add create_io_thread() core helper, and use that in io-wq and
           io_uring. This allows us to remove various silly completion events
           related to thread setup.
      
         - A few error handling fixes.
      
        This should be the grunt of fixes necessary for the new workers, next
        week should be quieter. We've got a pending series from Pavel on
        cancelations, and how tasks and rings are indexed. Outside of that,
        should just be minor fixes. Even with these fixes, we're still killing
        a net ~80 lines"
      
      * tag 'io_uring-5.12-2021-03-05' of git://git.kernel.dk/linux-block: (41 commits)
        io_uring: don't restrict issue_flags for io_openat
        io_uring: make SQPOLL thread parking saner
        io-wq: kill hashed waitqueue before manager exits
        io_uring: clear IOCB_WAITQ for non -EIOCBQUEUED return
        io_uring: don't keep looping for more events if we can't flush overflow
        io_uring: move to using create_io_thread()
        kernel: provide create_io_thread() helper
        io_uring: reliably cancel linked timeouts
        io_uring: cancel-match based on flags
        io-wq: ensure all pending work is canceled on exit
        io_uring: ensure that threads freeze on suspend
        io_uring: remove extra in_idle wake up
        io_uring: inline __io_queue_async_work()
        io_uring: inline io_req_clean_work()
        io_uring: choose right tctx->io_wq for try cancel
        io_uring: fix -EAGAIN retry with IOPOLL
        io-wq: fix error path leak of buffered write hash map
        io_uring: remove sqo_task
        io_uring: kill sqo_dead and sqo submission halting
        io_uring: ignore double poll add on the same waitqueue head
        ...
      f292e873
    • Linus Torvalds's avatar
      Merge tag 'pm-5.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 6d47254c
      Linus Torvalds authored
      Pull power management fixes from Rafael Wysocki:
       "These fix the usage of device links in the runtime PM core code and
        update the DTPM (Dynamic Thermal Power Management) feature added
        recently.
      
        Specifics:
      
         - Make the runtime PM core code avoid attempting to suspend supplier
           devices before updating the PM-runtime status of a consumer to
           'suspended' (Rafael Wysocki).
      
         - Fix DTPM (Dynamic Thermal Power Management) root node
           initialization and label that feature as EXPERIMENTAL in Kconfig
           (Daniel Lezcano)"
      
      * tag 'pm-5.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        powercap/drivers/dtpm: Add the experimental label to the option description
        powercap/drivers/dtpm: Fix root node initialization
        PM: runtime: Update device status before letting suppliers suspend
      6d47254c
    • Linus Torvalds's avatar
      Merge tag 'acpi-5.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · ea6be461
      Linus Torvalds authored
      Pull ACPI fix from Rafael Wysocki:
       "Make the empty stubs of some helper functions used when CONFIG_ACPI is
        not set actually match those functions (Andy Shevchenko)"
      
      * tag 'acpi-5.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        ACPI: bus: Constify is_acpi_node() and friends (part 2)
      ea6be461
    • Linus Torvalds's avatar
      Merge tag 'iommu-fixes-v5.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu · fc2c8d0a
      Linus Torvalds authored
      Pull iommu fixes from Joerg Roedel:
      
       - Fix a sleeping-while-atomic issue in the AMD IOMMU code
      
       - Disable lazy IOTLB flush for untrusted devices in the Intel VT-d
         driver
      
       - Fix status code definitions for Intel VT-d
      
       - Fix IO Page Fault issue in Tegra IOMMU driver
      
      * tag 'iommu-fixes-v5.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu:
        iommu/vt-d: Fix status code for Allocate/Free PASID command
        iommu: Don't use lazy flush for untrusted device
        iommu/tegra-smmu: Fix mc errors on tegra124-nyan
        iommu/amd: Fix sleeping in atomic in increase_address_space()
      fc2c8d0a
    • Linus Torvalds's avatar
      Merge tag 'for-5.12-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux · f09b04cc
      Linus Torvalds authored
      Pull btrfs fixes from David Sterba:
       "More regression fixes and stabilization.
      
        Regressions:
      
         - zoned mode
            - count zone sizes in wider int types
            - fix space accounting for read-only block groups
      
         - subpage: fix page tail zeroing
      
        Fixes:
      
         - fix spurious warning when remounting with free space tree
      
         - fix warning when creating a directory with smack enabled
      
         - ioctl checks for qgroup inheritance when creating a snapshot
      
         - qgroup
            - fix missing unlock on error path in zero range
            - fix amount of released reservation on error
            - fix flushing from unsafe context with open transaction,
              potentially deadlocking
      
         - minor build warning fixes"
      
      * tag 'for-5.12-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
        btrfs: zoned: do not account freed region of read-only block group as zone_unusable
        btrfs: zoned: use sector_t for zone sectors
        btrfs: subpage: fix the false data csum mismatch error
        btrfs: fix warning when creating a directory with smack enabled
        btrfs: don't flush from btrfs_delayed_inode_reserve_metadata
        btrfs: export and rename qgroup_reserve_meta
        btrfs: free correct amount of space in btrfs_delayed_inode_reserve_metadata
        btrfs: fix spurious free_space_tree remount warning
        btrfs: validate qgroup inherit for SNAP_CREATE_V2 ioctl
        btrfs: unlock extents in btrfs_zero_range in case of quota reservation errors
        btrfs: ref-verify: use 'inline void' keyword ordering
      f09b04cc