Merge tag 'riscv-for-linus-4.16-merge_window' of git://git.kernel.org/pub/scm/linux...
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 7 Feb 2018 19:33:08 +0000 (11:33 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 7 Feb 2018 19:33:08 +0000 (11:33 -0800)
Pull RISC-V updates from Palmer Dabbelt:
 "This contains the fixes we'd like to target for the 4.16 merge window.
  It's not as much as I was originally hoping to do but between glibc,
  the chip, and FOSDEM there just wasn't enough time to get everything
  put together. As such, this merge window is essentially just going to
  be small changes. This includes mostly cleanups:

   - A build fix failure to the audit test cases.

     RISC-V doesn't have renameat because the generic syscall ABI moved
     to renameat2 by the time of our port. The syscall audit test cases
     don't understand this, so I added a trivial fix. This went through
     mailing list review during the 4.15 merge window, but nobody has
     picked it up so I think it's best to just do this here.

   - The removal of our command-line argument processing code. The
     "mem_end" stuff was broken and the rest duplicated generic device
     tree code. The generic code was already being called.

   - Some unused/redundant code has been removed, including
     __ARCH_HAVE_MMU, current_pgdir, and the initialization of
     init_mm.pgd.

   - SUM is disabled upon taking a trap, which means that user memory is
     protected during traps taking inside copy_{to,from}_user().

   - The sptbr CSR has been renamed to satp in C code. We haven't
     changed the assembly code in order to maintain compatibility with
     binutils 2.29, which doesn't understand the new name.

  Additionally, we're adding some new features:

   - Basic ftrace support, thanks to Alan Kao!

   - Support for ZONE_DMA32.

     This is necessary for all the normal reasons, but also to deal with
     a deficiency in the Xilinx PCIe controller we're using on our
     FPGA-based systems. While the ZONE_DMA32 addition should be
     sufficient for most uses, it doesn't complete the fix for the
     Xilinx controller.

   - TLB shootdowns now only target the harts where they're necessary,
     instead of applying to all harts in the system.

  These patches have all been sitting on our linux-next branch for a
  while now. Due to time constraints this is all I feel comfortable
  submitting during the 4.16 merge window, hopefully we'll do better
  next time!"

[ Note to self: "harts" is RISC-V speak for "hardware threads".  I had
  to look that up.    - Linus ]

* tag 'riscv-for-linus-4.16-merge_window' of git://git.kernel.org/pub/scm/linux/kernel/git/palmer/riscv-linux:
  riscv: inline set_pgdir into its only caller
  riscv: rename sptbr to satp
  riscv: don't read back satp in paging_init
  riscv: remove the unused current_pgdir function
  riscv: add ZONE_DMA32
  RISC-V: Limit the scope of TLB shootdowns
  riscv: disable SUM in the exception handler
  riscv: remove redundant unlikely()
  riscv: remove unused __ARCH_HAVE_MMU define
  riscv/ftrace: Add basic support
  RISC-V: Remove mem_end command line processing
  RISC-V: Remove duplicate command-line parsing logic
  audit: Avoid build failures on systems without renameat

1  2 
arch/riscv/Kconfig
arch/riscv/include/asm/Kbuild
arch/riscv/mm/fault.c

diff --combined arch/riscv/Kconfig
@@@ -22,6 -22,7 +22,7 @@@ config RISC
        select GENERIC_ATOMIC64 if !64BIT || !RISCV_ISA_A
        select ARCH_WANT_OPTIONAL_GPIOLIB
        select HAVE_MEMBLOCK
+       select HAVE_MEMBLOCK_NODE_MAP
        select HAVE_DMA_API_DEBUG
        select HAVE_DMA_CONTIGUOUS
        select HAVE_GENERIC_DMA_COHERENT
@@@ -43,6 -44,10 +44,10 @@@ config MM
  config ARCH_PHYS_ADDR_T_64BIT
        def_bool y
  
+ config ZONE_DMA32
+       bool
+       default y
  config ARCH_DMA_ADDR_T_64BIT
        def_bool y
  
@@@ -55,6 -60,9 +60,9 @@@ config PAGE_OFFSE
  config STACKTRACE_SUPPORT
        def_bool y
  
+ config TRACE_IRQFLAGS_SUPPORT
+       def_bool y
  config RWSEM_GENERIC_SPINLOCK
        def_bool y
  
@@@ -83,7 -91,7 +91,7 @@@ config PGTABLE_LEVEL
  config HAVE_KPROBES
        def_bool n
  
 -config DMA_NOOP_OPS
 +config DMA_DIRECT_OPS
        def_bool y
  
  menu "Platform type"
@@@ -107,6 -115,8 +115,8 @@@ config ARCH_RV64
        bool "RV64I"
        select CPU_SUPPORTS_64BIT_KERNEL
        select 64BIT
+       select HAVE_FUNCTION_TRACER
+       select HAVE_FUNCTION_GRAPH_TRACER
  
  endchoice
  
@@@ -1,18 -1,17 +1,17 @@@
  generic-y += bugs.h
  generic-y += cacheflush.h
  generic-y += checksum.h
 -generic-y += clkdev.h
  generic-y += cputime.h
  generic-y += device.h
  generic-y += div64.h
  generic-y += dma.h
  generic-y += dma-contiguous.h
 +generic-y += dma-mapping.h
  generic-y += emergency-restart.h
  generic-y += errno.h
  generic-y += exec.h
  generic-y += fb.h
  generic-y += fcntl.h
- generic-y += ftrace.h
  generic-y += futex.h
  generic-y += hardirq.h
  generic-y += hash.h
diff --combined arch/riscv/mm/fault.c
@@@ -29,6 -29,7 +29,6 @@@
  
  #include <asm/pgalloc.h>
  #include <asm/ptrace.h>
 -#include <asm/uaccess.h>
  
  /*
   * This routine handles page faults.  It determines the address and the
@@@ -238,6 -239,10 +238,10 @@@ vmalloc_fault
                 * Do _not_ use "tsk->active_mm->pgd" here.
                 * We might be inside an interrupt in the middle
                 * of a task switch.
+                *
+                * Note: Use the old spbtr name instead of using the current
+                * satp name to support binutils 2.29 which doesn't know about
+                * the privileged ISA 1.10 yet.
                 */
                index = pgd_index(addr);
                pgd = (pgd_t *)pfn_to_virt(csr_read(sptbr)) + index;