Skip to contentSkip to conversation

arm64: Unconditionally support ARCH_HAVE_NMI_SAFE_CMPXCHG

PATCH In review Stephen Boyd 2 participants 3 messages Sep 15, 2017 arm64

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: Unconditionally support ARCH_HAVE_NMI_SAFE_CMPXCHG

Quoted 1 line

From what I can see there isn't anything about ACPI_APEI_SEA that

means the arm64 architecture can or cannot support NMI safe cmpxchg, so the if condition here is not important. Let's remove it. Doing that allows us to support ftrace histograms via CONFIG_HIST_TRIGGERS that depends on the arch having this config selected.

Cc Tyler Baicar <[email protected]>
Cc Jonathan (Zhixiong) Zhang <[email protected]>
Cc James Morse <[email protected]>
---
 arch/arm64/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/Kconfig +1 -1
index 0df64a6a56d4..27ce2ab7b080 100644
@@ -21,7 +21,7 @@ config ARM64
 	select ARCH_HAS_STRICT_KERNEL_RWX
 	select ARCH_HAS_STRICT_MODULE_RWX
 	select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
-	select ARCH_HAVE_NMI_SAFE_CMPXCHG if ACPI_APEI_SEA
+	select ARCH_HAVE_NMI_SAFE_CMPXCHG
 	select ARCH_USE_CMPXCHG_LOCKREF
 	select ARCH_SUPPORTS_MEMORY_FAILURE
 	select ARCH_SUPPORTS_ATOMIC_RMW
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
Acked-by on v1 1/1
#1 lore raw

Hi Stephen,

Quoted 3 lines · Stephen Boyd

From what I can see there isn't anything about ACPI_APEI_SEA that means the arm64 architecture can or cannot support NMI safe cmpxchg, so the if condition here is not important.

Yup, it was to match 'HAVE_NMI', which was new with ACPI_APEI_SEA and pulls in some printk() stuff.

... how come you don't need to change HAVE_NMI too?

Quoted 4 lines

Let's remove
it. Doing that allows us to support ftrace histograms via CONFIG_HIST_TRIGGERS that depends on the arch having this config selected.

What does CONFIG_HIST_TRIGGERS need this for? I can't see any cmpxchg use in kernel/trace/trace_events_hist.c

Regardless,

Thanks,

James

Quoted 14 lines
arch/arm64/Kconfig +1 -1
index 0df64a6a56d4..27ce2ab7b080 100644
@@ -21,7 +21,7 @@ config ARM64
 	select ARCH_HAS_STRICT_KERNEL_RWX
 	select ARCH_HAS_STRICT_MODULE_RWX
 	select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
-	select ARCH_HAVE_NMI_SAFE_CMPXCHG if ACPI_APEI_SEA
+	select ARCH_HAVE_NMI_SAFE_CMPXCHG
 	select ARCH_USE_CMPXCHG_LOCKREF
 	select ARCH_SUPPORTS_MEMORY_FAILURE
 	select ARCH_SUPPORTS_ATOMIC_RMW
#2 lore raw
Quoted 9 lines · James Morse
Quoted 3 lines · Stephen Boyd

From what I can see there isn't anything about ACPI_APEI_SEA that means the arm64 architecture can or cannot support NMI safe cmpxchg, so the if condition here is not important.

Yup, it was to match 'HAVE_NMI', which was new with ACPI_APEI_SEA and pulls in some printk() stuff.

... how come you don't need to change HAVE_NMI too?

I didn't change HAVE_NMI because it wasn't needed to get hist triggers working. Sorry, I didn't even notice that HAVE_NMI was also there, probably both of these configs should drop the condition. I'll update the patch to do so.

Quoted 9 lines
Quoted 6 lines

Let's remove
it. Doing that allows us to support ftrace histograms via CONFIG_HIST_TRIGGERS that depends on the arch having this config selected.

What does CONFIG_HIST_TRIGGERS need this for? I can't see any cmpxchg use in kernel/trace/trace_events_hist.c

True. I think this isn't necessary for CONFIG_HIST_TRIGGERS, but more for CONFIG_TRACING_MAP that is selected and used by CONFIG_HIST_TRIGGERS. We put the dependency in both places so we don't get the trigger config selecting a config that has unmet dependencies. Note there's a cmpxchg in the tracing map code too.

Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project