From 46980605309e922d14f646c6705d184cb674c0f7 Mon Sep 17 00:00:00 2001 From: Olivier Dion Date: Thu, 28 Sep 2023 12:53:46 -0400 Subject: [PATCH] urcu/uatomic/riscv: Mark RISC-V as broken Implementations of some atomic operations of GCC for RISC-V are insufficient for sequential consistency. For this reason Userspace RCU is currently marked as `broken' for RISC-V with GCC. However, it is still possible to use other toolchains. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104831 for details. For now, we mark every version of GCC as unsupported. Distribution package maintainers will have to cherry-pick the relevant patches in GCC then remove the #error in Userspace RCU if they want to support it. As for us, we will incrementally add specific versions of GCC that have fixed the issue whenever new stable releases are made from the GCC project. Change-Id: I2cd7c8f12068628b845a096e03f5f8100eacbe43 Signed-off-by: Olivier Dion Signed-off-by: Mathieu Desnoyers --- include/urcu/uatomic/riscv.h | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/include/urcu/uatomic/riscv.h b/include/urcu/uatomic/riscv.h index 9313190..a70ea25 100644 --- a/include/urcu/uatomic/riscv.h +++ b/include/urcu/uatomic/riscv.h @@ -3,9 +3,28 @@ // SPDX-License-Identifier: MIT /* - * Atomic exchange operations for the RISC-V architecture. Let GCC do it. + * Atomic exchange operations for the RISC-V architecture. + * + * Let the compiler do it. */ +/* + * See for details. + * + * Until the following patches are backported, Userspace RCU is broken for the + * RISC-V architecture when compiled with GCC. + * + * - + * - + * - + */ +#if defined(__GNUC__) +# error "Implementations of some atomic operations of GCC for RISC-V \ + are insufficient for sequential consistency. For this reason \ + Userspace RCU is currently marked as 'broken' for RISC-V with \ + GCC. However, it is still possible to use other toolchains." +#endif + #ifndef _URCU_ARCH_UATOMIC_RISCV_H #define _URCU_ARCH_UATOMIC_RISCV_H -- 2.34.1