From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 29DC9383C7C for ; Mon, 23 Mar 2026 09:53:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774259597; cv=none; b=hZbtSJ2eb0bS9cM3OSUScIwHDUCqUzRTtCkVJ2nzyoMM0y0m6BFf07EAOvCOnVawqsMA3aGtTYwxgzlb2PUxQcB8BblFP8jr1dlECZ8YWXhLr8rRaoeLpCasqB37vqJ/IFLlAJVv+DdaB6qBQJ5+zvwM81Qa+qZ1T4h+8IWIVOE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774259597; c=relaxed/simple; bh=xnAmMHFbJyQ6HP7YFPNLPy4fVO1sEh3iUAh0iuqM71Y=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=uZGKmTs8Aug9h2jazxI4HPDrh67dXLyecpJvNngh2Y90z4qCi4S07RQps7fycFfmHWIsLUV9KJ32TCPzuGX6FFXb5JuoNfAtmc/iAtN3jROTTH4Cj5K+6OcmQ0DcRzZqdN0x6tZrvvoOz6TIC4PKYpL9m3/K1x+t4g4WSmugAAg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riscstar.com; spf=pass smtp.mailfrom=riscstar.com; dkim=pass (2048-bit key) header.d=riscstar-com.20230601.gappssmtp.com header.i=@riscstar-com.20230601.gappssmtp.com header.b=kZwhbceK; arc=none smtp.client-ip=209.85.128.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riscstar.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=riscstar.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=riscstar-com.20230601.gappssmtp.com header.i=@riscstar-com.20230601.gappssmtp.com header.b="kZwhbceK" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-486fe2024a9so18979655e9.0 for ; Mon, 23 Mar 2026 02:53:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=riscstar-com.20230601.gappssmtp.com; s=20230601; t=1774259592; x=1774864392; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=SoHFRyPBTyQj3OaKWgzAXtGMf9/ytQiEU1/q/gX89XQ=; b=kZwhbceKyLD9h7g6PUfaxEnGSb4PHY70X9tAr191t8R/+BidJAbjGXD659ubnYF8MZ Kx8zuJmNewjPs/3FYIGmj9kAAHjtiltLY3OuXBPYeFlJfJHx3wJXsfxDXqoyVyJVt/Yr wgrAtLoLUs1EgVvZ3RXIFHJd5dRpf5f5txhRThOmYAmHTr1tYvEkjNleqeM9x9EJRvEL WdDcZIFQ1PQu2J1E62kq2+cpdx+OCI4yPj8ui7JnkbJmthXt6aKPm7A0bmS/zWK7kClu LP0GXHQadKiOAUwlEDcGC1uPxLY13NmUzf/AsmoxTiyYFhVS7UzZV3QZL9/ANlA82yYG hAUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774259592; x=1774864392; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SoHFRyPBTyQj3OaKWgzAXtGMf9/ytQiEU1/q/gX89XQ=; b=DNBc8svsukrGCCF9wTse2gpoDSjbwt1Kl0wM5d8QyzDaHueG5BWD1HT3hul5jz+8JI UR74wwnglJl1Qio28axMxK8Uw7adu1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Cx+uFuPm3L8VZRs/0QYotdp8wnzf kRc4KnwI X-Received: by 2002:a05:600c:c16e:b0:485:9a50:3370 with SMTP id 5b1f17b1804b1-486fedb9497mr146904975e9.8.1774259591795; Mon, 23 Mar 2026 02:53:11 -0700 (PDT) Received: from aspen.lan (aztw-34-b2-v4wan-166919-cust780.vm26.cable.virginm.net. [82.37.195.13]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-486fe82ae69sm251386945e9.9.2026.03.23.02.53.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Mar 2026 02:53:11 -0700 (PDT) Date: Mon, 23 Mar 2026 09:53:09 +0000 From: Daniel Thompson To: Kexin Sun 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() Message-ID: References: <20260321105808.6939-1-kexinsun@smail.nju.edu.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 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.