riscv: Implement cmpxchg8/16() using Zabha
authorAlexandre Ghiti <alexghiti@rivosinc.com>
Sun, 3 Nov 2024 14:51:45 +0000 (15:51 +0100)
committerPalmer Dabbelt <palmer@rivosinc.com>
Mon, 11 Nov 2024 15:33:12 +0000 (07:33 -0800)
commit1658ef4314b37ff4858a6c207646ff9d280ca4f7
tree411b13687626ced159b40c4e8a0bb797dec15c29
parent51624ddcf59dd78c810fd7da768d688e193b42d6
riscv: Implement cmpxchg8/16() using Zabha

This adds runtime support for Zabha in cmpxchg8/16() operations.

Note that in the absence of Zacas support in the toolchain, CAS
instructions from Zabha won't be used.

Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Andrea Parri <parri.andrea@gmail.com>
Link: https://lore.kernel.org/r/20241103145153.105097-6-alexghiti@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/Kconfig
arch/riscv/Makefile
arch/riscv/include/asm/cmpxchg.h
arch/riscv/include/asm/hwcap.h
arch/riscv/kernel/cpufeature.c