* arm64: pseudo NMI bootconfig question
@ 2025-11-12 14:05 Breno Leitao
2025-11-12 14:21 ` Marc Zyngier
2025-11-13 4:34 ` Masami Hiramatsu
0 siblings, 2 replies; 6+ messages in thread
From: Breno Leitao @ 2025-11-12 14:05 UTC (permalink / raw)
To: catalin.marinas, will, mark.rutland
Cc: paulmck, mhiramat, linux-arm-kernel, linux-kernel, kernel-team
Hello,
In most major Linux distributions, it’s common to have a separate debug kernel
build. This variant is compiled with additional debug configuration options to
provide deeper observability and easier debugging, typically at the expense of
some performance.
This approach is also used in several companies, including mine. The debug
flavor is usually a drop-in replacement deployed when investigating
issues, allowing quicker identification before more detailed manual
debugging.
I’m currently debugging some hung tasks using the debug kernel flavor and
noticed that backtraces weren’t printed correctly because PSEUDO NMI isn’t
enabled.
AFAIK, to enable PSEUDO NMI on ARM, the following are required:
cmdline: irqchip.gicv3_pseudo_nmi=1
config: CONFIG_ARM64_PSEUDO_NMI=y
I wanted to have pseudo NMI enabled by default in the debug kernel
(without relying on kernel command-line parameters), but this isn’t
possible today. The reason is that `irqchip.gicv3_pseudo_nmi` is an early
parameter, which can’t be set through bootconfig, so, independent of my
.config, I need to hack cmdline arguments to have the debuggability
I need.
Question:
Would it make sense to provide an option to enable pseudo NMI in certain
kernel configuration without requiring an extra command-line parameter?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: arm64: pseudo NMI bootconfig question
2025-11-12 14:05 arm64: pseudo NMI bootconfig question Breno Leitao
@ 2025-11-12 14:21 ` Marc Zyngier
2025-11-13 9:36 ` Breno Leitao
2025-11-13 4:34 ` Masami Hiramatsu
1 sibling, 1 reply; 6+ messages in thread
From: Marc Zyngier @ 2025-11-12 14:21 UTC (permalink / raw)
To: Breno Leitao
Cc: catalin.marinas, will, mark.rutland, paulmck, mhiramat,
linux-arm-kernel, linux-kernel, kernel-team
On Wed, 12 Nov 2025 14:05:43 +0000,
Breno Leitao <leitao@debian.org> wrote:
>
> Hello,
>
> In most major Linux distributions, it’s common to have a separate debug kernel
> build. This variant is compiled with additional debug configuration options to
> provide deeper observability and easier debugging, typically at the expense of
> some performance.
>
> This approach is also used in several companies, including mine. The debug
> flavor is usually a drop-in replacement deployed when investigating
> issues, allowing quicker identification before more detailed manual
> debugging.
>
> I’m currently debugging some hung tasks using the debug kernel flavor and
> noticed that backtraces weren’t printed correctly because PSEUDO NMI isn’t
> enabled.
>
> AFAIK, to enable PSEUDO NMI on ARM, the following are required:
>
> cmdline: irqchip.gicv3_pseudo_nmi=1
> config: CONFIG_ARM64_PSEUDO_NMI=y
>
> I wanted to have pseudo NMI enabled by default in the debug kernel
> (without relying on kernel command-line parameters), but this isn’t
> possible today. The reason is that `irqchip.gicv3_pseudo_nmi` is an early
> parameter, which can’t be set through bootconfig, so, independent of my
> .config, I need to hack cmdline arguments to have the debuggability
> I need.
>
> Question:
>
> Would it make sense to provide an option to enable pseudo NMI in certain
> kernel configuration without requiring an extra command-line parameter?
[I wasn't asked, but I'll give my answer anyway]
The short answer is no. The long answer is that there is so much
broken HW out there that dies a painful death when enabling pseudo-NMI
that is isn't practical to do so. It also brings a measurable
overhead to some of the most frequent operations (interrupt masking).
Until someone weeds out the broken machines (in some cases, by prying
them from my cold dead hands), the requirement for the option is
likely to stick.
Thanks,
M.
--
Without deviation from the norm, progress is not possible.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: arm64: pseudo NMI bootconfig question
2025-11-12 14:05 arm64: pseudo NMI bootconfig question Breno Leitao
2025-11-12 14:21 ` Marc Zyngier
@ 2025-11-13 4:34 ` Masami Hiramatsu
2025-11-13 10:37 ` Breno Leitao
1 sibling, 1 reply; 6+ messages in thread
From: Masami Hiramatsu @ 2025-11-13 4:34 UTC (permalink / raw)
To: Breno Leitao
Cc: catalin.marinas, will, mark.rutland, paulmck, mhiramat,
linux-arm-kernel, linux-kernel, kernel-team
On Wed, 12 Nov 2025 06:05:43 -0800
Breno Leitao <leitao@debian.org> wrote:
> Hello,
>
> In most major Linux distributions, it’s common to have a separate debug kernel
> build. This variant is compiled with additional debug configuration options to
> provide deeper observability and easier debugging, typically at the expense of
> some performance.
>
> This approach is also used in several companies, including mine. The debug
> flavor is usually a drop-in replacement deployed when investigating
> issues, allowing quicker identification before more detailed manual
> debugging.
>
> I’m currently debugging some hung tasks using the debug kernel flavor and
> noticed that backtraces weren’t printed correctly because PSEUDO NMI isn’t
> enabled.
>
> AFAIK, to enable PSEUDO NMI on ARM, the following are required:
>
> cmdline: irqchip.gicv3_pseudo_nmi=1
> config: CONFIG_ARM64_PSEUDO_NMI=y
>
> I wanted to have pseudo NMI enabled by default in the debug kernel
> (without relying on kernel command-line parameters), but this isn’t
> possible today. The reason is that `irqchip.gicv3_pseudo_nmi` is an early
> parameter, which can’t be set through bootconfig, so, independent of my
> .config, I need to hack cmdline arguments to have the debuggability
> I need.
Yeah, that parameter is for early architecture initialization,
which is done before parsing bootconfig.
Can you try building kernel with:
(arm)
CONFIG_CMDLINE="irqchip.gicv3_pseudo_nmi=1"
CONFIG_CMDLINE_EXTEND=y
(arm64)
cmdline=$(cat /proc/cmdline)
CONFIG_CMDLINE="irqchip.gicv3_pseudo_nmi=1 ${cmdline}"
CMDLINE_FORCE=y
BTW I wonder why you can not configure your bootloader to pass it.
Thank you,
>
> Question:
>
> Would it make sense to provide an option to enable pseudo NMI in certain
> kernel configuration without requiring an extra command-line parameter?
--
Masami Hiramatsu (Google) <mhiramat@kernel.org>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: arm64: pseudo NMI bootconfig question
2025-11-12 14:21 ` Marc Zyngier
@ 2025-11-13 9:36 ` Breno Leitao
2025-11-13 11:03 ` Will Deacon
0 siblings, 1 reply; 6+ messages in thread
From: Breno Leitao @ 2025-11-13 9:36 UTC (permalink / raw)
To: Marc Zyngier
Cc: catalin.marinas, will, mark.rutland, paulmck, mhiramat,
linux-arm-kernel, linux-kernel, kernel-team
Helo Marc,
On Wed, Nov 12, 2025 at 02:21:22PM +0000, Marc Zyngier wrote:
> On Wed, 12 Nov 2025 14:05:43 +0000,
> Breno Leitao <leitao@debian.org> wrote:
...
> > Question:
> >
> > Would it make sense to provide an option to enable pseudo NMI in certain
> > kernel configuration without requiring an extra command-line parameter?
>
> [I wasn't asked, but I'll give my answer anyway]
>
> The short answer is no. The long answer is that there is so much
> broken HW out there that dies a painful death when enabling pseudo-NMI
> that is isn't practical to do so.
That’s helpful to know. I hadn’t realized there were potential issues
with hardware implementation, which explains why it isn’t
straightforward to enable. Thanks for the additional context.
> It also brings a measurable overhead to some of the most frequent
> operations (interrupt masking).
For debug kernel variants, performance overhead isn’t a concern since
they’re only used in debugging scenarios—not in production. So, it’s
fine if things run slower when the debug configuration is active, at
least from my perspective.
Thanks for jumping in!
--breno
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: arm64: pseudo NMI bootconfig question
2025-11-13 4:34 ` Masami Hiramatsu
@ 2025-11-13 10:37 ` Breno Leitao
0 siblings, 0 replies; 6+ messages in thread
From: Breno Leitao @ 2025-11-13 10:37 UTC (permalink / raw)
To: Masami Hiramatsu, oss
Cc: catalin.marinas, will, mark.rutland, paulmck, linux-arm-kernel,
linux-kernel, kernel-team
Hello Masami,
On Thu, Nov 13, 2025 at 01:34:03PM +0900, Masami Hiramatsu wrote:
> > I wanted to have pseudo NMI enabled by default in the debug kernel
> > (without relying on kernel command-line parameters), but this isn’t
> > possible today. The reason is that `irqchip.gicv3_pseudo_nmi` is an early
> > parameter, which can’t be set through bootconfig, so, independent of my
> > .config, I need to hack cmdline arguments to have the debuggability
> > I need.
>
> Yeah, that parameter is for early architecture initialization,
> which is done before parsing bootconfig.
>
> Can you try building kernel with:
>
> (arm64)
> cmdline=$(cat /proc/cmdline)
> CONFIG_CMDLINE="irqchip.gicv3_pseudo_nmi=1 ${cmdline}"
> CMDLINE_FORCE=y
This option isn’t practical for my use case since I maintain a generic
debug kernel that needs to support multiple workloads and services, each
with their own kernel command line. I’d need something similar to the
old CMDLINE_EXTEND feature (which was removed some time ago), or perhaps
a mechanism like CMDLINE_PREPEND or CMDLINE_APPEND, which were never
introduced.
Another possible solution would be to load bootconfig earlier in the
boot process so that early parameters can be defined within bootconfig.
Petr suggested this approach some time back, but it doesn’t appear to
have made it upstream.
https://lore.kernel.org/all/20231123194106.08f5832f558fe806b1fd8098@kernel.org/
I’m not fully up to speed on the details of this change, so I want to
ask directly: Would Petr’s approach—allowing early parameters to be set
via bootconfig make sense from a bootconfig design perspective?
> BTW I wonder why you can not configure your bootloader to pass it.
The main issue is that changing cmdline parameters increases the
confusion for users, and updating the kernel command line isn’t simple
in a heterogeneous environment.
My objective is to provide a drop-in kernel replacement, so the user
only needs to swap the kernel binary, gaining additional debugging
capabilities without modifying anything else.
Additionally, it’s common for the same kernel version to be used across
different bootloaders, which makes distributing and installing debug
kernels even more complicated if additional changes (such as appending
configurations to the cmdline) are required.
Thanks for your help!
--breno
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: arm64: pseudo NMI bootconfig question
2025-11-13 9:36 ` Breno Leitao
@ 2025-11-13 11:03 ` Will Deacon
0 siblings, 0 replies; 6+ messages in thread
From: Will Deacon @ 2025-11-13 11:03 UTC (permalink / raw)
To: Breno Leitao
Cc: Marc Zyngier, catalin.marinas, mark.rutland, paulmck, mhiramat,
linux-arm-kernel, linux-kernel, kernel-team
On Thu, Nov 13, 2025 at 01:36:48AM -0800, Breno Leitao wrote:
> Helo Marc,
>
> On Wed, Nov 12, 2025 at 02:21:22PM +0000, Marc Zyngier wrote:
> > On Wed, 12 Nov 2025 14:05:43 +0000,
> > Breno Leitao <leitao@debian.org> wrote:
> ...
> > > Question:
> > >
> > > Would it make sense to provide an option to enable pseudo NMI in certain
> > > kernel configuration without requiring an extra command-line parameter?
> >
> > [I wasn't asked, but I'll give my answer anyway]
> >
> > The short answer is no. The long answer is that there is so much
> > broken HW out there that dies a painful death when enabling pseudo-NMI
> > that is isn't practical to do so.
>
> That’s helpful to know. I hadn’t realized there were potential issues
> with hardware implementation, which explains why it isn’t
> straightforward to enable. Thanks for the additional context.
FWIW, I've also run into platforms where the _hardware_ is fine but the
TZ integration can't handle Linux using priority masking properly.
Will
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-11-13 11:03 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-12 14:05 arm64: pseudo NMI bootconfig question Breno Leitao
2025-11-12 14:21 ` Marc Zyngier
2025-11-13 9:36 ` Breno Leitao
2025-11-13 11:03 ` Will Deacon
2025-11-13 4:34 ` Masami Hiramatsu
2025-11-13 10:37 ` Breno Leitao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).