From: Mark Rutland <mark.rutland@arm.com>
To: "Luis Claudio R. Goncalves" <lgoncalv@redhat.com>
Cc: linux-arm-kernel@lists.infradead.org,
linux-rt-devel@lists.linux.dev,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Steven Rostedt <rostedt@goodmis.org>,
Ryan Roberts <ryan.roberts@arm.com>,
Mark Brown <broonie@kernel.org>, Ard Biesheuvel <ardb@kernel.org>,
Joey Gouly <joey.gouly@arm.com>,
linux-kernel@vger.kernel.org
Subject: Re: BUG: debug_exception_enter() disables preemption and may call sleeping functions on aarch64 with RT
Date: Wed, 12 Feb 2025 13:07:24 +0000 [thread overview]
Message-ID: <Z6ydDD5uMMgLi2RO@J2N7QTR9R3> (raw)
In-Reply-To: <Z6yWwRcPvVGk2EyC@J2N7QTR9R3>
On Wed, Feb 12, 2025 at 12:40:33PM +0000, Mark Rutland wrote:
> * In entry-common.c, add new el{1,0}_step() functions. Each of
> el1h_64_sync_handler(), el0t_64_sync_handler(), and
> el0t_32_sync_handler() should be updated to call those rather than
> el{1,0}_dbg() for the corresponding EC values.
>
> In el0_step() it shouldn't be necessary to disable preemption, and
> that should be able to be:
>
> | static void noinstr el0_step(struct pt_regs *regs, unsigned long esr)
> | {
> | enter_from_user_mode(regs);
> | local_daif_restore(DAIF_PROCCTX);
> | do_el0_step(regs, esr);
> | exit_to_user_mode(regs);
> | }
>
> In el1_step(), I'm not *immediately sure* whether it's necessary to
> disable preemption, nor whether we need to treat this and use
> arm64_enter_el1_dbg() and arm64_exit_el1_dbg() rather than
> entry_from_kenrel_mode() and exit_to_kernel_mode().
From another look, some care will need to be taken around
reinstall_suspended_bps(), which will also need to be reworked. That
definitely needs preemption disabled when poking the HW breakpoints, and
today those can't change under our feet between entry and handling, so
we'll need to think very hard about how that needs to work.
Note that care needs to be taken with *any* approach that doesn't
disable preemption.
Mark.
prev parent reply other threads:[~2025-02-12 13:09 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-07 14:22 BUG: debug_exception_enter() disables preemption and may call sleeping functions on aarch64 with RT Luis Claudio R. Goncalves
2025-02-10 12:49 ` Mark Rutland
2025-02-10 14:06 ` Sebastian Andrzej Siewior
2025-02-12 0:48 ` Luis Claudio R. Goncalves
2025-02-12 11:21 ` Sebastian Andrzej Siewior
2025-02-11 14:34 ` Luis Claudio R. Goncalves
2025-02-12 0:35 ` Luis Claudio R. Goncalves
2025-02-12 12:40 ` Mark Rutland
2025-02-12 13:07 ` Mark Rutland [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=Z6ydDD5uMMgLi2RO@J2N7QTR9R3 \
--to=mark.rutland@arm.com \
--cc=ardb@kernel.org \
--cc=bigeasy@linutronix.de \
--cc=broonie@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=joey.gouly@arm.com \
--cc=lgoncalv@redhat.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-devel@lists.linux.dev \
--cc=rostedt@goodmis.org \
--cc=ryan.roberts@arm.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox