[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aL7y1AvuAAsOSJ4q@pathway.suse.cz>
Date: Mon, 8 Sep 2025 17:14:28 +0200
From: Petr Mladek <pmladek@...e.com>
To: Marcos Paulo de Souza <mpdesouza@...e.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Steven Rostedt <rostedt@...dmis.org>,
John Ogness <john.ogness@...utronix.de>,
Sergey Senozhatsky <senozhatsky@...omium.org>,
Jason Wessel <jason.wessel@...driver.com>,
Daniel Thompson <danielt@...nel.org>,
Douglas Anderson <dianders@...omium.org>,
linux-kernel@...r.kernel.org, kgdb-bugreport@...ts.sourceforge.net
Subject: Re: [PATCH v3 3/4] printk: nbcon: Allow KDB to acquire the NBCON
context
On Tue 2025-09-02 15:33:54, Marcos Paulo de Souza wrote:
> KDB can interrupt any console to execute the "mirrored printing" at any
> time, so add an exception to nbcon_context_try_acquire_direct to allow
> to get the context if the current CPU is the same as kdb_printf_cpu.
>
> This change will be necessary for the next patch, which fixes
> kdb_msg_write to work with NBCON consoles by calling ->write_atomic on
> such consoles. But to print it first needs to acquire the ownership of
> the console, so nbcon_context_try_acquire_direct is fixed here.
>
> --- a/kernel/printk/nbcon.c
> +++ b/kernel/printk/nbcon.c
> @@ -247,6 +248,8 @@ static int nbcon_context_try_acquire_direct(struct nbcon_context *ctxt,
> * Panic does not imply that the console is owned. However,
> * since all non-panic CPUs are stopped during panic(), it
> * is safer to have them avoid gaining console ownership.
> + * The only exception is if kdb is active, which may print
> + * from multiple CPUs during a panic.
Strictly speaking this is not the only exception. The reacquire is
another one. I would put this into a separate paragraph and write:
* One exception is when kdb is active, which may print
* from multiple CPUs during a panic.
> * If this acquire is a reacquire (and an unsafe takeover
And here start the paragrah with
* Second exception is a reacquire (and an usafe ...
> * has not previously occurred) then it is allowed to attempt
Best Regards,
Petr
Powered by blists - more mailing lists