]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
ARM: 9050/1: Kconfig: Select ARCH_HAVE_NMI_SAFE_CMPXCHG where possible
authorDaniel Thompson <daniel.thompson@linaro.org>
Fri, 15 Jan 2021 12:21:10 +0000 (13:21 +0100)
committerRussell King <rmk+kernel@armlinux.org.uk>
Mon, 1 Feb 2021 19:47:59 +0000 (19:47 +0000)
Currently ARCH_HAVE_NMI_SAFE_CMPXCHG is not set on Arm systems and this
makes it impossible to enable features such as ftrace histogram triggers
on Arm platforms.

Most Arm systems are NMI safe simply because there is no NMI but this isn't
universally true meaning we cannot set ARCH_HAVE_NMI_SAFE_CMPXCHG for all
Arm devices. However the load/store exclusive implementation of cmpxchg is
NMI-safe and this implementation is used ARMv6k and later. Let's select
ARCH_HAVE_NMI_SAFE_CMPXCHG for these systems.

Note that ARMv6 uses load/store exclusive for 32-bit cmpxchg but relies on
interrupt masking for 8- and 16-bit operations. This patch is conservative
and does not change behaviour for CPU_V6.

Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
arch/arm/Kconfig

index 9860057775ee72a97970cffc937cdfd868b4a123..2424d1648c65847fe719bad0fa91df70921cea41 100644 (file)
@@ -23,6 +23,7 @@ config ARM
        select ARCH_HAS_TEARDOWN_DMA_OPS if MMU
        select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
        select ARCH_HAVE_CUSTOM_GPIO_H
+       select ARCH_HAVE_NMI_SAFE_CMPXCHG if CPU_V7 || CPU_V7M || CPU_V6K
        select ARCH_HAS_GCOV_PROFILE_ALL
        select ARCH_KEEP_MEMBLOCK
        select ARCH_MIGHT_HAVE_PC_PARPORT