Skip to content

arm64: support for 8.1 LSE atomic instructions

Will Deacon linux-arm-kernel 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest20 patches 0 repliesNew
  2. v118 patches 0 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/20arm64: rwlocks: don't fail trylock purely due to contentionarch/arm64/include/asm/spinlock.h+8 -61 reply
2/20documentation: Clarify failed cmpxchg memory ordering semanticsDocumentation/atomic_ops.txt Documentation/memory-barriers.txt+6 -41 reply
2/20documentation: Clarify failed cmpxchg memory ordering semantics+0 -01 reply
2/20documentation: Clarify failed cmpxchg memory ordering semantics+0 -00 replies
3/20arm64: cpufeature.h: add missing #include of kernel.harch/arm64/include/asm/cpufeature.h+2 -01 reply
4/20arm64: atomics: move ll/sc atomics into separate header filearch/arm64/include/asm/atomic.h arch/arm64/include/asm/atomic_ll_sc.h+207 -1601 reply
5/20arm64: elf: advertise 8.1 atomic instructions as new hwcaparch/arm64/include/uapi/asm/hwcap.h arch/arm64/kernel/setup.c+15 -01 reply
6/20arm64: alternatives: add cpu feature for lse atomicsarch/arm64/include/asm/cpufeature.h arch/arm64/kernel/setup.c+3 -11 reply
7/20arm64: introduce CONFIG_ARM64_LSE_ATOMICS as fallback to ll/sc atomicsarch/arm64/Kconfig arch/arm64/include/asm/atomic.h arch/arm64/include/asm/atomic_ll_sc.h +3 more+214 -21 reply
8/20arm64: atomics: patch in lse instructions when supported by the CPUarch/arm64/Makefile arch/arm64/include/asm/atomic.h arch/arm64/include/asm/atomic_ll_sc.h +3 more+229 -1071 reply
9/20arm64: locks: patch in lse instructions when supported by the CPUarch/arm64/include/asm/spinlock.h+108 -291 reply
10/20arm64: bitops: patch in lse instructions when supported by the CPUarch/arm64/include/asm/lse.h arch/arm64/lib/bitops.S+45 -211 reply
11/20arm64: xchg: patch in lse instructions when supported by the CPUarch/arm64/include/asm/cmpxchg.h+33 -51 reply
12/20arm64: cmpxchg: patch in lse instructions when supported by the CPUarch/arm64/include/asm/atomic.h arch/arm64/include/asm/atomic_ll_sc.h arch/arm64/include/asm/atomic_lse.h +1 more+98 -661 reply
13/20arm64: cmpxchg_dbl: patch in lse instructions when supported by the CPUarch/arm64/include/asm/atomic_ll_sc.h arch/arm64/include/asm/atomic_lse.h arch/arm64/include/asm/cmpxchg.h+94 -511 reply
14/20arm64: cmpxchg: avoid "cc" clobber in ll/sc routinesarch/arm64/include/asm/atomic_ll_sc.h arch/arm64/include/asm/atomic_lse.h+8 -101 reply
15/20arm64: cmpxchg: avoid memory barrier on comparison failurearch/arm64/include/asm/atomic_ll_sc.h+22 -261 reply
16/20arm64: atomics: tidy up common atomic{,64}_* macrosarch/arm64/include/asm/atomic.h+38 -541 reply
17/20arm64: atomics: prefetch the destination word for write prior to stxrarch/arm64/include/asm/atomic_ll_sc.h arch/arm64/include/asm/cmpxchg.h arch/arm64/include/asm/futex.h +1 more+21 -01 reply
18/20arm64: atomics: implement atomic{, 64}_cmpxchg using cmpxchgarch/arm64/include/asm/atomic.h arch/arm64/include/asm/atomic_ll_sc.h arch/arm64/include/asm/atomic_lse.h+2 -891 reply
19/20arm64: atomic64_dec_if_positive: fix incorrect branch conditionarch/arm64/include/asm/atomic_ll_sc.h arch/arm64/include/asm/atomic_lse.h+2 -21 reply
20/20arm64: kconfig: select HAVE_CMPXCHG_LOCALarch/arm64/Kconfig+1 -01 reply

