[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4F635E06.8070006@windriver.com>
Date: Fri, 16 Mar 2012 10:36:38 -0500
From: Jason Wessel <jason.wessel@...driver.com>
To: Jan Kiszka <jan.kiszka@...mens.com>
CC: <linux-kernel@...r.kernel.org>,
<kgdb-bugreport@...ts.sourceforge.net>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>, <x86@...nel.org>
Subject: Re: [PATCH 4/4] kgdb: x86: Detach gdb if machine shuts down or reboots
On 03/16/2012 07:17 AM, Jan Kiszka wrote:
> Hook into machine restart/power-off/halt handlers and call gdbstub_exit
> so that a attached gdb frontend is properly informed. If kgdb is
> disabled or no frontend attached, gdbstub_exit will do nothing.
>
We have long had an out of tree patch which hooked the reboot notifier, vs adding call backs to the actual reboot functions. It seems at first glance that all of cases that Jan probably cares about are actually caught by the reboot notifier.
I attached the patch I am referencing, and perhaps Jan can try it out. It applies on top of Jan's series at the moment.
A few more comments first.
> static void __machine_emergency_restart(int emergency)
> {
> reboot_emergency = emergency;
> + gdbstub_exit(1);
If we do have to add callbacks at the arch level, my preference is to pass the stop code like you would have received in the reboot notifier. Specifically something like: gdbstub_exit(SYS_RESTART).
> machine_ops.emergency_restart();
> }
>
> @@ -730,6 +732,7 @@ struct machine_ops machine_ops = {
>
> void machine_power_off(void)
> {
> + gdbstub_exit(0);
Similarly gdbstub_exit(SYS_HALT) and so on.
Jan, what do you think about trying the reboot notifier version?
Thanks,
Jason.
View attachment "kgdb-detach-on-reboot-notify.patch" of type "text/x-diff" (2321 bytes)
Powered by blists - more mailing lists