]> www.infradead.org Git - users/jedix/linux-maple.git/commit
riscv: Improve zacas fully-ordered cmpxchg()
authorAlexandre Ghiti <alexghiti@rivosinc.com>
Sun, 3 Nov 2024 14:51:46 +0000 (15:51 +0100)
committerPalmer Dabbelt <palmer@rivosinc.com>
Mon, 11 Nov 2024 15:33:13 +0000 (07:33 -0800)
commit6116e22ef33a8239f3d53bb25377e9ed733c4176
treead8f8c9ea81fded5b2cae3f1213d0f8ddc648b73
parent1658ef4314b37ff4858a6c207646ff9d280ca4f7
riscv: Improve zacas fully-ordered cmpxchg()

The current fully-ordered cmpxchgXX() implementation results in:

  amocas.X.rl     a5,a4,(s1)
  fence           rw,rw

This provides enough sync but we can actually use the following better
mapping instead:

  amocas.X.aqrl   a5,a4,(s1)

Suggested-by: Andrea Parri <andrea@rivosinc.com>
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-7-alexghiti@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/include/asm/cmpxchg.h