From: Vaibhav Jain <vaibhav@linux.vnet.ibm.com>
To: Michal Suchanek <msuchanek@suse.de>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Paul Mackerras <paulus@samba.org>,
Michael Ellerman <mpe@ellerman.id.au>,
Balbir Singh <bsingharora@gmail.com>,
Nicholas Piggin <npiggin@gmail.com>,
Breno Leitao <leitao@debian.org>,
"Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>,
"Guilherme G. Piccoli" <gpiccoli@linux.vnet.ibm.com>,
linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Cc: Michal Suchanek <msuchanek@suse.de>
Subject: Re: [PATCH] powerpc/xmon: really enable xmon when a breakpoint is set
Date: Tue, 22 May 2018 12:53:53 +0530 [thread overview]
Message-ID: <87bmd8xieu.fsf@vajain21.in.ibm.com> (raw)
In-Reply-To: <20180521132108.7938-1-msuchanek@suse.de>
Thanks for the patch Michal,
Michal Suchanek <msuchanek@suse.de> writes:
> When single-stepping kernel code from xmon without a debug hook enabled
> the kernel crashes. This can happen when kernel starts with xmon on
> crash disabled but xmon is entered using sysrq.
>
> Commit e1368d0c9edb ("powerpc/xmon: Setup debugger hooks when first
> break-point is set") adds force_enable_xmon function that prints
> "xmon: Enabling debugger hooks" but does not enable them.
Debugger hooks are enabled just befores debugger() is entered from
sysrq_handle_xmon(). Thats why force_enable_xmon() simply sets sets
'xmon_on=1' and exits.
The problem you are seeing is probably due to sysrq_handle_xmon()
clearing the debugger hooks on return from debugger() as xmon_on was
never set for the 's' xmon command.
> Add the call to xmon_init to install the debugger hooks in
> force_enable_xmon and also call force_enable_xmon when single-stepping
> in xmon.
Only calling force_enable_xmon() from do_step() should be suffice as on exit
from the debugger() the value of xmon_on is checked and if required the
debugger hooks are kept instead of getting cleared.
> arch/powerpc/xmon/xmon.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
> index a0842f1ff72c..504bd1c3d8b0 100644
> --- a/arch/powerpc/xmon/xmon.c
> +++ b/arch/powerpc/xmon/xmon.c
> @@ -1275,6 +1279,7 @@ static inline void force_enable_xmon(void)
> if (!xmon_on) {
> printf("xmon: Enabling debugger hooks\n");
> xmon_on = 1;
> + xmon_init(1);
> }
> }
As mentioned above call to force_enable_xmon() is usually done in context of
sysrq_handle_xmon() which sets the debugger hooks as soon as its
entered. So I think that this hunk is not really needed.
--
Vaibhav Jain <vaibhav@linux.vnet.ibm.com>
Linux Technology Center, IBM India Pvt. Ltd.
next prev parent reply other threads:[~2018-05-22 7:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-21 13:21 [PATCH] powerpc/xmon: really enable xmon when a breakpoint is set Michal Suchanek
2018-05-22 7:23 ` Vaibhav Jain [this message]
2018-05-23 17:58 ` Michal Suchánek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87bmd8xieu.fsf@vajain21.in.ibm.com \
--to=vaibhav@linux.vnet.ibm.com \
--cc=benh@kernel.crashing.org \
--cc=bsingharora@gmail.com \
--cc=gpiccoli@linux.vnet.ibm.com \
--cc=leitao@debian.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=msuchanek@suse.de \
--cc=naveen.n.rao@linux.vnet.ibm.com \
--cc=npiggin@gmail.com \
--cc=paulus@samba.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox