]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
riscv: Enable ARCH_HAVE_NMI_SAFE_CMPXCHG
authorPu Lehui <pulehui@huawei.com>
Fri, 11 Jul 2025 09:04:43 +0000 (09:04 +0000)
committerPaul Walmsley <pjw@kernel.org>
Thu, 18 Sep 2025 14:20:59 +0000 (08:20 -0600)
commit205cbc714842478df4239b5be205b9b459fd9fbc
tree020e74a5f4a45793f0d38c266a7d64dc1849444d
parent6dab7e15c0b312be79ccadf85c9ec7332427ba7b
riscv: Enable ARCH_HAVE_NMI_SAFE_CMPXCHG

The implement of cmpxchg() in riscv is based on atomic primitives and
has NMI-safe features, so it can be used safely in the in_nmi context.
ftrace's ringbuffer relies on NMI-safe cmpxchg() in the NMI context.
Currently, in_nmi() is true when riscv kprobe is in trap-based mode, so
this config needs to be selected, otherwise kprobetrace will not be
available.

Signed-off-by: Pu Lehui <pulehui@huawei.com>
Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Tested-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Link: https://lore.kernel.org/r/20250711090443.1688404-1-pulehui@huaweicloud.com
[pjw@kernel.org: moved to preserve alphabetical order]
Signed-off-by: Paul Walmsley <pjw@kernel.org>
arch/riscv/Kconfig