linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/xmon: Fix disabling tracing while in xmon
@ 2019-06-27  9:59 Naveen N. Rao
  2019-07-03 14:27 ` Michael Ellerman
  0 siblings, 1 reply; 2+ messages in thread
From: Naveen N. Rao @ 2019-06-27  9:59 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: linuxppc-dev

Commit ed49f7fd6438d ("powerpc/xmon: Disable tracing when entering
xmon") added code to disable recording trace entries while in xmon. The
commit introduced a variable 'tracing_enabled' to record if tracing was
enabled on xmon entry, and used this to conditionally enable tracing
during exit from xmon.

However, we are not checking the value of 'fromipi' variable in
xmon_core() when setting 'tracing_enabled'. Due to this, when secondary
cpus enter xmon, they will see tracing as being disabled already and
tracing won't be re-enabled on exit. Fix the same.

Fixes: ed49f7fd6438d ("powerpc/xmon: Disable tracing when entering xmon")
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
---
 arch/powerpc/xmon/xmon.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index d0620d762a5a..4a721fd62406 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -465,8 +465,10 @@ static int xmon_core(struct pt_regs *regs, int fromipi)
 	local_irq_save(flags);
 	hard_irq_disable();
 
-	tracing_enabled = tracing_is_on();
-	tracing_off();
+	if (!fromipi) {
+		tracing_enabled = tracing_is_on();
+		tracing_off();
+	}
 
 	bp = in_breakpoint_table(regs->nip, &offset);
 	if (bp != NULL) {
-- 
2.22.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] powerpc/xmon: Fix disabling tracing while in xmon
  2019-06-27  9:59 [PATCH] powerpc/xmon: Fix disabling tracing while in xmon Naveen N. Rao
@ 2019-07-03 14:27 ` Michael Ellerman
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2019-07-03 14:27 UTC (permalink / raw)
  To: Naveen N. Rao; +Cc: linuxppc-dev

On Thu, 2019-06-27 at 09:59:40 UTC, "Naveen N. Rao" wrote:
> Commit ed49f7fd6438d ("powerpc/xmon: Disable tracing when entering
> xmon") added code to disable recording trace entries while in xmon. The
> commit introduced a variable 'tracing_enabled' to record if tracing was
> enabled on xmon entry, and used this to conditionally enable tracing
> during exit from xmon.
> 
> However, we are not checking the value of 'fromipi' variable in
> xmon_core() when setting 'tracing_enabled'. Due to this, when secondary
> cpus enter xmon, they will see tracing as being disabled already and
> tracing won't be re-enabled on exit. Fix the same.
> 
> Fixes: ed49f7fd6438d ("powerpc/xmon: Disable tracing when entering xmon")
> Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/aaf06665f7ea3ee9f9754e16c1a507a89f1de5b1

cheers

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-07-03 14:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-27  9:59 [PATCH] powerpc/xmon: Fix disabling tracing while in xmon Naveen N. Rao
2019-07-03 14:27 ` Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).