linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 00/11] Zacas/Zabha support and qspinlocks
@ 2024-07-17  6:19 Alexandre Ghiti
  2024-07-17  6:19 ` [PATCH v3 01/11] riscv: Implement cmpxchg32/64() using Zacas Alexandre Ghiti
                   ` (11 more replies)
  0 siblings, 12 replies; 40+ messages in thread
From: Alexandre Ghiti @ 2024-07-17  6:19 UTC (permalink / raw)
  To: Jonathan Corbet, Paul Walmsley, Palmer Dabbelt, Albert Ou,
	Conor Dooley, Rob Herring, Krzysztof Kozlowski, Andrea Parri,
	Nathan Chancellor, Peter Zijlstra, Ingo Molnar, Will Deacon,
	Waiman Long, Boqun Feng, Arnd Bergmann, Leonardo Bras, Guo Ren,
	linux-doc, linux-kernel, linux-riscv, linux-arch
  Cc: Alexandre Ghiti

This implements [cmp]xchgXX() macros using Zacas and Zabha extensions
and finally uses those newly introduced macros to add support for
qspinlocks: note that this implementation of qspinlocks satisfies the
forward progress guarantee.

It also uses Ziccrse to provide the qspinlock implementation.

Thanks to Guo and Leonardo for their work!

v2: https://lore.kernel.org/linux-riscv/20240626130347.520750-1-alexghiti@rivosinc.com/
v1: https://lore.kernel.org/linux-riscv/20240528151052.313031-1-alexghiti@rivosinc.com/

Changes in v3:
- Fix patch 4 to restrict the optimization to fully ordered AMO (Andrea)
- Move RISCV_ISA_EXT_ZABHA definition to patch 4 (Andrea)
- !Zacas at build time => no CAS from Zabha too (Andrea)
- drop patch 7 "riscv: Improve amoswap.X use in xchg()" (Andrea)
- Switch lr/sc and cas order (Guo)
- Combo spinlocks do not depend on Zabha
- Add a Kconfig for ticket/queued/combo (Guo)
- Use Ziccrse (Guo)

Changes in v2:
- Add patch for Zabha dtbinding (Conor)
- Fix cmpxchg128() build warnings missed in v1
- Make arch_cmpxchg128() fully ordered
- Improve Kconfig help texts for both extensions (Conor)
- Fix Makefile dependencies by requiring TOOLCHAIN_HAS_XXX (Nathan)
- Fix compilation errors when the toolchain does not support the
  extensions (Nathan)
- Fix C23 warnings about label at the end of coumpound statements (Nathan)
- Fix Zabha and !Zacas configurations (Andrea)
- Add COMBO spinlocks (Guo)
- Improve amocas fully ordered operations by using .aqrl semantics and
  removing the fence rw, rw (Andrea)
- Rebase on top "riscv: Fix fully ordered LR/SC xchg[8|16]() implementations"
- Add ARCH_WEAK_RELEASE_ACQUIRE (Andrea)
- Remove the extension version in march for LLVM since it is only required
  for experimental extensions (Nathan)
- Fix cmpxchg128() implementation by adding both registers of a pair
  in the list of input/output operands

Alexandre Ghiti (9):
  riscv: Implement cmpxchg32/64() using Zacas
  dt-bindings: riscv: Add Zabha ISA extension description
  riscv: Implement cmpxchg8/16() using Zabha
  riscv: Improve zacas fully-ordered cmpxchg()
  riscv: Implement arch_cmpxchg128() using Zacas
  riscv: Implement xchg8/16() using Zabha
  riscv: Add ISA extension parsing for Ziccrse
  dt-bindings: riscv: Add Ziccrse ISA extension description
  riscv: Add qspinlock support

