mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Thompson <daniel@riscstar.com>
To: Kexin Sun <kexinsun@smail.nju.edu.cn>
Cc: tglx@kernel.org, mingo@redhat.com, bp@alien8.de,
	dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com,
	jason.wessel@windriver.com, danielt@kernel.org,
	dianders@chromium.org, sohil.mehta@intel.com, seanjc@google.com,
	xin@zytor.com, linux-kernel@vger.kernel.org,
	kgdb-bugreport@lists.sourceforge.net, julia.lawall@inria.fr,
	xutong.ma@inria.fr, yunbolyu@smu.edu.sg, ratnadiraw@smu.edu.sg
Subject: Re: [PATCH] kgdb: update outdated references to kgdb_wait()
Date: Mon, 23 Mar 2026 09:53:09 +0000	[thread overview]
Message-ID: <acENhVCOqXd_NqY8@aspen.lan> (raw)
In-Reply-To: <20260321105808.6939-1-kexinsun@smail.nju.edu.cn>

On Sat, Mar 21, 2026 at 06:58:08PM +0800, Kexin Sun wrote:
> The function kgdb_wait() was replaced by kgdb_cpu_enter()
> in commit 62fae312197a ("kgdb: eliminate kgdb_wait(), all cpus
> enter the same way").  Update the four stale references:
>  - include/linux/kgdb.h: kgdb_roundup_cpus() kdoc
>  - arch/x86/kernel/kgdb.c: kgdb_roundup_cpus() kdoc; also fix
>    pre-existing grammar error ("get them be" -> "get them into")
>  - kernel/debug/debug_core.c: inline comment
>  - kernel/debug/gdbstub.c: inline comment
>
> Assisted-by: unnamed:deepseek-v3.2 coccinelle
> Signed-off-by: Kexin Sun <kexinsun@smail.nju.edu.cn>

Thanks for the patch. However I don't think the changes in commit
62fae312197a have been incorrectly interpreted in your update. See
below.


> ---
>  arch/x86/kernel/kgdb.c    | 5 +++--
>  include/linux/kgdb.h      | 3 ++-
>  kernel/debug/debug_core.c | 2 +-
>  kernel/debug/gdbstub.c    | 2 +-
>  4 files changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/arch/x86/kernel/kgdb.c b/arch/x86/kernel/kgdb.c
> index 8b1a9733d13e..f50a39818223 100644
> --- a/arch/x86/kernel/kgdb.c
> +++ b/arch/x86/kernel/kgdb.c
> @@ -407,8 +407,9 @@ static void kgdb_disable_hw_debug(struct pt_regs *regs)
>   *	kgdb_roundup_cpus - Get other CPUs into a holding pattern
>   *
>   *	On SMP systems, we need to get the attention of the other CPUs
> - *	and get them be in a known state.  This should do what is needed
> - *	to get the other CPUs to call kgdb_wait(). Note that on some arches,
> + *	and get them into a known state.  This should do what is needed
> + *	to get the other CPUs to call kgdb_cpu_enter(). Note that on

kgdb_cpu_enter() is a static function. There is no way this is the right
function to get the other CPUs to call.

Are you sure you don't mean kgdb_handle_exception() here?


> + *	some arches,

Please reflow the text for the whole comment.


>   *	the NMI approach is not used for rounding up all the CPUs. For example,
>   *	in case of MIPS, smp_call_function() is used to roundup CPUs.
>   *
> diff --git a/include/linux/kgdb.h b/include/linux/kgdb.h
> index 22b3f3839f30..bbe9b54a57c9 100644
> --- a/include/linux/kgdb.h
> +++ b/include/linux/kgdb.h
> @@ -202,7 +202,8 @@ extern void kgdb_call_nmi_hook(void *ignored);
>   *
>   *	On SMP systems, we need to get the attention of the other CPUs
>   *	and get them into a known state.  This should do what is needed
> - *	to get the other CPUs to call kgdb_wait(). Note that on some arches,
> + *	to get the other CPUs to call kgdb_cpu_enter(). Note that on
> + *	some arches,

+2


>   *	the NMI approach is not used for rounding up all the CPUs.  Normally
>   *	those architectures can just not implement this and get the default.
>   *
> diff --git a/kernel/debug/debug_core.c b/kernel/debug/debug_core.c
> index 0b9495187fba..1a2f0297a80c 100644
> --- a/kernel/debug/debug_core.c
> +++ b/kernel/debug/debug_core.c
> @@ -704,7 +704,7 @@ static int kgdb_cpu_enter(struct kgdb_state *ks, struct pt_regs *regs,
>  	if (ks->send_ready)
>  		atomic_set(ks->send_ready, 1);
>
> -	/* Signal the other CPUs to enter kgdb_wait() */
> +	/* Signal the other CPUs to enter kgdb_cpu_enter() */
>  	else if ((!kgdb_single_step) && kgdb_do_roundup)
>  		kgdb_roundup_cpus();

This isn't wrong but still suggests that code outside of kgdb can call
into kgdb (and it can't). I think just "to enter the debug trap handler"
would be better here.


>  #endif
> diff --git a/kernel/debug/gdbstub.c b/kernel/debug/gdbstub.c
> index f586afd76c80..aafd8da5d7fc 100644
> --- a/kernel/debug/gdbstub.c
> +++ b/kernel/debug/gdbstub.c
> @@ -517,7 +517,7 @@ static void gdb_get_regs_helper(struct kgdb_state *ks)
>  	/*
>  	 * All threads that don't have debuggerinfo should be
>  	 * in schedule() sleeping, since all other CPUs
> -	 * are in kgdb_wait, and thus have debuggerinfo.
> +	 * are in kgdb_cpu_enter, and thus have debuggerinfo.

This usage is correct... but could you add the () after the function name
to match the reset of the comment.


Daniel.

  reply	other threads:[~2026-03-23  9:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-21 10:58 Kexin Sun
2026-03-23  9:53 ` Daniel Thompson [this message]
2026-03-24  3:23   ` [PATCH v2] " Kexin Sun

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=acENhVCOqXd_NqY8@aspen.lan \
    --to=daniel@riscstar.com \
    --cc=bp@alien8.de \
    --cc=danielt@kernel.org \
    --cc=dave.hansen@linux.intel.com \
    --cc=dianders@chromium.org \
    --cc=hpa@zytor.com \
    --cc=jason.wessel@windriver.com \
    --cc=julia.lawall@inria.fr \
    --cc=kexinsun@smail.nju.edu.cn \
    --cc=kgdb-bugreport@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=ratnadiraw@smu.edu.sg \
    --cc=seanjc@google.com \
    --cc=sohil.mehta@intel.com \
    --cc=tglx@kernel.org \
    --cc=x86@kernel.org \
    --cc=xin@zytor.com \
    --cc=xutong.ma@inria.fr \
    --cc=yunbolyu@smu.edu.sg \
    /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

all inboxes | Powered by JetHome®