Reviews trailers per patch

All 22 patches have a Reviewed-by or Acked-by.

PatchSteve CapperCatalin Marinas
1/20R-b
2/20A-b
2/20A-b
2/20A-b
3/20A-b
4/20R-b R-b
5/20R-b R-b
6/20R-b R-b
7/20R-b
8/20R-b
9/20R-b
10/20R-b R-b
11/20R-b R-b
12/20R-b
13/20R-b
14/20R-b R-b
15/20R-b R-b
16/20R-b R-b
17/20R-b
18/20R-b R-b
19/20R-b A-b
20/20R-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 00/20] arm64: support for 8.1 LSE atomic instructions

Hello,

This is version two of the patches I originally posted here:

http://lists.infradead.org/pipermail/linux-arm-kernel/2015-July/355980.html

Changes since v1 include:

* Fixed WFE usage in rwlock code
* Fixed rwlock trylock retry semantics
* Added documentation update for failed cmpxchg semantics
* Replaced explicit save/restore of LR with a clobber

Tested on Juno and Fastmodel.

Peter -- do you want to pick up the documentation update, or shall I
keep it with the rest of this series?

Will

--->8

Will Deacon (20):
arm64: rwlocks: don't fail trylock purely due to contention
documentation: Clarify failed cmpxchg memory ordering semantics
arm64: cpufeature.h: add missing #include of kernel.h
arm64: atomics: move ll/sc atomics into separate header file
arm64: elf: advertise 8.1 atomic instructions as new hwcap
arm64: alternatives: add cpu feature for lse atomics
arm64: introduce CONFIG_ARM64_LSE_ATOMICS as fallback to ll/sc atomics
arm64: atomics: patch in lse instructions when supported by the CPU
arm64: locks: patch in lse instructions when supported by the CPU
arm64: bitops: patch in lse instructions when supported by the CPU
arm64: xchg: patch in lse instructions when supported by the CPU
arm64: cmpxchg: patch in lse instructions when supported by the CPU
arm64: cmpxchg_dbl: patch in lse instructions when supported by the
CPU
arm64: cmpxchg: avoid "cc" clobber in ll/sc routines
arm64: cmpxchg: avoid memory barrier on comparison failure
arm64: atomics: tidy up common atomic{,64}_* macros
arm64: atomics: prefetch the destination word for write prior to stxr
arm64: atomics: implement atomic{,64}_cmpxchg using cmpxchg
arm64: atomic64_dec_if_positive: fix incorrect branch condition
arm64: kconfig: select HAVE_CMPXCHG_LOCAL

 Documentation/atomic_ops.txt          |   4 +-
 Documentation/memory-barriers.txt     |   6 +-
 arch/arm64/Kconfig                    |  13 ++
 arch/arm64/Makefile                   |  13 +-
 arch/arm64/include/asm/atomic.h       | 262 ++++++-------------------------
 arch/arm64/include/asm/atomic_ll_sc.h | 237 ++++++++++++++++++++++++++++
 arch/arm64/include/asm/atomic_lse.h   | 285 ++++++++++++++++++++++++++++++++++
 arch/arm64/include/asm/cmpxchg.h      | 192 +++++++++--------------
 arch/arm64/include/asm/cpufeature.h   |   5 +-
 arch/arm64/include/asm/futex.h        |   2 +
 arch/arm64/include/asm/lse.h          |  53 +++++++
 arch/arm64/include/asm/spinlock.h     | 147 ++++++++++++++----
 arch/arm64/include/uapi/asm/hwcap.h   |   1 +
 arch/arm64/kernel/setup.c             |  18 +++
 arch/arm64/lib/Makefile               |  13 ++
 arch/arm64/lib/atomic_ll_sc.c         |   3 +
 arch/arm64/lib/bitops.S               |  45 +++---
 17 files changed, 911 insertions(+), 388 deletions(-)
 create mode 100644 arch/arm64/include/asm/atomic_ll_sc.h
 create mode 100644 arch/arm64/include/asm/atomic_lse.h
 create mode 100644 arch/arm64/include/asm/lse.h
 create mode 100644 arch/arm64/lib/atomic_ll_sc.c
Signature · 1 line
2.1.4