1. 03 7月, 2017 1 次提交
  2. 02 7月, 2017 1 次提交
  3. 01 7月, 2017 1 次提交
  4. 30 6月, 2017 4 次提交
  5. 29 6月, 2017 10 次提交
  6. 26 6月, 2017 2 次提交
    • L
      arm64: pass endianness info to sparse · bcde519e
      Luc Van Oostenryck 提交于
      ARM64 depends on the macro __AARCH64EB__ being defined or not
      to correctly select or define endian-specific macros, structures
      or pieces of code.
      
      This macro is predefined by the compiler but sparse knows nothing
      about it and thus may pre-process files differently from what
      gcc would.
      
      Fix this by passing '-D__AARCH64EL__' or '-D__AARCH64EB__' to
      sparse depending of the endianness of the kernel, like defined
      by GCC.
      
      Note: In most case it won't change anything since most arm64 use
            little-endian (but an allyesconfig would use big-endian!).
      
      CC: Catalin Marinas <catalin.marinas@arm.com>
      CC: Will Deacon <will.deacon@arm.com>
      CC: linux-arm-kernel@lists.infradead.org
      Signed-off-by: NLuc Van Oostenryck <luc.vanoostenryck@gmail.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      bcde519e
    • A
      arm64: defconfig: remove duplicate entry · a1f338f8
      Arnd Bergmann 提交于
      This fixes a warning:
      warning: override: reassigning to symbol SPI_MESON_SPIFC
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      a1f338f8
  7. 24 6月, 2017 2 次提交
    • M
      arm64: ftrace: fix !CONFIG_ARM64_MODULE_PLTS kernels · 8486e54d
      Mark Rutland 提交于
      When a kernel is built without CONFIG_ARM64_MODULE_PLTS, we don't
      generate the expected branch instruction in ftrace_make_nop(). This
      means we pass zero (rather than a valid branch) to ftrace_modify_code()
      as the expected instruction to validate. This causes us to return
      -EINVAL to the core ftrace code for a valid case, resulting in a splat
      at boot time.
      
      This was an unintended effect of commit:
      
        68764420 ("arm64: ftrace: fix building without CONFIG_MODULES")
      
      ... which incorrectly moved the generation of the branch instruction
      into the ifdef for CONFIG_ARM64_MODULE_PLTS.
      
      This patch fixes the issue by moving the ifdef inside of the relevant
      if-else case, and always checking that the branch is in range,
      regardless of CONFIG_ARM64_MODULE_PLTS. This ensures that we generate
      the expected branch instruction, and also improves our sanity checks.
      
      For consistency, both ftrace_make_nop() and ftrace_make_call() are
      updated with this pattern.
      
      Fixes: 68764420 ("arm64: ftrace: fix building without CONFIG_MODULES")
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      Reported-by: NMarc Zyngier <marc.zyngier@arm.com>
      Reviewed-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      8486e54d
    • D
      arm64: signal: Allow expansion of the signal frame · 33f08261
      Dave Martin 提交于
      This patch defines an extra_context signal frame record that can be
      used to describe an expanded signal frame, and modifies the context
      block allocator and signal frame setup and parsing code to create,
      populate, parse and decode this block as necessary.
      
      To avoid abuse by userspace, parse_user_sigframe() attempts to
      ensure that:
      
       * no more than one extra_context is accepted;
       * the extra context data is a sensible size, and properly placed
         and aligned.
      
      The extra_context data is required to start at the first 16-byte
      aligned address immediately after the dummy terminator record
      following extra_context in rt_sigframe.__reserved[] (as ensured
      during signal delivery).  This serves as a sanity-check that the
      signal frame has not been moved or copied without taking the extra
      data into account.
      Signed-off-by: NDave Martin <Dave.Martin@arm.com>
      Reviewed-by: NCatalin Marinas <catalin.marinas@arm.com>
      [will: add __force annotation when casting extra_datap to __user pointer]
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      33f08261
  8. 23 6月, 2017 14 次提交
  9. 22 6月, 2017 4 次提交
    • M
      arm64: dump cpu_hwcaps at panic time · 8effeaaf
      Mark Rutland 提交于
      When debugging a kernel panic(), it can be useful to know which CPU
      features have been detected by the kernel, as some code paths can depend
      on these (and may have been patched at runtime).
      
      This patch adds a notifier to dump the detected CPU caps (as a hex
      string) at panic(), when we log other information useful for debugging.
      On a Juno R1 system running v4.12-rc5, this looks like:
      
      [  615.431249] Kernel panic - not syncing: Fatal exception in interrupt
      [  615.437609] SMP: stopping secondary CPUs
      [  615.441872] Kernel Offset: disabled
      [  615.445372] CPU features: 0x02086
      [  615.448522] Memory Limit: none
      
      A developer can decode this by looking at the corresponding
      <asm/cpucaps.h> bits. For example, the above decodes as:
      
      * bit  1: ARM64_WORKAROUND_DEVICE_LOAD_ACQUIRE
      * bit  2: ARM64_WORKAROUND_845719
      * bit  7: ARM64_WORKAROUND_834220
      * bit 13: ARM64_HAS_32BIT_EL0
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      Acked-by: NSteve Capper <steve.capper@arm.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      8effeaaf
    • D
      arm64: ptrace: Flush user-RW TLS reg to thread_struct before reading · 936eb65c
      Dave Martin 提交于
      When reading current's user-writable TLS register (which occurs
      when dumping core for native tasks), it is possible that userspace
      has modified it since the time the task was last scheduled out.
      The new TLS register value is not guaranteed to have been written
      immediately back to thread_struct in this case.
      
      As a result, a coredump can capture stale data for this register.
      Reading the register for a stopped task via ptrace is unaffected.
      
      For native tasks, this patch explicitly flushes the TPIDR_EL0
      register back to thread_struct before dumping when operating on
      current, thus ensuring that coredump contents are up to date.  For
      compat tasks, the TLS register is not user-writable and so cannot
      be out of sync, so no flush is required in compat_tls_get().
      Signed-off-by: NDave Martin <Dave.Martin@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      936eb65c
    • D
      arm64: ptrace: Flush FPSIMD regs back to thread_struct before reading · e1d5a8fb
      Dave Martin 提交于
      When reading the FPSIMD state of current (which occurs when dumping
      core), it is possible that userspace has modified the FPSIMD
      registers since the time the task was last scheduled out.  Such
      changes are not guaranteed to be reflected immedately in
      thread_struct.
      
      As a result, a coredump can contain stale values for these
      registers.  Reading the registers of a stopped task via ptrace is
      unaffected.
      
      This patch explicitly flushes the CPU state back to thread_struct
      before dumping when operating on current, thus ensuring that
      coredump contents are up to date.
      Signed-off-by: NDave Martin <Dave.Martin@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      e1d5a8fb
    • D
      arm64: ptrace: Fix VFP register dumping in compat coredumps · af66b2d8
      Dave Martin 提交于
      Currently, VFP registers are omitted from coredumps for compat
      processes, due to a bug in the REGSET_COMPAT_VFP regset
      implementation.
      
      compat_vfp_get() needs to transfer non-contiguous data from
      thread_struct.fpsimd_state, and uses put_user() to handle the
      offending trailing word (FPSCR).  This fails when copying to a
      kernel address (i.e., kbuf && !ubuf), which is what happens when
      dumping core.  As a result, the ELF coredump core code silently
      omits the NT_ARM_VFP note from the dump.
      
      It would be possible to work around this with additional special
      case code for the put_user(), but since user_regset_copyout() is
      explicitly designed to handle this scenario it is cleaner to port
      the put_user() to a user_regset_copyout() call, which this patch
      does.
      Signed-off-by: NDave Martin <Dave.Martin@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      af66b2d8
  10. 21 6月, 2017 1 次提交