1. 07 1月, 2020 3 次提交
  2. 06 1月, 2020 13 次提交
  3. 05 1月, 2020 5 次提交
  4. 03 1月, 2020 5 次提交
  5. 30 12月, 2019 1 次提交
  6. 28 12月, 2019 3 次提交
    • O
      riscv: export flush_icache_all to modules · 1833e327
      Olof Johansson 提交于
      This is needed by LKDTM (crash dump test module), it calls
      flush_icache_range(), which on RISC-V turns into flush_icache_all(). On
      other architectures, the actual implementation is exported, so follow
      that precedence and export it here too.
      
      Fixes build of CONFIG_LKDTM that fails with:
      ERROR: "flush_icache_all" [drivers/misc/lkdtm/lkdtm.ko] undefined!
      Signed-off-by: NOlof Johansson <olof@lixom.net>
      Signed-off-by: NPaul Walmsley <paul.walmsley@sifive.com>
      1833e327
    • D
      riscv: reject invalid syscalls below -1 · 556f47ac
      David Abdurachmanov 提交于
      Running "stress-ng --enosys 4 -t 20 -v" showed a large number of kernel oops
      with "Unable to handle kernel paging request at virtual address" message. This
      happens when enosys stressor starts testing random non-valid syscalls.
      
      I forgot to redirect any syscall below -1 to sys_ni_syscall.
      
      With the patch kernel oops messages are gone while running stress-ng enosys
      stressor.
      Signed-off-by: NDavid Abdurachmanov <david.abdurachmanov@sifive.com>
      Fixes: 5340627e ("riscv: add support for SECCOMP and SECCOMP_FILTER")
      Signed-off-by: NPaul Walmsley <paul.walmsley@sifive.com>
      556f47ac
    • L
      riscv: fix compile failure with EXPORT_SYMBOL() & !MMU · 4d47ce15
      Luc Van Oostenryck 提交于
      When support for !MMU was added, the declaration of
      __asm_copy_to_user() & __asm_copy_from_user() were #ifdefed
      out hence their EXPORT_SYMBOL() give an error message like:
        .../riscv_ksyms.c:13:15: error: '__asm_copy_to_user' undeclared here
        .../riscv_ksyms.c:14:15: error: '__asm_copy_from_user' undeclared here
      
      Since these symbols are not defined with !MMU it's wrong to export them.
      Same for __clear_user() (even though this one is also declared in
      include/asm-generic/uaccess.h and thus doesn't give an error message).
      
      Fix this by doing the EXPORT_SYMBOL() directly where these symbols
      are defined: inside lib/uaccess.S itself.
      
      Fixes: 6bd33e1e ("riscv: fix compile failure with EXPORT_SYMBOL() & !MMU")
      Reported-by: Nkbuild test robot <lkp@intel.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Palmer Dabbelt <palmer@dabbelt.com>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Signed-off-by: NLuc Van Oostenryck <luc.vanoostenryck@gmail.com>
      Signed-off-by: NPaul Walmsley <paul.walmsley@sifive.com>
      4d47ce15
  7. 23 12月, 2019 1 次提交
    • M
      powerpc/mm: Mark get_slice_psize() & slice_addr_is_low() as notrace · 91a063c9
      Michael Ellerman 提交于
      These slice routines are called from the SLB miss handler, which can
      lead to warnings from the IRQ code, because we have not reconciled the
      IRQ state properly:
      
        WARNING: CPU: 72 PID: 30150 at arch/powerpc/kernel/irq.c:258 arch_local_irq_restore.part.0+0xcc/0x100
        Modules linked in:
        CPU: 72 PID: 30150 Comm: ftracetest Not tainted 5.5.0-rc2-gcc9x-g7e0165b2 #1
        NIP:  c00000000001d83c LR: c00000000029ab90 CTR: c00000000026cf90
        REGS: c0000007eee3b960 TRAP: 0700   Not tainted  (5.5.0-rc2-gcc9x-g7e0165b2)
        MSR:  8000000000021033 <SF,ME,IR,DR,RI,LE>  CR: 22242844  XER: 20000000
        CFAR: c00000000001d780 IRQMASK: 0
        ...
        NIP arch_local_irq_restore.part.0+0xcc/0x100
        LR  trace_graph_entry+0x270/0x340
        Call Trace:
          trace_graph_entry+0x254/0x340 (unreliable)
          function_graph_enter+0xe4/0x1a0
          prepare_ftrace_return+0xa0/0x130
          ftrace_graph_caller+0x44/0x94	# (get_slice_psize())
          slb_allocate_user+0x7c/0x100
          do_slb_fault+0xf8/0x300
          instruction_access_slb_common+0x140/0x180
      
      Fixes: 48e7b769 ("powerpc/64s/hash: Convert SLB miss handlers to C")
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20191221121337.4894-1-mpe@ellerman.id.au
      91a063c9
  8. 21 12月, 2019 3 次提交
  9. 20 12月, 2019 4 次提交
  10. 19 12月, 2019 2 次提交
    • A
      MIPS: BPF: eBPF JIT: check for MIPS ISA compliance in Kconfig · f596cf0d
      Alexander Lobakin 提交于
      It is completely wrong to check for compile-time MIPS ISA revision in
      the body of bpf_int_jit_compile() as it may lead to get MIPS JIT fully
      omitted by the CC while the rest system will think that the JIT is
      actually present and works [1].
      We can check if the selected CPU really supports MIPS eBPF JIT at
      configure time and avoid such situations when kernel can be built
      without both JIT and interpreter, but with CONFIG_BPF_SYSCALL=y.
      
      [1] https://lore.kernel.org/linux-mips/09d713a59665d745e21d021deeaebe0a@dlink.ru/
      
      Fixes: 716850ab ("MIPS: eBPF: Initial eBPF support for MIPS32 architecture.")
      Cc: <stable@vger.kernel.org> # v5.2+
      Signed-off-by: NAlexander Lobakin <alobakin@dlink.ru>
      Signed-off-by: NPaul Burton <paulburton@kernel.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: James Hogan <jhogan@kernel.org>
      Cc: Hassan Naveed <hnaveed@wavecomp.com>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: Martin KaFai Lau <kafai@fb.com>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Yonghong Song <yhs@fb.com>
      Cc: Andrii Nakryiko <andriin@fb.com>
      Cc: linux-mips@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Cc: netdev@vger.kernel.org
      Cc: bpf@vger.kernel.org
      f596cf0d
    • P
      MIPS: BPF: Disable MIPS32 eBPF JIT · f8fffebd
      Paul Burton 提交于
      Commit 716850ab ("MIPS: eBPF: Initial eBPF support for MIPS32
      architecture.") enabled our eBPF JIT for MIPS32 kernels, whereas it has
      previously only been availailable for MIPS64. It was my understanding at
      the time that the BPF test suite was passing & JITing a comparable
      number of tests to our cBPF JIT [1], but it turns out that was not the
      case.
      
      The eBPF JIT has a number of problems on MIPS32:
      
      - Most notably various code paths still result in emission of MIPS64
        instructions which will cause reserved instruction exceptions & kernel
        panics when run on MIPS32 CPUs.
      
      - The eBPF JIT doesn't account for differences between the O32 ABI used
        by MIPS32 kernels versus the N64 ABI used by MIPS64 kernels. Notably
        arguments beyond the first 4 are passed on the stack in O32, and this
        is entirely unhandled when JITing a BPF_CALL instruction. Stack space
        must be reserved for arguments even if they all fit in registers, and
        the callee is free to assume that stack space has been reserved for
        its use - with the eBPF JIT this is not the case, so calling any
        function can result in clobbering values on the stack & unpredictable
        behaviour. Function arguments in eBPF are always 64-bit values which
        is also entirely unhandled - the JIT still uses a single (32-bit)
        register per argument. As a result all function arguments are always
        passed incorrectly when JITing a BPF_CALL instruction, leading to
        kernel crashes or strange behavior.
      
      - The JIT attempts to bail our on use of ALU64 instructions or 64-bit
        memory access instructions. The code doing this at the start of
        build_one_insn() incorrectly checks whether BPF_OP() equals BPF_DW,
        when it should really be checking BPF_SIZE() & only doing so when
        BPF_CLASS() is one of BPF_{LD,LDX,ST,STX}. This results in false
        positives that cause more bailouts than intended, and that in turns
        hides some of the problems described above.
      
      - The kernel's cBPF->eBPF translation makes heavy use of 64-bit eBPF
        instructions that the MIPS32 eBPF JIT bails out on, leading to most
        cBPF programs not being JITed at all.
      
      Until these problems are resolved, revert the enabling of the eBPF JIT
      on MIPS32 done by commit 716850ab ("MIPS: eBPF: Initial eBPF support
      for MIPS32 architecture.").
      
      Note that this does not undo the changes made to the eBPF JIT by that
      commit, since they are a useful starting point to providing MIPS32
      support - they're just not nearly complete.
      
      [1] https://lore.kernel.org/linux-mips/MWHPR2201MB13583388481F01A422CE7D66D4410@MWHPR2201MB1358.namprd22.prod.outlook.com/Signed-off-by: NPaul Burton <paulburton@kernel.org>
      Fixes: 716850ab ("MIPS: eBPF: Initial eBPF support for MIPS32 architecture.")
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: Hassan Naveed <hnaveed@wavecomp.com>
      Cc: Tony Ambardar <itugrok@yahoo.com>
      Cc: bpf@vger.kernel.org
      Cc: netdev@vger.kernel.org
      Cc: <stable@vger.kernel.org> # v5.2+
      Cc: linux-mips@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      f8fffebd