Skip to contentSkip to conversation

kgdb_breakpoint() usage leads to kernel panic

DISCUSSION Takashi Iwai 1 participant 2 messages Oct 22, 2020 – Oct 23, 2020

lore
Share & tools
lore
#0 lore raw

Hi,

we recently stumbled on a kernel crash in amdgpu [*], and the kernel messages indicated that it's from kgdb_breakpoint() call in ASSERT_CRITICAL() macro.

Since CONFIG_KGDB=y is set on the openSUSE distro kernels, the breakpoint is enabled even though CONFIG_DEBUG_KERNEL_DC=n, and this leads to a kernel panic because of INT3. Unfortunately there is no dynamical control to disable it.

I guess the kernel panic isn't intended for end-users, right? If so, shouldn't we cover kgdb_breakpoint() in ASSERT_CRITICAL() also with CONFIG_DEBUG_KERNEL_DC?

Also, taking a quick glance at the code, I noticed a few things:

- What's the difference of ASSERT() and ASSERT_CRITICAL()? Why ASSERT() uses WARN_ON() and WARN_ON_ONCE() conditionally?

- I couldn't see CONFIG_HAVE_KGDB anywhere else. Is this superfluous?

- CONFIG_DEBUG_KERNEL_DC can have "depends on KGDB" in Kconfig. Then the ifdefs can be much simplified.

[*] https://bugzilla.suse.com/show_bug.cgi?id=1177973

thanks,

Takashi
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#1 lore raw
Quoted 21 lines · Takashi Iwai

Hi,

we recently stumbled on a kernel crash in amdgpu [*], and the kernel messages indicated that it's from kgdb_breakpoint() call in ASSERT_CRITICAL() macro.

Since CONFIG_KGDB=y is set on the openSUSE distro kernels, the breakpoint is enabled even though CONFIG_DEBUG_KERNEL_DC=n, and this leads to a kernel panic because of INT3. Unfortunately there is no dynamical control to disable it.

I guess the kernel panic isn't intended for end-users, right? If so, shouldn't we cover kgdb_breakpoint() in ASSERT_CRITICAL() also with CONFIG_DEBUG_KERNEL_DC?

Also, taking a quick glance at the code, I noticed a few things:

- What's the difference of ASSERT() and ASSERT_CRITICAL()? Why ASSERT() uses WARN_ON() and WARN_ON_ONCE() conditionally?

Quoted 7 lines

- I couldn't see CONFIG_HAVE_KGDB anywhere else. Is this superfluous?

- CONFIG_DEBUG_KERNEL_DC can have "depends on KGDB" in Kconfig. Then the ifdefs can be much simplified.

[*] https://bugzilla.suse.com/show_bug.cgi?id=1177973

As there's no reply, I'm going to submit the fix patches.

Takashi
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx