Skip to content

Commit ae69471

Browse files
Pu LehuiKernel Patches Daemon
authored andcommitted
riscv: Separate toolchain support dependency from RISCV_ISA_ZACAS
RV64 bpf is going to support ZACAS instructions. Let's separate toolchain support dependency from RISCV_ISA_ZACAS. Signed-off-by: Pu Lehui <[email protected]>
1 parent 2831bf8 commit ae69471

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

arch/riscv/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,6 @@ config TOOLCHAIN_HAS_ZACAS
717717

718718
config RISCV_ISA_ZACAS
719719
bool "Zacas extension support for atomic CAS"
720-
depends on TOOLCHAIN_HAS_ZACAS
721720
depends on RISCV_ALTERNATIVE
722721
default y
723722
help

arch/riscv/include/asm/cmpxchg.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@
133133
({ \
134134
if (IS_ENABLED(CONFIG_RISCV_ISA_ZABHA) && \
135135
IS_ENABLED(CONFIG_RISCV_ISA_ZACAS) && \
136+
IS_ENABLED(CONFIG_TOOLCHAIN_HAS_ZACAS) && \
136137
riscv_has_extension_unlikely(RISCV_ISA_EXT_ZABHA) && \
137138
riscv_has_extension_unlikely(RISCV_ISA_EXT_ZACAS)) { \
138139
r = o; \
@@ -180,6 +181,7 @@
180181
r, p, co, o, n) \
181182
({ \
182183
if (IS_ENABLED(CONFIG_RISCV_ISA_ZACAS) && \
184+
IS_ENABLED(CONFIG_TOOLCHAIN_HAS_ZACAS) && \
183185
riscv_has_extension_unlikely(RISCV_ISA_EXT_ZACAS)) { \
184186
r = o; \
185187
\
@@ -315,7 +317,7 @@
315317
arch_cmpxchg_release((ptr), (o), (n)); \
316318
})
317319

318-
#if defined(CONFIG_64BIT) && defined(CONFIG_RISCV_ISA_ZACAS)
320+
#if defined(CONFIG_64BIT) && defined(CONFIG_RISCV_ISA_ZACAS) && defined(CONFIG_TOOLCHAIN_HAS_ZACAS)
319321

320322
#define system_has_cmpxchg128() riscv_has_extension_unlikely(RISCV_ISA_EXT_ZACAS)
321323

@@ -351,7 +353,7 @@ union __u128_halves {
351353
#define arch_cmpxchg128_local(ptr, o, n) \
352354
__arch_cmpxchg128((ptr), (o), (n), "")
353355

354-
#endif /* CONFIG_64BIT && CONFIG_RISCV_ISA_ZACAS */
356+
#endif /* CONFIG_64BIT && CONFIG_RISCV_ISA_ZACAS && CONFIG_TOOLCHAIN_HAS_ZACAS */
355357

356358
#ifdef CONFIG_RISCV_ISA_ZAWRS
357359
/*

arch/riscv/kernel/setup.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ static void __init riscv_spinlock_init(void)
288288

289289
if (IS_ENABLED(CONFIG_RISCV_ISA_ZABHA) &&
290290
IS_ENABLED(CONFIG_RISCV_ISA_ZACAS) &&
291+
IS_ENABLED(CONFIG_TOOLCHAIN_HAS_ZACAS) &&
291292
riscv_isa_extension_available(NULL, ZABHA) &&
292293
riscv_isa_extension_available(NULL, ZACAS)) {
293294
using_ext = "using Zabha";

0 commit comments

Comments
 (0)