public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jason Wessel <jason.wessel@windriver.com>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: <linux-kernel@vger.kernel.org>, <kgdb-bugreport@lists.sourceforge.net>
Subject: Re: [PATCH 2/4] kgdb: Make gdbstub_exit a nop unless gdb is attached
Date: Fri, 16 Mar 2012 11:04:10 -0500	[thread overview]
Message-ID: <4F63647A.2040306@windriver.com> (raw)
In-Reply-To: <c0c7d3cced4ab0b8b00d452cd9fd99c085fc513e.1331900215.git.jan.kiszka@siemens.com>

On 03/16/2012 07:17 AM, Jan Kiszka wrote:
> This allows to call gdbstub_exit without worrying if
> - CONFIG_KGDB is enabled
> - if an kgdb I/O driver is loaded
> - if a gdb frontend is currently attached

If you took a look at the alternate patch I sent in the 4 of 4 response, I made a modification for kdb to continue to work properly, namely disconnect and do not emit characters if we are in kdb mode.

>
> diff --git a/kernel/debug/gdbstub.c b/kernel/debug/gdbstub.c
> index c22d8c2..5d7ed0a 100644
> --- a/kernel/debug/gdbstub.c
> +++ b/kernel/debug/gdbstub.c
> @@ -1111,6 +1111,9 @@ void gdbstub_exit(int status)
> unsigned char checksum, ch, buffer[3];
> int loop;
>
> + if (!dbg_io_ops || !kgdb_connected)
> + return;
> +
> buffer[0] = 'W';
> buffer[1] = hex_asc_hi(status);
> buffer[2] = hex_asc_lo(status);

I patched against what you originally had there.

--- a/kernel/debug/gdbstub.c
+++ b/kernel/debug/gdbstub.c
@@ -1110,8 +1110,11 @@ void gdbstub_exit(int status)
 {
        unsigned char checksum, ch, buffer[3];
        int loop;
+       if (!kgdb_connected)
+               return;
+       kgdb_connected = 0;
 
-       if (!dbg_io_ops || !kgdb_connected)
+       if (!dbg_io_ops || dbg_kdb_mode)
                return;
 
        buffer[0] = 'W';

---

Depending on what we come to agreement on with patches 2-4 in your series I'll fold the changes into the reboot notifier.

It is possible to have both the reboot notifier and the low level modifications to the arch specific reboot hooks as a final catch, but I am interested to see what you think about just using the reboot notifier.

Cheers,
Jason.

  reply	other threads:[~2012-03-16 16:04 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-16 12:17 [PATCH 0/4] kgdb: Small usability improvements for x86 Jan Kiszka
2012-03-16 12:17 ` [PATCH 1/4] kgdb: x86: Return all segment registers also in 64-bit mode Jan Kiszka
2012-03-16 15:57   ` Jason Wessel
2012-03-19 13:52     ` Jan Kiszka
2012-03-19 20:52       ` Jason Wessel
2012-03-16 12:17 ` [PATCH 2/4] kgdb: Make gdbstub_exit a nop unless gdb is attached Jan Kiszka
2012-03-16 16:04   ` Jason Wessel [this message]
2012-03-16 12:17 ` [PATCH 3/4] kgdb: Respect that flush op is optional Jan Kiszka
2012-03-16 12:46   ` Jason Wessel
2012-03-16 12:53     ` Jan Kiszka
2012-03-16 16:16       ` Jason Wessel
2012-03-16 12:17 ` [PATCH 4/4] kgdb: x86: Detach gdb if machine shuts down or reboots Jan Kiszka
2012-03-16 15:36   ` Jason Wessel
2012-03-19 13:49     ` Jan Kiszka
2012-03-20  1:00       ` Jason Wessel
2012-03-20 11:18         ` [Kgdb-bugreport] " Sergei Shtylyov
2012-03-20 11:46           ` Jason Wessel

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=4F63647A.2040306@windriver.com \
    --to=jason.wessel@windriver.com \
    --cc=jan.kiszka@siemens.com \
    --cc=kgdb-bugreport@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.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