Guo Ren (2):
  asm-generic: ticket-lock: Reuse arch_spinlock_t of qspinlock
  asm-generic: ticket-lock: Add separate ticket-lock.h

 .../devicetree/bindings/riscv/extensions.yaml |  12 ++
 .../locking/queued-spinlocks/arch-support.txt |   2 +-
 arch/riscv/Kconfig                            |  64 +++++++
 arch/riscv/Makefile                           |   6 +
 arch/riscv/include/asm/Kbuild                 |   4 +-
 arch/riscv/include/asm/cmpxchg.h              | 173 +++++++++++++++---
 arch/riscv/include/asm/hwcap.h                |   2 +
 arch/riscv/include/asm/spinlock.h             |  39 ++++
 arch/riscv/kernel/cpufeature.c                |   2 +
 arch/riscv/kernel/setup.c                     |  33 ++++
 include/asm-generic/qspinlock.h               |   2 +
 include/asm-generic/spinlock.h                |  87 +--------
 include/asm-generic/spinlock_types.h          |  12 +-
 include/asm-generic/ticket_spinlock.h         | 105 +++++++++++
 14 files changed, 424 insertions(+), 119 deletions(-)
 create mode 100644 arch/riscv/include/asm/spinlock.h
 create mode 100644 include/asm-generic/ticket_spinlock.h

-- 
2.39.2


^ permalink raw reply	[flat|nested] 40+ messages in thread

end of thread, other threads:[~2024-07-19 11:53 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-17  6:19 [PATCH v3 00/11] Zacas/Zabha support and qspinlocks Alexandre Ghiti
2024-07-17  6:19 ` [PATCH v3 01/11] riscv: Implement cmpxchg32/64() using Zacas Alexandre Ghiti
2024-07-17 15:08   ` Andrew Jones
2024-07-17 15:18     ` Alexandre Ghiti
2024-07-19  0:45   ` Samuel Holland
2024-07-19 11:48     ` Alexandre Ghiti
2024-07-19 11:53       ` Alexandre Ghiti
2024-07-17  6:19 ` [PATCH v3 02/11] dt-bindings: riscv: Add Zabha ISA extension description Alexandre Ghiti
2024-07-17  6:42   ` Krzysztof Kozlowski
2024-07-17  9:32   ` Guo Ren
2024-07-17  6:19 ` [PATCH v3 03/11] riscv: Implement cmpxchg8/16() using Zabha Alexandre Ghiti
2024-07-17 15:26   ` Andrew Jones
2024-07-17 15:29     ` Conor Dooley
2024-07-17 15:34       ` Alexandre Ghiti
2024-07-18 12:50     ` Alexandre Ghiti
2024-07-18 16:06       ` Andrew Jones
2024-07-18 16:20         ` Alexandre Ghiti
2024-07-17  6:19 ` [PATCH v3 04/11] riscv: Improve zacas fully-ordered cmpxchg() Alexandre Ghiti
2024-07-17  6:19 ` [PATCH v3 05/11] riscv: Implement arch_cmpxchg128() using Zacas Alexandre Ghiti
2024-07-17 20:34   ` Andrew Jones
2024-07-18  7:48     ` Alexandre Ghiti
2024-07-18  8:33       ` Conor Dooley
2024-07-18  9:35         ` Arnd Bergmann
2024-07-17  6:19 ` [PATCH v3 06/11] riscv: Implement xchg8/16() using Zabha Alexandre Ghiti
2024-07-17  6:19 ` [PATCH v3 07/11] asm-generic: ticket-lock: Reuse arch_spinlock_t of qspinlock Alexandre Ghiti
2024-07-17  6:19 ` [PATCH v3 08/11] asm-generic: ticket-lock: Add separate ticket-lock.h Alexandre Ghiti
2024-07-17  6:19 ` [PATCH v3 09/11] riscv: Add ISA extension parsing for Ziccrse Alexandre Ghiti
2024-07-19  0:53   ` Samuel Holland
2024-07-19  9:11     ` Alexandre Ghiti
2024-07-17  6:19 ` [PATCH v3 10/11] dt-bindings: riscv: Add Ziccrse ISA extension description Alexandre Ghiti
2024-07-17  6:55   ` Krzysztof Kozlowski
2024-07-17  9:42   ` Guo Ren
2024-07-17  6:19 ` [PATCH v3 11/11] riscv: Add qspinlock support Alexandre Ghiti
2024-07-17  9:30   ` Guo Ren
2024-07-18 13:11     ` Alexandre Ghiti
2024-07-17 16:29   ` Andrea Parri
2024-07-18 13:08     ` Alexandre Ghiti
2024-07-19  1:05   ` Samuel Holland
2024-07-19  9:06     ` Alexandre Ghiti
2024-07-17 16:37 ` [PATCH v3 00/11] Zacas/Zabha support and qspinlocks Andrea Parri

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).