[PATCH 0/7] Zacas/Zabha support and qspinlocks

From: Alexandre Ghiti
Date: Tue May 28 2024 - 11:12:05 EST


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.

Thanks to Guo and Leonardo for their work!

Alexandre Ghiti (5):
riscv: Implement cmpxchg32/64() using Zacas
riscv: Implement cmpxchg8/16() using Zabha
riscv: Implement arch_cmpxchg128() using Zacas
riscv: Implement xchg8/16() using Zabha
riscv: Add qspinlock support based on Zabha extension

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

.../locking/queued-spinlocks/arch-support.txt | 2 +-
arch/riscv/Kconfig | 35 ++++++
arch/riscv/Makefile | 21 ++++
arch/riscv/include/asm/Kbuild | 4 +-
arch/riscv/include/asm/cmpxchg.h | 114 ++++++++++++++++--
arch/riscv/include/asm/hwcap.h | 1 +
arch/riscv/include/asm/spinlock.h | 39 ++++++
arch/riscv/kernel/cpufeature.c | 1 +
arch/riscv/kernel/setup.c | 18 +++
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 ++++++++++++++++
13 files changed, 336 insertions(+), 105 deletions(-)
create mode 100644 arch/riscv/include/asm/spinlock.h
create mode 100644 include/asm-generic/ticket_spinlock.h

--
2.39.2