From: "Luis Claudio R. Goncalves" <lgoncalv@redhat.com>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Waiman Long <longman@redhat.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Clark Williams <clrkwllms@kernel.org>,
Steven Rostedt <rostedt@goodmis.org>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-rt-devel@lists.linux.dev
Subject: Re: [PATCH] arm64/entry: Don't disable preemption in debug_exception_enter() with RT kernel
Date: Fri, 29 May 2026 21:51:06 -0300 [thread overview]
Message-ID: <aho0eqjMESuHxECr@redhat.com> (raw)
In-Reply-To: <20260528153554.vllN7_T9@linutronix.de>
On Thu, May 28, 2026 at 05:35:54PM +0200, Sebastian Andrzej Siewior wrote:
> On 2026-05-28 16:51:24 [+0200], To Waiman Long wrote:
> > > The kernel backtrace is produced using the latest v7.1-rc4 kernel. There are
> > > a number of changes to the debug_exception_enter() and
> > > debug_exception_exit() functions over the years, but the preemption disable
> > > code remains since its introduction in v5.3.
> >
> > Let me look at this again.
>
> So how do you reproduce this? The calls within debug_exception_enter()/
> exit() look harmless or I miss the big thing here.
> From your backtrace, you have brk_handler() and this is gone since
> commit 31575e11ecf7e ("arm64: debug: split brk64 exception entry") which
> is v6.17-rc1. I can use gdb with breakpoint handling.
Sebastian, in the original series Ada provided a few tests, including the
two files I list below. Running that test in a v7.1-rc5 kernel with
PREEMPT_RT and DEBUG_ATOMIC_SLEEP enabled, I get this backtrace:
[10416.818417] BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:48
[10416.818426] in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 6437, name: gdb_prog1
[10416.818428] preempt_count: 1, expected: 0
[10416.818430] RCU nest depth: 1, expected: 1
[10416.818434] CPU: 11 UID: 0 PID: 6437 Comm: gdb_prog1 Not tainted 7.1.0-rc5-rt1 #2 PREEMPT_{RT,(full)}
[10416.818437] Hardware name: Lenovo HR330A 7X33CTO1WW /FALCON , BIOS hve104r-1.15 02/26/2021
[10416.818440] Call trace:
[10416.818442] show_stack+0x20/0x40 (C)
[10416.818450] dump_stack_lvl+0x88/0xb8
[10416.818454] dump_stack+0x18/0x30
[10416.818457] __might_resched+0x18c/0x1c8
[10416.818462] rt_spin_lock+0x4c/0x1b0
[10416.818467] force_sig_info_to_task+0x34/0x1f0
[10416.818471] force_sig_fault+0x68/0xb0
[10416.818473] arm64_force_sig_fault+0x44/0x70
[10416.818476] ptrace_hbptriggered+0xd0/0x150
[10416.818479] __perf_event_overflow+0xf4/0x300
[10416.818483] perf_swevent_event+0x1b8/0x1f0
[10416.818486] perf_bp_event+0xcc/0xe0
[10416.818489] do_breakpoint+0xf4/0x238
[10416.818493] el0_breakpt+0x7c/0x200
[10416.818497] el0t_64_sync_handler+0xa8/0xf0
[10416.818500] el0t_64_sync+0x1b0/0x1b8
n order to run the test, you need to create two files with the names and
content listed below and run the following commands:
cc gdb_prog1.c -o gdb_prog1 -O0 -g
gdb -x gdb_cmdlist ./gdb_prog1
That's it.
The files I mentioned are:
===== gdb_cmdlist
---------- >8 cut here 8< ----------
start
hbreak 3
watch target
commands 2
continue
end
commands 3
continue
end
continue
jump 11
continue
quit
---------- >8 cut here 8< ----------
===== gdb_prog1.c
---------- >8 cut here 8< ----------
int main() {
int add = 0xAA;
int target = 0;
target += add;
#ifdef COMPAT
__asm__("BKPT");
#else
__asm__("BRK 1");
#endif
return target;
}
---------- >8 cut here 8< ----------
Luis
prev parent reply other threads:[~2026-05-30 0:51 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-19 22:25 [PATCH] arm64/entry: Don't disable preemption in debug_exception_enter() with RT kernel Waiman Long
2026-05-20 0:23 ` Luis Claudio R. Goncalves
2026-05-20 6:19 ` Sebastian Andrzej Siewior
2026-05-20 11:23 ` Luis Claudio R. Goncalves
2026-05-20 11:23 ` Luis Claudio R. Goncalves
2026-05-20 21:01 ` Waiman Long
2026-05-28 14:51 ` Sebastian Andrzej Siewior
2026-05-28 15:35 ` Sebastian Andrzej Siewior
2026-05-30 0:51 ` Luis Claudio R. Goncalves [this message]
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=aho0eqjMESuHxECr@redhat.com \
--to=lgoncalv@redhat.com \
--cc=bigeasy@linutronix.de \
--cc=catalin.marinas@arm.com \
--cc=clrkwllms@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-devel@lists.linux.dev \
--cc=longman@redhat.com \
--cc=mark.rutland@arm.com \
--cc=rostedt@goodmis.org \
--cc=will@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.