1. 21 9月, 2018 3 次提交
  2. 24 8月, 2018 3 次提交
  3. 23 8月, 2018 2 次提交
  4. 18 8月, 2018 2 次提交
  5. 14 8月, 2018 1 次提交
  6. 12 8月, 2018 3 次提交
  7. 03 8月, 2018 7 次提交
    • P
      ARM: Convert to GENERIC_IRQ_MULTI_HANDLER · 4c301f9b
      Palmer Dabbelt 提交于
      Converts the ARM interrupt code to use the recently added
      GENERIC_IRQ_MULTI_HANDLER, which is essentially just a copy of ARM's
      existhing MULTI_IRQ_HANDLER.  The only changes are:
      
      * handle_arch_irq is now defined in a generic C file instead of an
        arm-specific assembly file.
       
      * handle_arch_irq is now marked as __ro_after_init.
      Signed-off-by: NPalmer Dabbelt <palmer@sifive.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: linux@armlinux.org.uk
      Cc: catalin.marinas@arm.com
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: jonas@southpole.se
      Cc: stefan.kristiansson@saunalahti.fi
      Cc: shorne@gmail.com
      Cc: jason@lakedaemon.net
      Cc: marc.zyngier@arm.com
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: nicolas.pitre@linaro.org
      Cc: vladimir.murzin@arm.com
      Cc: keescook@chromium.org
      Cc: jinb.park7@gmail.com
      Cc: yamada.masahiro@socionext.com
      Cc: alexandre.belloni@bootlin.com
      Cc: pombredanne@nexb.com
      Cc: Greg KH <gregkh@linuxfoundation.org>
      Cc: kstewart@linuxfoundation.org
      Cc: jhogan@kernel.org
      Cc: mark.rutland@arm.com
      Cc: ard.biesheuvel@linaro.org
      Cc: james.morse@arm.com
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: openrisc@lists.librecores.org
      Link: https://lkml.kernel.org/r/20180622170126.6308-3-palmer@sifive.com
      4c301f9b
    • E
      crypto: arm/chacha20 - always use vrev for 16-bit rotates · 4e34e51f
      Eric Biggers 提交于
      The 4-way ChaCha20 NEON code implements 16-bit rotates with vrev32.16,
      but the one-way code (used on remainder blocks) implements it with
      vshl + vsri, which is slower.  Switch the one-way code to vrev32.16 too.
      Signed-off-by: NEric Biggers <ebiggers@google.com>
      Acked-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      4e34e51f
    • R
      ARM: spectre-v1: mitigate user accesses · a3c0f847
      Russell King 提交于
      Spectre variant 1 attacks are about this sequence of pseudo-code:
      
      	index = load(user-manipulated pointer);
      	access(base + index * stride);
      
      In order for the cache side-channel to work, the access() must me made
      to memory which userspace can detect whether cache lines have been
      loaded.  On 32-bit ARM, this must be either user accessible memory, or
      a kernel mapping of that same user accessible memory.
      
      The problem occurs when the load() speculatively loads privileged data,
      and the subsequent access() is made to user accessible memory.
      
      Any load() which makes use of a user-maniplated pointer is a potential
      problem if the data it has loaded is used in a subsequent access.  This
      also applies for the access() if the data loaded by that access is used
      by a subsequent access.
      
      Harden the get_user() accessors against Spectre attacks by forcing out
      of bounds addresses to a NULL pointer.  This prevents get_user() being
      used as the load() step above.  As a side effect, put_user() will also
      be affected even though it isn't implicated.
      
      Also harden copy_from_user() by redoing the bounds check within the
      arm_copy_from_user() code, and NULLing the pointer if out of bounds.
      Acked-by: NMark Rutland <mark.rutland@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      a3c0f847
    • R
      ARM: spectre-v1: use get_user() for __get_user() · b1cd0a14
      Russell King 提交于
      Fixing __get_user() for spectre variant 1 is not sane: we would have to
      add address space bounds checking in order to validate that the location
      should be accessed, and then zero the address if found to be invalid.
      
      Since __get_user() is supposed to avoid the bounds check, and this is
      exactly what get_user() does, there's no point having two different
      implementations that are doing the same thing.  So, when the Spectre
      workarounds are required, make __get_user() an alias of get_user().
      Acked-by: NMark Rutland <mark.rutland@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      b1cd0a14
    • R
      ARM: use __inttype() in get_user() · d09fbb32
      Russell King 提交于
      Borrow the x86 implementation of __inttype() to use in get_user() to
      select an integer type suitable to temporarily hold the result value.
      This is necessary to avoid propagating the volatile nature of the
      result argument, which can cause the following warning:
      
      lib/iov_iter.c:413:5: warning: optimization may eliminate reads and/or writes to register variables [-Wvolatile-register-var]
      Acked-by: NMark Rutland <mark.rutland@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      d09fbb32
    • R
      ARM: oabi-compat: copy semops using __copy_from_user() · 8c8484a1
      Russell King 提交于
      __get_user_error() is used as a fast accessor to make copying structure
      members as efficient as possible.  However, with software PAN and the
      recent Spectre variant 1, the efficiency is reduced as these are no
      longer fast accessors.
      
      In the case of software PAN, it has to switch the domain register around
      each access, and with Spectre variant 1, it would have to repeat the
      access_ok() check for each access.
      
      Rather than using __get_user_error() to copy each semops element member,
      copy each semops element in full using __copy_from_user().
      Acked-by: NMark Rutland <mark.rutland@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      8c8484a1
    • R
      ARM: vfp: use __copy_from_user() when restoring VFP state · 42019fc5
      Russell King 提交于
      __get_user_error() is used as a fast accessor to make copying structure
      members in the signal handling path as efficient as possible.  However,
      with software PAN and the recent Spectre variant 1, the efficiency is
      reduced as these are no longer fast accessors.
      
      In the case of software PAN, it has to switch the domain register around
      each access, and with Spectre variant 1, it would have to repeat the
      access_ok() check for each access.
      
      Use __copy_from_user() rather than __get_user_err() for individual
      members when restoring VFP state.
      Acked-by: NMark Rutland <mark.rutland@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      42019fc5
  8. 02 8月, 2018 4 次提交
    • C
      kconfig: include kernel/Kconfig.preempt from init/Kconfig · 87a4c375
      Christoph Hellwig 提交于
      Almost all architectures include it.  Add a ARCH_NO_PREEMPT symbol to
      disable preempt support for alpha, hexagon, non-coldfire m68k and
      user mode Linux.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      87a4c375
    • C
      Kconfig: consolidate the "Kernel hacking" menu · 06ec64b8
      Christoph Hellwig 提交于
      Move the source of lib/Kconfig.debug and arch/$(ARCH)/Kconfig.debug to
      the top-level Kconfig.  For two architectures that means moving their
      arch-specific symbols in that menu into a new arch Kconfig.debug file,
      and for a few more creating a dummy file so that we can include it
      unconditionally.
      
      Also move the actual 'Kernel hacking' menu to lib/Kconfig.debug, where
      it belongs.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      06ec64b8
    • C
      kconfig: include common Kconfig files from top-level Kconfig · 1572497c
      Christoph Hellwig 提交于
      Instead of duplicating the source statements in every architecture just
      do it once in the toplevel Kconfig file.
      
      Note that with this the inclusion of arch/$(SRCARCH/Kconfig moves out of
      the top-level Kconfig into arch/Kconfig so that don't violate ordering
      constraits while keeping a sensible menu structure.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      1572497c
    • L
      mm: do not initialize TLB stack vma's with vma_init() · 8b11ec1b
      Linus Torvalds 提交于
      Commit 2c4541e2 ("mm: use vma_init() to initialize VMAs on stack and
      data segments") tried to initialize various left-over ad-hoc vma's
      "properly", but actually made things worse for the temporary vma's used
      for TLB flushing.
      
      vma_init() doesn't actually initialize all of the vma, just a few
      fields, so doing something like
      
         -       struct vm_area_struct vma = { .vm_mm = tlb->mm, };
         +       struct vm_area_struct vma;
         +
         +       vma_init(&vma, tlb->mm);
      
      was actually very bad: instead of having a nicely initialized vma with
      every field but "vm_mm" zeroed, you'd have an entirely uninitialized vma
      with only a couple of fields initialized.  And they weren't even fields
      that the code in question mostly cared about.
      
      The flush_tlb_range() function takes a "struct vma" rather than a
      "struct mm_struct", because a few architectures actually care about what
      kind of range it is - being able to only do an ITLB flush if it's a
      range that doesn't have data accesses enabled, for example.  And all the
      normal users already have the vma for doing the range invalidation.
      
      But a few people want to call flush_tlb_range() with a range they just
      made up, so they also end up using a made-up vma.  x86 just has a
      special "flush_tlb_mm_range()" function for this, but other
      architectures (arm and ia64) do the "use fake vma" thing instead, and
      thus got caught up in the vma_init() changes.
      
      At the same time, the TLB flushing code really doesn't care about most
      other fields in the vma, so vma_init() is just unnecessary and
      pointless.
      
      This fixes things by having an explicit "this is just an initializer for
      the TLB flush" initializer macro, which is used by the arm/arm64/ia64
      people who mis-use this interface with just a dummy vma.
      
      Fixes: 2c4541e2 ("mm: use vma_init() to initialize VMAs on stack and data segments")
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Andrea Arcangeli <aarcange@redhat.com>
      Cc: Kirill Shutemov <kirill.shutemov@linux.intel.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: John Stultz <john.stultz@linaro.org>
      Cc: Hugh Dickins <hughd@google.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8b11ec1b
  9. 01 8月, 2018 3 次提交
  10. 30 7月, 2018 5 次提交
    • N
      ARM: 8785/1: use compiler built-ins for ffs and fls · 001a30c4
      Nicolas Pitre 提交于
      On ARMv5 and above, it is beneficial to use compiler built-ins such as
      __builtin_ffs() and __builtin_ctzl() to implement ffs(), __ffs(), fls()
      and __fls(). The compiler does inline the clz instruction and even the
      rbit instruction when available, or provide a constant value when
      possible. On ARMv4 the compiler calls out to helper functions for those
      built-ins so it is best to keep the open coded versions in that case.
      Signed-off-by: NNicolas Pitre <nico@linaro.org>
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      001a30c4
    • V
      ARM: 8784/1: NOMMU: Allow enter in Hyp mode · cbfc5619
      Vladimir Murzin 提交于
      ARMv8R adds support for virtualisation extension (with some deviation
      from v8A). With this patch hyp-unaware boot code can offload to kernel
      setting up HYP stuff in a sane state.
      Signed-off-by: NVladimir Murzin <vladimir.murzin@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      cbfc5619
    • V
      ARM: 8783/1: NOMMU: Extend check for VBAR support · c803ce3f
      Vladimir Murzin 提交于
      ARMv8R adds support for VBAR and updates ID_PFR1 with the new filed
      Sec_frac (bits [23:20]):
      
      Security fractional field. When the Security field is 0000, determines
      the support for features from the ARMv7 Security Extensions. Permitted
      values are:
      
      0000 No features from the ARMv7 Security Extensions are implemented.
           This value is not supported in ARMv8 if ID_PFR1 bits [7:4] are zero.
      
      0001 The implementation includes the VBAR, and the TCR.PD0 and TCR.PD1
           bits.
      
      0010 As for 0001, plus the ability to access Secure or Non-secure
           physical memory is supported.
      
      All other values are reserved.
      
      This field is only valid when ID_PFR1[7:4] == 0, otherwise it holds
      the value 0000.
      Signed-off-by: NVladimir Murzin <vladimir.murzin@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      c803ce3f
    • M
      ARM: 8782/1: vfp: clean up arch/arm/vfp/Makefile · 35f5a6ac
      Masahiro Yamada 提交于
      Since commit 799c4341 ("kbuild: thin archives make default for
      all archs"), $(AR) is used instead of $(LD) to combine object files.
      
      The following code in arch/arm/vfp/Makefile:
      
        LDFLAGS         +=--no-warn-mismatch
      
      ... is no longer used.
      
      Also, arch/arm/Makefile already guards arch/arm/vfp/ by a boolean
      symbol, CONFIG_VFP, like this:
      
        core-$(CONFIG_VFP)              += arch/arm/vfp/
      
      So, $(CONFIG_VFP) is always evaluated to y in arch/arm/vfp/Makefile.
      There is no point to use pseudo object, vfp.o, which never becomes
      a module.  Add all objects to obj-y directly.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      35f5a6ac
    • V
      ARM: 8781/1: Fix Thumb-2 syscall return for binutils 2.29+ · afc9f65e
      Vincent Whitchurch 提交于
      When building the kernel as Thumb-2 with binutils 2.29 or newer, if the
      assembler has seen the .type directive (via ENDPROC()) for a symbol, it
      automatically handles the setting of the lowest bit when the symbol is
      used with ADR.  The badr macro on the other hand handles this lowest bit
      manually.  This leads to a jump to a wrong address in the wrong state
      in the syscall return path:
      
       Internal error: Oops - undefined instruction: 0 [#2] SMP THUMB2
       Modules linked in:
       CPU: 0 PID: 652 Comm: modprobe Tainted: G      D           4.18.0-rc3+ #8
       PC is at ret_fast_syscall+0x4/0x62
       LR is at sys_brk+0x109/0x128
       pc : [<80101004>]    lr : [<801c8a35>]    psr: 60000013
       Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
       Control: 50c5387d  Table: 9e82006a  DAC: 00000051
       Process modprobe (pid: 652, stack limit = 0x(ptrval))
      
       80101000 <ret_fast_syscall>:
       80101000:       b672            cpsid   i
       80101002:       f8d9 2008       ldr.w   r2, [r9, #8]
       80101006:       f1b2 4ffe       cmp.w   r2, #2130706432 ; 0x7f000000
      
       80101184 <local_restart>:
       80101184:       f8d9 a000       ldr.w   sl, [r9]
       80101188:       e92d 0030       stmdb   sp!, {r4, r5}
       8010118c:       f01a 0ff0       tst.w   sl, #240        ; 0xf0
       80101190:       d117            bne.n   801011c2 <__sys_trace>
       80101192:       46ba            mov     sl, r7
       80101194:       f5ba 7fc8       cmp.w   sl, #400        ; 0x190
       80101198:       bf28            it      cs
       8010119a:       f04f 0a00       movcs.w sl, #0
       8010119e:       f3af 8014       nop.w   {20}
       801011a2:       f2af 1ea2       subw    lr, pc, #418    ; 0x1a2
      
      To fix this, add a new symbol name which doesn't have ENDPROC used on it
      and use that with badr.  We can't remove the badr usage since that would
      would cause breakage with older binutils.
      Signed-off-by: NVincent Whitchurch <vincent.whitchurch@axis.com>
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      afc9f65e
  11. 28 7月, 2018 1 次提交
  12. 27 7月, 2018 2 次提交
  13. 26 7月, 2018 1 次提交
  14. 25 7月, 2018 3 次提交