Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1732667 > unrolled thread

[PATCH] arm64: Unconditionally support ARCH_HAVE_NMI_SAFE_CMPXCHG

Started byStephen Boyd <sboyd@codeaurora.org>
First post2017-09-15 03:20 +0200
Last post2017-09-15 21:20 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] arm64: Unconditionally support ARCH_HAVE_NMI_SAFE_CMPXCHG Stephen Boyd <sboyd@codeaurora.org> - 2017-09-15 03:20 +0200
    Re: [PATCH] arm64: Unconditionally support ARCH_HAVE_NMI_SAFE_CMPXCHG James Morse <james.morse@arm.com> - 2017-09-15 20:40 +0200
      Re: [PATCH] arm64: Unconditionally support ARCH_HAVE_NMI_SAFE_CMPXCHG Stephen Boyd <sboyd@codeaurora.org> - 2017-09-15 21:20 +0200

#1732667 — [PATCH] arm64: Unconditionally support ARCH_HAVE_NMI_SAFE_CMPXCHG

FromStephen Boyd <sboyd@codeaurora.org>
Date2017-09-15 03:20 +0200
Subject[PATCH] arm64: Unconditionally support ARCH_HAVE_NMI_SAFE_CMPXCHG
Message-ID<upNsu-4eb-9@gated-at.bofh.it>
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 <tbaicar@codeaurora.org>
Cc: Jonathan (Zhixiong) Zhang <zjzhang@codeaurora.org>
Cc: James Morse <james.morse@arm.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
---
 arch/arm64/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 0df64a6a56d4..27ce2ab7b080 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -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
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

[toc] | [next] | [standalone]


#1733016

FromJames Morse <james.morse@arm.com>
Date2017-09-15 20:40 +0200
Message-ID<uq3GW-6Mo-25@gated-at.bofh.it>
In reply to#1732667
Hi Stephen,

On 15/09/17 02:19, Stephen Boyd wrote:
> 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?


> 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,

Acked-by: James Morse <james.morse@arm.com>


Thanks,

James

> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index 0df64a6a56d4..27ce2ab7b080 100644
> --- a/arch/arm64/Kconfig
> +++ b/arch/arm64/Kconfig
> @@ -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
> 

[toc] | [prev] | [next] | [standalone]


#1733038

FromStephen Boyd <sboyd@codeaurora.org>
Date2017-09-15 21:20 +0200
Message-ID<uq4jE-7gb-13@gated-at.bofh.it>
In reply to#1733016
On 09/15, James Morse wrote:
> On 15/09/17 02:19, Stephen Boyd wrote:
> > 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.

> 
> 
> > 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.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web