1. 02 8月, 2018 2 次提交
  2. 05 7月, 2018 8 次提交
  3. 12 6月, 2018 4 次提交
  4. 10 6月, 2018 1 次提交
    • L
      riscv: split the declaration of __copy_user · 86406d51
      Luc Van Oostenryck 提交于
      We use a single __copy_user assembly function to copy memory both from
      and to userspace. While this works, it triggers sparse errors because
      we're implicitly casting between the kernel and user address spaces by
      calling __copy_user.
      
      This patch splits the C declaration into a pair of functions,
      __asm_copy_{to,from}_user, that have sane semantics WRT __user. This
      split make things fine from sparse's point of view. The assembly
      implementation keeps a single definition but add a double ENTRY() for it,
      one for __asm_copy_to_user and another one for __asm_copy_from_user.
      The result is a spare-safe implementation that pays no performance
      or code size penalty.
      Signed-off-by: NLuc Van Oostenryck <luc.vanoostenryck@gmail.com>
      Signed-off-by: NPalmer Dabbelt <palmer@sifive.com>
      86406d51
  5. 08 6月, 2018 1 次提交
    • L
      mm: introduce ARCH_HAS_PTE_SPECIAL · 3010a5ea
      Laurent Dufour 提交于
      Currently the PTE special supports is turned on in per architecture
      header files.  Most of the time, it is defined in
      arch/*/include/asm/pgtable.h depending or not on some other per
      architecture static definition.
      
      This patch introduce a new configuration variable to manage this
      directly in the Kconfig files.  It would later replace
      __HAVE_ARCH_PTE_SPECIAL.
      
      Here notes for some architecture where the definition of
      __HAVE_ARCH_PTE_SPECIAL is not obvious:
      
      arm
       __HAVE_ARCH_PTE_SPECIAL which is currently defined in
      arch/arm/include/asm/pgtable-3level.h which is included by
      arch/arm/include/asm/pgtable.h when CONFIG_ARM_LPAE is set.
      So select ARCH_HAS_PTE_SPECIAL if ARM_LPAE.
      
      powerpc
      __HAVE_ARCH_PTE_SPECIAL is defined in 2 files:
       - arch/powerpc/include/asm/book3s/64/pgtable.h
       - arch/powerpc/include/asm/pte-common.h
      The first one is included if (PPC_BOOK3S & PPC64) while the second is
      included in all the other cases.
      So select ARCH_HAS_PTE_SPECIAL all the time.
      
      sparc:
      __HAVE_ARCH_PTE_SPECIAL is defined if defined(__sparc__) &&
      defined(__arch64__) which are defined through the compiler in
      sparc/Makefile if !SPARC32 which I assume to be if SPARC64.
      So select ARCH_HAS_PTE_SPECIAL if SPARC64
      
      There is no functional change introduced by this patch.
      
      Link: http://lkml.kernel.org/r/1523433816-14460-2-git-send-email-ldufour@linux.vnet.ibm.comSigned-off-by: NLaurent Dufour <ldufour@linux.vnet.ibm.com>
      Suggested-by: NJerome Glisse <jglisse@redhat.com>
      Reviewed-by: NJerome Glisse <jglisse@redhat.com>
      Acked-by: NDavid Rientjes <rientjes@google.com>
      Cc: Michal Hocko <mhocko@kernel.org>
      Cc: "Aneesh Kumar K . V" <aneesh.kumar@linux.vnet.ibm.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Cc: Rich Felker <dalias@libc.org>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: Palmer Dabbelt <palmer@sifive.com>
      Cc: Albert Ou <albert@sifive.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: Christophe LEROY <christophe.leroy@c-s.fr>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      3010a5ea
  6. 07 6月, 2018 2 次提交
  7. 05 6月, 2018 2 次提交
    • A
      perf: riscv: preliminary RISC-V support · 178e9fc4
      Alan Kao 提交于
      This patch provide a basic PMU, riscv_base_pmu, which supports two
      general hardware event, instructions and cycles.  Furthermore, this
      PMU serves as a reference implementation to ease the portings in
      the future.
      
      riscv_base_pmu should be able to run on any RISC-V machine that
      conforms to the Priv-Spec.  Note that the latest qemu model hasn't
      fully support a proper behavior of Priv-Spec 1.10 yet, but work
      around should be easy with very small fixes.  Please check
      https://github.com/riscv/riscv-qemu/pull/115 for future updates.
      
      Cc: Nick Hu <nickhu@andestech.com>
      Cc: Greentime Hu <greentime@andestech.com>
      Signed-off-by: NAlan Kao <alankao@andestech.com>
      Signed-off-by: NPalmer Dabbelt <palmer@sifive.com>
      178e9fc4
    • A
      riscv: Fix the bug in memory access fixup code · ebcbd75e
      Alan Kao 提交于
      A piece of fixup code is currently shared by __copy_user and
      __clear_user.  It first disables the access to user-space memory
      and then returns the "n" argument, which represents #(bytes not processed).
      However,__copy_user's "n" is in register a2, while __clear_user's in a1,
      and thus it causes errors for programs like setdomainname02 testcase in LTP.
      
      This patch fixes this issue by separating their fixup code and returning
      the right value for the kernel to handle a relative fault properly.
      Signed-off-by: NAlan Kao <alankao@andestech.com>
      Cc: Greentime Hu <greentime@andestech.com>
      Cc: Zong Li <zong@andestech.com>
      Cc: Vincent Chen <vincentc@andestech.com>
      Signed-off-by: NPalmer Dabbelt <palmer@sifive.com>
      ebcbd75e
  8. 19 5月, 2018 3 次提交
  9. 18 5月, 2018 1 次提交
  10. 09 5月, 2018 2 次提交
  11. 08 5月, 2018 1 次提交
  12. 07 5月, 2018 1 次提交
    • C
      PCI: remove PCI_DMA_BUS_IS_PHYS · 325ef185
      Christoph Hellwig 提交于
      This was used by the ide, scsi and networking code in the past to
      determine if they should bounce payloads.  Now that the dma mapping
      always have to support dma to all physical memory (thanks to swiotlb
      for non-iommu systems) there is no need to this crude hack any more.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Acked-by: Palmer Dabbelt <palmer@sifive.com> (for riscv)
      Reviewed-by: NJens Axboe <axboe@kernel.dk>
      325ef185
  13. 25 4月, 2018 6 次提交
    • E
      signal/riscv: Replace do_trap_siginfo with force_sig_fault · 7ff3a762
      Eric W. Biederman 提交于
      The function force_sig_fault is just the generic version of
      do_trap_siginfo with a (void __user *) instead of an unsigned long
      parameter for the address.
      
      So just use force_sig_fault to simplify the code.
      
      Cc: Palmer Dabbelt <palmer@sifive.com>
      Cc: Albert Ou <albert@sifive.com>
      Cc: linux-riscv@lists.infradead.org
      Suggested-by: NChristoph Hellwig <hch@infradead.org>
      Signed-off-by: N"Eric W. Biederman" <ebiederm@xmission.com>
      7ff3a762
    • E
      signal/riscv: Use force_sig_fault where appropriate · 4d6a20b1
      Eric W. Biederman 提交于
      Filling in struct siginfo before calling force_sig_info a tedious and
      error prone process, where once in a great while the wrong fields
      are filled out, and siginfo has been inconsistently cleared.
      
      Simplify this process by using the helper force_sig_fault.  Which
      takes as a parameters all of the information it needs, ensures
      all of the fiddly bits of filling in struct siginfo are done properly
      and then calls force_sig_info.
      
      In short about a 5 line reduction in code for every time force_sig_info
      is called, which makes the calling function clearer.
      
      Cc: Palmer Dabbelt <palmer@sifive.com>
      Cc: Albert Ou <albert@sifive.com>
      Cc: linux-riscv@lists.infradead.org
      Acked-by: NPalmer Dabbelt <palmer@sifive.com>
      Signed-off-by: N"Eric W. Biederman" <ebiederm@xmission.com>
      4d6a20b1
    • E
      signal: Ensure every siginfo we send has all bits initialized · 3eb0f519
      Eric W. Biederman 提交于
      Call clear_siginfo to ensure every stack allocated siginfo is properly
      initialized before being passed to the signal sending functions.
      
      Note: It is not safe to depend on C initializers to initialize struct
      siginfo on the stack because C is allowed to skip holes when
      initializing a structure.
      
      The initialization of struct siginfo in tracehook_report_syscall_exit
      was moved from the helper user_single_step_siginfo into
      tracehook_report_syscall_exit itself, to make it clear that the local
      variable siginfo gets fully initialized.
      
      In a few cases the scope of struct siginfo has been reduced to make it
      clear that siginfo siginfo is not used on other paths in the function
      in which it is declared.
      
      Instances of using memset to initialize siginfo have been replaced
      with calls clear_siginfo for clarity.
      Signed-off-by: N"Eric W. Biederman" <ebiederm@xmission.com>
      3eb0f519
    • A
      RISC-V: build vdso-dummy.o with -no-pie · 85602bea
      Aurelien Jarno 提交于
      Debian toolcahin defaults to PIE, and I guess that will also be the case
      of most distributions. This causes the following build failure:
      
        AS      arch/riscv/kernel/vdso/getcpu.o
        AS      arch/riscv/kernel/vdso/flush_icache.o
        VDSOLD  arch/riscv/kernel/vdso/vdso.so.dbg
        OBJCOPY arch/riscv/kernel/vdso/vdso.so
        AS      arch/riscv/kernel/vdso/vdso.o
        VDSOLD  arch/riscv/kernel/vdso/vdso-dummy.o
        LD      arch/riscv/kernel/vdso/vdso-syms.o
      riscv64-linux-gnu-ld: attempted static link of dynamic object `arch/riscv/kernel/vdso/vdso-dummy.o'
      make[2]: *** [arch/riscv/kernel/vdso/Makefile:43: arch/riscv/kernel/vdso/vdso-syms.o] Error 1
      make[1]: *** [scripts/Makefile.build:575: arch/riscv/kernel/vdso] Error 2
      make: *** [Makefile:1018: arch/riscv/kernel] Error 2
      
      While the root Makefile correctly passes "-fno-PIE" to build individual
      object files, the RISC-V kernel also builds vdso-dummy.o as an
      executable, which is therefore linked as PIE. Fix that by updating this
      specific link rule to also include "-no-pie".
      Signed-off-by: NAurelien Jarno <aurelien@aurel32.net>
      Signed-off-by: NPalmer Dabbelt <palmer@sifive.com>
      85602bea
    • C
      riscv: there is no <asm/handle_irq.h> · 5b7252a2
      Christoph Hellwig 提交于
      So don't list it as generic-y.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NPalmer Dabbelt <palmer@sifive.com>
      5b7252a2
    • C
      riscv: select DMA_DIRECT_OPS instead of redefining it · 86e11757
      Christoph Hellwig 提交于
      DMA_DIRECT_OPS is defined in lib/Kconfig, so don't duplicate it in
      arch/riscv/Kconfig.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NPalmer Dabbelt <palmer@sifive.com>
      86e11757
  14. 23 4月, 2018 1 次提交
  15. 04 4月, 2018 1 次提交
    • P
      RISC-V: Rename CONFIG_CMDLINE_OVERRIDE to CONFIG_CMDLINE_FORCE · f6a11d9f
      Palmer Dabbelt 提交于
      The device tree code looks for CONFIG_CMDLINE_FORCE, but we were using
      CONFIG_CMDLINE_OVERRIDE.  It looks like this was just a hold over from
      before our device tree conversion -- in fact, we'd already removed the
      support for CONFIG_CMDLINE_OVERRIDE from our arch-specific code so it
      didn't even work any more.
      
      Thanks to Mortiz and Trung for finding the original bug, and for Michael
      for suggeting a better fix.
      
      CC: Trung Tran <trung.tran@ettus.com>
      CC: Michael J Clark <mjc@sifive.com>
      Reviewed-by: NMoritz Fischer <mdf@kernel.org>
      Signed-off-by: NPalmer Dabbelt <palmer@sifive.com>
      f6a11d9f
  16. 03 4月, 2018 4 次提交