[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Z6vvyKZ5eoAS435b@uudg.org>
Date: Tue, 11 Feb 2025 21:48:08 -0300
From: "Luis Claudio R. Goncalves" <lgoncalv@...hat.com>
To: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Cc: Mark Rutland <mark.rutland@....com>,
linux-arm-kernel@...ts.infradead.org,
linux-rt-devel@...ts.linux.dev,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>, Steven Rostedt <rostedt@...dmis.org>,
Ryan Roberts <ryan.roberts@....com>,
Mark Brown <broonie@...nel.org>, Ard Biesheuvel <ardb@...nel.org>,
Joey Gouly <joey.gouly@....com>, linux-kernel@...r.kernel.org
Subject: Re: BUG: debug_exception_enter() disables preemption and may call
sleeping functions on aarch64 with RT
On Mon, Feb 10, 2025 at 03:06:57PM +0100, Sebastian Andrzej Siewior wrote:
> On 2025-02-10 12:49:45 [+0000], Mark Rutland wrote:
> > Hi,
> Hi,
>
> > I don't have an immediate suggestion; I'll need to go think about this
> > for a bit. Unfortunatealy, there are several nested cans of worms here.
> > :/
> >
> > In theory, we can go split out the EL0 "debug exceptions" into separate
> > handlers, and wouldn't generally need to disable preemption for things
> > like BRK or single-step.
> >
> > However, it's not immediately clear to me how we could handle
> > watchpoints or breakpoints, since for those preemption/interruption
> > could change the HW state under our feet, and we rely on single-step to
> > skip past the watchpoint/breakpoint after it is handled.
>
> Couldn't you delay sending signals until after the preempt-disable
> section?
Looking at do_debug_exception,
void do_debug_exception(unsigned long addr_if_watchpoint, unsigned long esr,
struct pt_regs *regs)
{
const struct fault_info *inf = esr_to_debug_fault_info(esr);
unsigned long pc = instruction_pointer(regs);
debug_exception_enter(regs);
if (user_mode(regs) && !is_ttbr0_addr(pc))
arm64_apply_bp_hardening();
if (inf->fn(addr_if_watchpoint, esr, regs)) {
arm64_notify_die(inf->name, regs, inf->sig, inf->code, pc, esr);
}
debug_exception_exit(regs);
}
NOKPROBE_SYMBOL(do_debug_exception);
Do you mean executing the
arm64_notify_die(inf->name, regs, inf->sig, inf->code, pc, esr);
after re-enabling the preemption or do you mean something more
sophisticated?
Luis
> > That, and last I looked reworking this we'd need to do a larger rework
> > to split out those "debug exceptions" because of that way that currently
> > bounces through the fault handling ligic in arch/arm64/mm/.
> >
> > Mark.
>
> Sebastian
>
---end quoted text---
Powered by blists - more mailing lists