1. Mar 18, 2018
  2. Mar 07, 2018
  3. Jan 31, 2018
    • Andrew Waterman's avatar
      RISC-V: Limit the scope of TLB shootdowns · f1b65f20
      Andrew Waterman authored
      
      
      RISC-V systems perform TLB shootdows via the SBI, which currently
      performs an IPI to each of the remote harts which then performs a local
      TLB flush.  This process is a bit on the slow side, but we can at least
      speed it up for some common cases by restricting the set of harts to
      shoot down to the actual set of harts that are currently participating
      in the given mm context, as opposed to the entire system.
      
      This should provide a measurable performance increase, but we haven't
      measured it.  Regardless, it seems like obviously the right thing to do
      here.
      
      Signed-off-by: default avatarAndrew Waterman <andrew@sifive.com>
      Signed-off-by: default avatarPalmer Dabbelt <palmer@dabbelt.com>
      f1b65f20
    • Christoph Hellwig's avatar
      riscv: disable SUM in the exception handler · fe9b842f
      Christoph Hellwig authored
      
      
      The SUM bit is enabled at the beginning of the copy_{to,from}_user and
      {get,put}_user routines, and cleared before they return.  But these user
      copy helper can be interrupted by exceptions, in which case the SUM bit
      will remain set, which leads to elevated privileges for the code running
      in exception context, as that can now access userspace address space
      unconditionally.  This frequently happens when the user copy routines
      access freshly allocated user memory that hasn't been faulted in, and a
      pagefault needs to be taken before the user copy routines can continue.
      
      Fix this by unconditionally clearing SUM when the exception handler is
      called - the restore code will automatically restore it based on the
      saved value.
      
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarPalmer Dabbelt <palmer@sifive.com>
      fe9b842f
    • Tobias Klauser's avatar
      riscv: remove redundant unlikely() · 509009cc
      Tobias Klauser authored
      
      
      IS_ERR_VALUE() already implies unlikely(), so it can be omitted.
      
      Signed-off-by: default avatarTobias Klauser <tklauser@distanz.ch>
      Signed-off-by: default avatarPalmer Dabbelt <palmer@sifive.com>
      509009cc
    • Tobias Klauser's avatar
      riscv: remove unused __ARCH_HAVE_MMU define · 0b5030c8
      Tobias Klauser authored
      
      
      The __ARCH_HAVE_MMU define is (and was) used nowhere in the tree and
      also doesn't appear to be used by any libc.
      
      Signed-off-by: default avatarTobias Klauser <tklauser@distanz.ch>
      Signed-off-by: default avatarPalmer Dabbelt <palmer@sifive.com>
      0b5030c8
    • Alan Kao's avatar
      riscv/ftrace: Add basic support · 10626c32
      Alan Kao authored
      
      
      This patch contains basic ftrace support for RV64I platform.
      Specifically, function tracer (HAVE_FUNCTION_TRACER), function graph
      tracer (HAVE_FUNCTION_GRAPH_TRACER), and a frame pointer test
      (HAVE_FUNCTION_GRAPH_FP_TEST) are implemented following the
      instructions in Documentation/trace/ftrace-design.txt.
      
      Note that the functions in both ftrace.c and setup.c should not be
      hooked with the compiler's -pg option: to prevent infinite self-
      referencing for the former, and to ignore early setup stuff for the
      latter.
      
      Signed-off-by: default avatarAlan Kao <alankao@andestech.com>
      Signed-off-by: default avatarPalmer Dabbelt <palmer@sifive.com>
      10626c32
    • Palmer Dabbelt's avatar
      RISC-V: Remove mem_end command line processing · 5d44bf20
      Palmer Dabbelt authored
      
      
      This is just some cruft left over from before the port converted to
      device tree.  The right way to handle memory regions is to specify them
      in the device tree, which BBL (our simplest bootloader) is already
      capable of doing.  This patch simply removes the cruft.
      
      Signed-off-by: default avatarPalmer Dabbelt <palmer@sifive.com>
      5d44bf20
    • Michael Clark's avatar
      RISC-V: Remove duplicate command-line parsing logic · 3e076a7e
      Michael Clark authored
      
      
      builtin_cmdline handling is present in drivers/of/fdt.c so the
      duplicate logic in arch/riscv/setup.c results in duplication of
      the builtin command line. e.g. CONFIG_CMDLINE="root=/dev/vda ro"
      gets appended twice and gives "root=/dev/vda ro root=/dev/vda ro"
      
      Before this patch:
      
      [    0.000000] Kernel command line: root=/dev/vda ro root=/dev/vda ro
      
      After this patch:
      
      [    0.000000] Kernel command line: root=/dev/vda ro
      
      Signed-off-by: default avatarMichael Clark <mjc@sifive.com>
      Signed-off-by: default avatarPalmer Dabbelt <palmer@sifive.com>
      3e076a7e