[v2,12/12] powerpc/64s: system reset do not trace
diff mbox series

Message ID 20200325103410.157573-13-npiggin@gmail.com
State New
Headers show
Series
  • powerpc/64: machine check and system reset fixes
Related show

Checks

Context Check Description
snowpatch_ozlabs/apply_patch fail Failed to apply to any branch

Commit Message

Nicholas Piggin March 25, 2020, 10:34 a.m. UTC
Similarly to the previous patch, do not trace system reset. This code
is used when there is a crash or hang, and tracing disturbs the system
more and has been known to crash in the crash handling path.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
 arch/powerpc/kernel/traps.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Naveen N. Rao March 26, 2020, 5:23 p.m. UTC | #1
Nicholas Piggin wrote:
> Similarly to the previous patch, do not trace system reset. This code
> is used when there is a crash or hang, and tracing disturbs the system
> more and has been known to crash in the crash handling path.
> 
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> ---
>  arch/powerpc/kernel/traps.c | 5 +++++
>  1 file changed, 5 insertions(+)

For the ftrace bits:
Acked-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>

> 
> diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
> index 1845fd7e161a..ed7b7a6e2dc0 100644
> --- a/arch/powerpc/kernel/traps.c
> +++ b/arch/powerpc/kernel/traps.c
> @@ -443,6 +443,9 @@ void system_reset_exception(struct pt_regs *regs)
>  	unsigned long hsrr0, hsrr1;
>  	bool nested = in_nmi();
>  	bool saved_hsrrs = false;
> +	u8 ftrace_enabled = local_paca->ftrace_enabled;
> +
> +	local_paca->ftrace_enabled = 0;
>  
>  	/*
>  	 * Avoid crashes in case of nested NMI exceptions. Recoverability
> @@ -524,6 +527,8 @@ void system_reset_exception(struct pt_regs *regs)
>  	if (!nested)
>  		nmi_exit();
>  
> +	local_paca->ftrace_enabled = ftrace_enabled;
> +

I suppose we could add helpers to save/restore the state. But, since we 
only have these two users as of now, we can revisit that if the need 
arises.


- Naveen

Patch
diff mbox series

diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index 1845fd7e161a..ed7b7a6e2dc0 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -443,6 +443,9 @@  void system_reset_exception(struct pt_regs *regs)
 	unsigned long hsrr0, hsrr1;
 	bool nested = in_nmi();
 	bool saved_hsrrs = false;
+	u8 ftrace_enabled = local_paca->ftrace_enabled;
+
+	local_paca->ftrace_enabled = 0;
 
 	/*
 	 * Avoid crashes in case of nested NMI exceptions. Recoverability
@@ -524,6 +527,8 @@  void system_reset_exception(struct pt_regs *regs)
 	if (!nested)
 		nmi_exit();
 
+	local_paca->ftrace_enabled = ftrace_enabled;
+
 	/* What should we do here? We could issue a shutdown or hard reset. */
 }