1. 12 10月, 2019 1 次提交
    • V
      riscv: Avoid interrupts being erroneously enabled in handle_exception() · d286a374
      Vincent Chen 提交于
      [ Upstream commit c82dd6d078a2bb29d41eda032bb96d05699a524d ]
      
      When the handle_exception function addresses an exception, the interrupts
      will be unconditionally enabled after finishing the context save. However,
      It may erroneously enable the interrupts if the interrupts are disabled
      before entering the handle_exception.
      
      For example, one of the WARN_ON() condition is satisfied in the scheduling
      where the interrupt is disabled and rq.lock is locked. The WARN_ON will
      trigger a break exception and the handle_exception function will enable the
      interrupts before entering do_trap_break function. During the procedure, if
      a timer interrupt is pending, it will be taken when interrupts are enabled.
      In this case, it may cause a deadlock problem if the rq.lock is locked
      again in the timer ISR.
      
      Hence, the handle_exception() can only enable interrupts when the state of
      sstatus.SPIE is 1.
      
      This patch is tested on HiFive Unleashed board.
      Signed-off-by: NVincent Chen <vincent.chen@sifive.com>
      Reviewed-by: NPalmer Dabbelt <palmer@sifive.com>
      [paul.walmsley@sifive.com: updated to apply]
      Fixes: bcae803a ("RISC-V: Enable IRQ during exception handling")
      Cc: David Abdurachmanov <david.abdurachmanov@sifive.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NPaul Walmsley <paul.walmsley@sifive.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      d286a374
  2. 16 9月, 2019 1 次提交
  3. 25 8月, 2019 1 次提交
  4. 14 7月, 2019 1 次提交
  5. 25 6月, 2019 1 次提交
  6. 08 5月, 2019 1 次提交
    • A
      riscv: fix accessing 8-byte variable from RV32 · bc031095
      Alan Kao 提交于
      [ Upstream commit dbee9c9c45846f003ec2f819710c2f4835630a6a ]
      
      A memory save operation to 8-byte variable in RV32 is divided into
      two sw instructions in the put_user macro.  The current fixup returns
      execution flow to the second sw instead of the one after it.
      
      This patch fixes this fixup code according to the load access part.
      
      Signed-off-by: Alan Kao<alankao@andestech.com>
      Cc: Greentime Hu <greentime@andestech.com>
      Cc: Vincent Chen <deanbo422@gmail.com>
      Signed-off-by: NPalmer Dabbelt <palmer@sifive.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      bc031095
  7. 17 4月, 2019 1 次提交
  8. 14 3月, 2019 2 次提交
  9. 20 2月, 2019 2 次提交
  10. 13 12月, 2018 1 次提交
  11. 06 12月, 2018 1 次提交
  12. 01 12月, 2018 2 次提交
    • O
      RISC-V: Silence some module warnings on 32-bit · 021e2f3f
      Olof Johansson 提交于
      [ Upstream commit ef3a61406618291c46da168ff91acaa28d85944c ]
      
      Fixes:
      
      arch/riscv/kernel/module.c: In function 'apply_r_riscv_32_rela':
      ./include/linux/kern_levels.h:5:18: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 3 has type 'Elf32_Addr' {aka 'unsigned int'} [-Wformat=]
      arch/riscv/kernel/module.c:23:27: note: format string is defined here
      arch/riscv/kernel/module.c: In function 'apply_r_riscv_pcrel_hi20_rela':
      ./include/linux/kern_levels.h:5:18: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 3 has type 'Elf32_Addr' {aka 'unsigned int'} [-Wformat=]
      arch/riscv/kernel/module.c:104:23: note: format string is defined here
      arch/riscv/kernel/module.c: In function 'apply_r_riscv_hi20_rela':
      ./include/linux/kern_levels.h:5:18: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 3 has type 'Elf32_Addr' {aka 'unsigned int'} [-Wformat=]
      arch/riscv/kernel/module.c:146:23: note: format string is defined here
      arch/riscv/kernel/module.c: In function 'apply_r_riscv_got_hi20_rela':
      ./include/linux/kern_levels.h:5:18: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 3 has type 'Elf32_Addr' {aka 'unsigned int'} [-Wformat=]
      arch/riscv/kernel/module.c:190:60: note: format string is defined here
      arch/riscv/kernel/module.c: In function 'apply_r_riscv_call_plt_rela':
      ./include/linux/kern_levels.h:5:18: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 3 has type 'Elf32_Addr' {aka 'unsigned int'} [-Wformat=]
      arch/riscv/kernel/module.c:214:24: note: format string is defined here
      arch/riscv/kernel/module.c: In function 'apply_r_riscv_call_rela':
      ./include/linux/kern_levels.h:5:18: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 3 has type 'Elf32_Addr' {aka 'unsigned int'} [-Wformat=]
      arch/riscv/kernel/module.c:236:23: note: format string is defined here
      Signed-off-by: NOlof Johansson <olof@lixom.net>
      Signed-off-by: NPalmer Dabbelt <palmer@sifive.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      021e2f3f
    • D
      riscv: add missing vdso_install target · fc9b1d7f
      David Abdurachmanov 提交于
      [ Upstream commit f157d411a9eb170d2ee6b766da7a381962017cc9 ]
      
      Building kernel 4.20 for Fedora as RPM fails, because riscv is missing
      vdso_install target in arch/riscv/Makefile.
      Signed-off-by: NDavid Abdurachmanov <david.abdurachmanov@gmail.com>
      Signed-off-by: NPalmer Dabbelt <palmer@sifive.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      fc9b1d7f
  13. 27 11月, 2018 1 次提交
    • O
      RISC-V: Fix raw_copy_{to,from}_user() · a0d5f816
      Olof Johansson 提交于
      commit 21f70d4abf9e17c2e3d7e64b7bfa3424e017f176 upstream.
      
      Sparse highlighted it, and appears to be a pure bug (from vs to).
      
      ./arch/riscv/include/asm/uaccess.h:403:35: warning: incorrect type in argument 1 (different address spaces)
      ./arch/riscv/include/asm/uaccess.h:403:39: warning: incorrect type in argument 2 (different address spaces)
      ./arch/riscv/include/asm/uaccess.h:409:37: warning: incorrect type in argument 1 (different address spaces)
      ./arch/riscv/include/asm/uaccess.h:409:41: warning: incorrect type in argument 2 (different address spaces)
      Signed-off-by: NOlof Johansson <olof@lixom.net>
      Cc: stable@vger.kernel.org
      Signed-off-by: NPalmer Dabbelt <palmer@sifive.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a0d5f816
  14. 03 10月, 2018 1 次提交
  15. 25 9月, 2018 1 次提交
    • J
      RISC-V: include linux/ftrace.h in asm-prototypes.h · 57a48978
      James Cowgill 提交于
      Building a riscv kernel with CONFIG_FUNCTION_TRACER and
      CONFIG_MODVERSIONS enabled results in these two warnings:
      
        MODPOST vmlinux.o
      WARNING: EXPORT symbol "return_to_handler" [vmlinux] version generation failed, symbol will not be versioned.
      WARNING: EXPORT symbol "_mcount" [vmlinux] version generation failed, symbol will not be versioned.
      
      When exporting symbols from an assembly file, the MODVERSIONS code
      requires their prototypes to be defined in asm-prototypes.h (see
      scripts/Makefile.build). Since both of these symbols have prototypes
      defined in linux/ftrace.h, include this header from RISC-V's
      asm-prototypes.h.
      Reported-by: NKarsten Merker <merker@debian.org>
      Signed-off-by: NJames Cowgill <jcowgill@debian.org>
      Signed-off-by: NPalmer Dabbelt <palmer@sifive.com>
      57a48978
  16. 05 9月, 2018 1 次提交
  17. 29 8月, 2018 2 次提交
  18. 24 8月, 2018 1 次提交
  19. 21 8月, 2018 3 次提交
    • D
      riscv: Delete asm/compat.h · 66eb957d
      Deepa Dinamani 提交于
      riscv does not enable CONFIG_COMPAT in default configurations:
      defconfig, allmodconfig and allnoconfig.
      Remove the asm/compat.h as it does not seem to add any value to
      the architecture without CONFIG_COMPAT.
      
      Now that time compat syscalls are being reused in non CONFIG_COMPAT
      modes, asm-generic/compat.h provides definitions for riscv 32 bit
      mode.
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NDeepa Dinamani <deepa.kernel@gmail.com>
      Cc: palmer@sifive.com
      Cc: linux-riscv@lists.infradead.org
      Signed-off-by: NPalmer Dabbelt <palmer@sifive.com>
      66eb957d
    • P
      RISC-V: Don't use a global include guard for uapi/asm/syscalls.h · e45c7aca
      Palmer Dabbelt 提交于
      This file is expected to be included multiple times in the same file in
      order to allow the __SYSCALL macro to generate system call tables.  With
      a global include guard we end up missing __NR_riscv_flush_icache in the
      syscall table, which results in icache flushes that escape the vDSO call
      to not actually do anything.
      
      The fix is to move to per-#define include guards, which allows the
      system call tables to actually be populated.  Thanks to Macrus Comstedt
      for finding and fixing the bug!
      
      Cc: Marcus Comstedt <marcus@mc.pp.se>
      Signed-off-by: NPalmer Dabbelt <palmer@sifive.com>
      e45c7aca
    • P
      RISC-V: Define sys_riscv_flush_icache when SMP=n · 7847e705
      Palmer Dabbelt 提交于
      This would be necessary to make non-SMP builds work, but there is
      another error in the implementation of our syscall linkage that actually
      just causes sys_riscv_flush_icache to never build.  I've build tested
      this on allnoconfig and allnoconfig+SMP=y, as well as defconfig like
      normal.
      
      CC: Christoph Hellwig <hch@infradead.org>
      CC: Guenter Roeck <linux@roeck-us.net>
      In-Reply-To: <20180809055830.GA17533@infradead.org>
      In-Reply-To: <20180809132612.GA31058@roeck-us.net>
      Signed-off-by: NPalmer Dabbelt <palmer@sifive.com>
      7847e705
  20. 18 8月, 2018 1 次提交
    • S
      mm: convert return type of handle_mm_fault() caller to vm_fault_t · 50a7ca3c
      Souptick Joarder 提交于
      Use new return type vm_fault_t for fault handler.  For now, this is just
      documenting that the function returns a VM_FAULT value rather than an
      errno.  Once all instances are converted, vm_fault_t will become a
      distinct type.
      
      Ref-> commit 1c8f4220 ("mm: change return type to vm_fault_t")
      
      In this patch all the caller of handle_mm_fault() are changed to return
      vm_fault_t type.
      
      Link: http://lkml.kernel.org/r/20180617084810.GA6730@jordon-HP-15-Notebook-PCSigned-off-by: NSouptick Joarder <jrdr.linux@gmail.com>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Richard Kuo <rkuo@codeaurora.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: James Hogan <jhogan@kernel.org>
      Cc: Ley Foon Tan <lftan@altera.com>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: James E.J. Bottomley <jejb@parisc-linux.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Palmer Dabbelt <palmer@sifive.com>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Guan Xuetao <gxt@pku.edu.cn>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      50a7ca3c
  21. 13 8月, 2018 13 次提交
  22. 02 8月, 2018 1 次提交