mirror of
https://github.com/torvalds/linux.git
synced 2026-05-25 23:52:08 +02:00
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 <pulehui@huawei.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Tested-by: Björn Töpel <bjorn@rivosinc.com> Reviewed-by: Björn Töpel <bjorn@rivosinc.com> Acked-by: Björn Töpel <bjorn@kernel.org> Link: https://lore.kernel.org/bpf/20250719091730.2660197-5-pulehui@huaweicloud.com
This commit is contained in:
parent
01422a4f2c
commit
ec74ae5662
|
|
@ -714,7 +714,6 @@ config TOOLCHAIN_HAS_ZACAS
|
|||
|
||||
config RISCV_ISA_ZACAS
|
||||
bool "Zacas extension support for atomic CAS"
|
||||
depends on TOOLCHAIN_HAS_ZACAS
|
||||
depends on RISCV_ALTERNATIVE
|
||||
default y
|
||||
help
|
||||
|
|
|
|||
|
|
@ -133,6 +133,7 @@
|
|||
({ \
|
||||
if (IS_ENABLED(CONFIG_RISCV_ISA_ZABHA) && \
|
||||
IS_ENABLED(CONFIG_RISCV_ISA_ZACAS) && \
|
||||
IS_ENABLED(CONFIG_TOOLCHAIN_HAS_ZACAS) && \
|
||||
riscv_has_extension_unlikely(RISCV_ISA_EXT_ZABHA) && \
|
||||
riscv_has_extension_unlikely(RISCV_ISA_EXT_ZACAS)) { \
|
||||
r = o; \
|
||||
|
|
@ -180,6 +181,7 @@
|
|||
r, p, co, o, n) \
|
||||
({ \
|
||||
if (IS_ENABLED(CONFIG_RISCV_ISA_ZACAS) && \
|
||||
IS_ENABLED(CONFIG_TOOLCHAIN_HAS_ZACAS) && \
|
||||
riscv_has_extension_unlikely(RISCV_ISA_EXT_ZACAS)) { \
|
||||
r = o; \
|
||||
\
|
||||
|
|
@ -315,7 +317,7 @@
|
|||
arch_cmpxchg_release((ptr), (o), (n)); \
|
||||
})
|
||||
|
||||
#if defined(CONFIG_64BIT) && defined(CONFIG_RISCV_ISA_ZACAS)
|
||||
#if defined(CONFIG_64BIT) && defined(CONFIG_RISCV_ISA_ZACAS) && defined(CONFIG_TOOLCHAIN_HAS_ZACAS)
|
||||
|
||||
#define system_has_cmpxchg128() riscv_has_extension_unlikely(RISCV_ISA_EXT_ZACAS)
|
||||
|
||||
|
|
@ -351,7 +353,7 @@ union __u128_halves {
|
|||
#define arch_cmpxchg128_local(ptr, o, n) \
|
||||
__arch_cmpxchg128((ptr), (o), (n), "")
|
||||
|
||||
#endif /* CONFIG_64BIT && CONFIG_RISCV_ISA_ZACAS */
|
||||
#endif /* CONFIG_64BIT && CONFIG_RISCV_ISA_ZACAS && CONFIG_TOOLCHAIN_HAS_ZACAS */
|
||||
|
||||
#ifdef CONFIG_RISCV_ISA_ZAWRS
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -290,6 +290,7 @@ static void __init riscv_spinlock_init(void)
|
|||
|
||||
if (IS_ENABLED(CONFIG_RISCV_ISA_ZABHA) &&
|
||||
IS_ENABLED(CONFIG_RISCV_ISA_ZACAS) &&
|
||||
IS_ENABLED(CONFIG_TOOLCHAIN_HAS_ZACAS) &&
|
||||
riscv_isa_extension_available(NULL, ZABHA) &&
|
||||
riscv_isa_extension_available(NULL, ZACAS)) {
|
||||
using_ext = "using Zabha";
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user