1. 19 6月, 2019 1 次提交
  2. 12 6月, 2019 1 次提交
  3. 06 6月, 2019 1 次提交
  4. 05 6月, 2019 3 次提交
  5. 31 5月, 2019 2 次提交
  6. 29 5月, 2019 2 次提交
  7. 24 5月, 2019 3 次提交
    • J
      arm64: insn: Add BUILD_BUG_ON() for invalid masks · edbcf50e
      Jean-Philippe Brucker 提交于
      Detect invalid instruction masks at build time. Some versions of GCC can
      warn about the situation, but not all of them, it seems.
      Suggested-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NJean-Philippe Brucker <jean-philippe.brucker@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      edbcf50e
    • J
      arm64: insn: Fix ldadd instruction encoding · c5e2edeb
      Jean-Philippe Brucker 提交于
      GCC 8.1.0 reports that the ldadd instruction encoding, recently added to
      insn.c, doesn't match the mask and couldn't possibly be identified:
      
       linux/arch/arm64/include/asm/insn.h: In function 'aarch64_insn_is_ldadd':
       linux/arch/arm64/include/asm/insn.h:280:257: warning: bitwise comparison always evaluates to false [-Wtautological-compare]
      
      Bits [31:30] normally encode the size of the instruction (1 to 8 bytes)
      and the current instruction value only encodes the 4- and 8-byte
      variants. At the moment only the BPF JIT needs this instruction, and
      doesn't require the 1- and 2-byte variants, but to be consistent with
      our other ldr and str instruction encodings, clear the size field in the
      insn value.
      
      Fixes: 34b8ab09 ("bpf, arm64: use more scalable stadd over ldxr / stxr loop in xadd")
      Acked-by: NDaniel Borkmann <daniel@iogearbox.net>
      Reported-by: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Signed-off-by: NYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
      Signed-off-by: NJean-Philippe Brucker <jean-philippe.brucker@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      c5e2edeb
    • J
      KVM: arm64: Move pmu hyp code under hyp's Makefile to avoid instrumentation · b7c50fab
      James Morse 提交于
      KVM's pmu.c contains the __hyp_text needed to switch the pmu registers
      between host and guest. Because this isn't covered by the 'hyp' Makefile,
      it can be built with kasan and friends when these are enabled in Kconfig.
      
      When starting a guest, this results in:
      | Kernel panic - not syncing: HYP panic:
      | PS:a00003c9 PC:000083000028ada0 ESR:86000007
      | FAR:000083000028ada0 HPFAR:0000000029df5300 PAR:0000000000000000
      | VCPU:000000004e10b7d6
      | CPU: 0 PID: 3088 Comm: qemu-system-aar Not tainted 5.2.0-rc1 #11026
      | Hardware name: ARM LTD ARM Juno Development Platform/ARM Juno Development Plat
      | Call trace:
      |  dump_backtrace+0x0/0x200
      |  show_stack+0x20/0x30
      |  dump_stack+0xec/0x158
      |  panic+0x1ec/0x420
      |  panic+0x0/0x420
      | SMP: stopping secondary CPUs
      | Kernel Offset: disabled
      | CPU features: 0x002,25006082
      | Memory Limit: none
      | ---[ end Kernel panic - not syncing: HYP panic:
      
      This is caused by functions in pmu.c calling the instrumented
      code, which isn't mapped to hyp. From objdump -r:
      | RELOCATION RECORDS FOR [.hyp.text]:
      | OFFSET           TYPE              VALUE
      | 0000000000000010 R_AARCH64_CALL26  __sanitizer_cov_trace_pc
      | 0000000000000018 R_AARCH64_CALL26  __asan_load4_noabort
      | 0000000000000024 R_AARCH64_CALL26  __asan_load4_noabort
      
      Move the affected code to a new file under 'hyp's Makefile.
      
      Fixes: 3d91befb ("arm64: KVM: Enable !VHE support for :G/:H perf event modifiers")
      Cc: Andrew Murray <Andrew.Murray@arm.com>
      Signed-off-by: NJames Morse <james.morse@arm.com>
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      b7c50fab
  8. 23 5月, 2019 2 次提交
    • M
      arm64: Handle erratum 1418040 as a superset of erratum 1188873 · a5325089
      Marc Zyngier 提交于
      We already mitigate erratum 1188873 affecting Cortex-A76 and
      Neoverse-N1 r0p0 to r2p0. It turns out that revisions r0p0 to
      r3p1 of the same cores are affected by erratum 1418040, which
      has the same workaround as 1188873.
      
      Let's expand the range of affected revisions to match 1418040,
      and repaint all occurences of 1188873 to 1418040. Whilst we're
      there, do a bit of reformating in silicon-errata.txt and drop
      a now unnecessary dependency on ARM_ARCH_TIMER_OOL_WORKAROUND.
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      a5325089
    • W
      arm64: errata: Add workaround for Cortex-A76 erratum #1463225 · 969f5ea6
      Will Deacon 提交于
      Revisions of the Cortex-A76 CPU prior to r4p0 are affected by an erratum
      that can prevent interrupts from being taken when single-stepping.
      
      This patch implements a software workaround to prevent userspace from
      effectively being able to disable interrupts.
      
      Cc: <stable@vger.kernel.org>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      969f5ea6
  9. 17 5月, 2019 1 次提交
  10. 15 5月, 2019 4 次提交
  11. 14 5月, 2019 1 次提交
  12. 30 4月, 2019 9 次提交
  13. 27 4月, 2019 1 次提交
  14. 26 4月, 2019 4 次提交
    • J
      arm64: Always enable ssb vulnerability detection · d42281b6
      Jeremy Linton 提交于
      Ensure we are always able to detect whether or not the CPU is affected
      by SSB, so that we can later advertise this to userspace.
      Signed-off-by: NJeremy Linton <jeremy.linton@arm.com>
      Reviewed-by: NAndre Przywara <andre.przywara@arm.com>
      Reviewed-by: NCatalin Marinas <catalin.marinas@arm.com>
      Tested-by: NStefan Wahren <stefan.wahren@i2se.com>
      [will: Use IS_ENABLED instead of #ifdef]
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      d42281b6
    • W
      arm64: futex: Avoid copying out uninitialised stack in failed cmpxchg() · 8e4e0ac0
      Will Deacon 提交于
      Returning an error code from futex_atomic_cmpxchg_inatomic() indicates
      that the caller should not make any use of *uval, and should instead act
      upon on the value of the error code. Although this is implemented
      correctly in our futex code, we needlessly copy uninitialised stack to
      *uval in the error case, which can easily be avoided.
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      8e4e0ac0
    • W
      arm64: futex: Bound number of LDXR/STXR loops in FUTEX_WAKE_OP · 03110a5c
      Will Deacon 提交于
      Our futex implementation makes use of LDXR/STXR loops to perform atomic
      updates to user memory from atomic context. This can lead to latency
      problems if we end up spinning around the LL/SC sequence at the expense
      of doing something useful.
      
      Rework our futex atomic operations so that we return -EAGAIN if we fail
      to update the futex word after 128 attempts. The core futex code will
      reschedule if necessary and we'll try again later.
      
      Cc: <stable@kernel.org>
      Fixes: 6170a974 ("arm64: Atomic operations")
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      03110a5c
    • W
      arm64: futex: Fix FUTEX_WAKE_OP atomic ops with non-zero result value · 84ff7a09
      Will Deacon 提交于
      Rather embarrassingly, our futex() FUTEX_WAKE_OP implementation doesn't
      explicitly set the return value on the non-faulting path and instead
      leaves it holding the result of the underlying atomic operation. This
      means that any FUTEX_WAKE_OP atomic operation which computes a non-zero
      value will be reported as having failed. Regrettably, I wrote the buggy
      code back in 2011 and it was upstreamed as part of the initial arm64
      support in 2012.
      
      The reasons we appear to get away with this are:
      
        1. FUTEX_WAKE_OP is rarely used and therefore doesn't appear to get
           exercised by futex() test applications
      
        2. If the result of the atomic operation is zero, the system call
           behaves correctly
      
        3. Prior to version 2.25, the only operation used by GLIBC set the
           futex to zero, and therefore worked as expected. From 2.25 onwards,
           FUTEX_WAKE_OP is not used by GLIBC at all.
      
      Fix the implementation by ensuring that the return value is either 0
      to indicate that the atomic operation completed successfully, or -EFAULT
      if we encountered a fault when accessing the user mapping.
      
      Cc: <stable@kernel.org>
      Fixes: 6170a974 ("arm64: Atomic operations")
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      84ff7a09
  15. 25 4月, 2019 1 次提交
    • K
      arm64: sysreg: Make mrs_s and msr_s macros work with Clang and LTO · be604c61
      Kees Cook 提交于
      Clang's integrated assembler does not allow assembly macros defined
      in one inline asm block using the .macro directive to be used across
      separate asm blocks. LLVM developers consider this a feature and not a
      bug, recommending code refactoring:
      
        https://bugs.llvm.org/show_bug.cgi?id=19749
      
      As binutils doesn't allow macros to be redefined, this change uses
      UNDEFINE_MRS_S and UNDEFINE_MSR_S to define corresponding macros
      in-place and workaround gcc and clang limitations on redefining macros
      across different assembler blocks.
      
      Specifically, the current state after preprocessing looks like this:
      
      asm volatile(".macro mXX_s ... .endm");
      void f()
      {
      	asm volatile("mXX_s a, b");
      }
      
      With GCC, it gives macro redefinition error because sysreg.h is included
      in multiple source files, and assembler code for all of them is later
      combined for LTO (I've seen an intermediate file with hundreds of
      identical definitions).
      
      With clang, it gives macro undefined error because clang doesn't allow
      sharing macros between inline asm statements.
      
      I also seem to remember catching another sort of undefined error with
      GCC due to reordering of macro definition asm statement and generated
      asm code for function that uses the macro.
      
      The solution with defining and undefining for each use, while certainly
      not elegant, satisfies both GCC and clang, LTO and non-LTO.
      Co-developed-by: NAlex Matveev <alxmtvv@gmail.com>
      Co-developed-by: NYury Norov <ynorov@caviumnetworks.com>
      Co-developed-by: NSami Tolvanen <samitolvanen@google.com>
      Reviewed-by: NNick Desaulniers <ndesaulniers@google.com>
      Reviewed-by: NMark Rutland <mark.rutland@arm.com>
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      be604c61
  16. 24 4月, 2019 4 次提交