From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: linux-arm-kernel@lists.infradead.org,
Clark Williams <clrkwllms@kernel.org>,
linux-rt-devel@lists.linux.dev,
Steven Rostedt <rostedt@goodmis.org>
Subject: Re: [PATCH 2/6] ARM: move vmalloc() lazy-page table population
Date: Mon, 2 Mar 2026 11:19:52 +0000 [thread overview]
Message-ID: <aaVyWFNu8scqZeEY@shell.armlinux.org.uk> (raw)
In-Reply-To: <20260302110055.hFMkUcnt@linutronix.de>
On Mon, Mar 02, 2026 at 12:00:55PM +0100, Sebastian Andrzej Siewior wrote:
> On 2026-03-02 10:57:03 [+0000], Russell King (Oracle) wrote:
> > > > --- a/arch/arm/mm/fault.c
> > > > +++ b/arch/arm/mm/fault.c
> > > > @@ -261,6 +261,70 @@ static inline bool ttbr0_usermode_access_allowed(struct pt_regs *regs)
> > > > }
> > > > #endif
> > > >
> > > > +/*
> > > > + * Handle a vmalloc fault, copying the non-leaf page table entries from
> > > > + * init_mm.pgd. Any kernel context can trigger this, so we must not sleep
> > > > + * or enable interrupts. Having two CPUs execute this for the same page is
> > >
> > > "unconditionally enable interrupts."? It wouldn't be wrong to enable
> > > them if the calling context had them enabled, right?
> >
> > I don't know where you got "unconditionally enable interrupts" from the
> > comment - it says the exact opposite.
>
> My point. You could enable the interrupts if the parent context had them
> enabled. It is not that you must keep them disabled because a second
> fault/ interrupt would overwrite your CPU state.
We've gone from the code always having interrupts disabled, to your
review response that always wants them to be enabled (which is what
*un*conditionally enable interrupts means) to now conditionally enable
interrupts.
We are reading the CPU's page table pointer (the one programmed in
hardware) here, and we don't want that changing while we're fixing
the fault. So, interrupts need to stay disabled. x86 doesn't enable
interrupts in this path either, and we shouldn't be having differing
behaviour without good reason.
There are two places where x86 enables interrupts in its fault
handling. One of them is while handling a user address fault in
do_user_addr_fault(). The other is __bad_area_nosemaphore() where we
also know that we've come from user mode. All other fault handling
happens with interrupts disabled.
In any case, we've always had interrupts disabled in this path. Any
change to that would need to be a separate patch.
So, the comment in the patch is 100% correct.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
next prev parent reply other threads:[~2026-03-02 11:20 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-27 15:18 [PATCH 0/6] ARM: cleanup fault handling Russell King (Oracle)
2026-02-27 15:19 ` [PATCH 1/6] ARM: ensure interrupts are enabled in __do_user_fault() Russell King (Oracle)
2026-03-02 10:33 ` Sebastian Andrzej Siewior
2026-02-27 15:19 ` [PATCH 2/6] ARM: move vmalloc() lazy-page table population Russell King (Oracle)
2026-03-02 10:43 ` Sebastian Andrzej Siewior
2026-03-02 10:57 ` Russell King (Oracle)
2026-03-02 11:00 ` Sebastian Andrzej Siewior
2026-03-02 11:19 ` Russell King (Oracle) [this message]
2026-03-02 11:51 ` Sebastian Andrzej Siewior
2026-02-27 15:19 ` [PATCH 3/6] ARM: move is_permission_fault() and is_translation_fault() to fault.h Russell King (Oracle)
2026-03-02 10:45 ` Sebastian Andrzej Siewior
2026-02-27 15:19 ` [PATCH 4/6] ARM: use BIT() and GENMASK() for fault status register fields Russell King (Oracle)
2026-03-02 10:50 ` Sebastian Andrzej Siewior
2026-02-27 15:19 ` [PATCH 5/6] ARM: move FSR fault status definitions before fsr_fs() Russell King (Oracle)
2026-03-02 10:51 ` Sebastian Andrzej Siewior
2026-02-27 15:19 ` [PATCH 6/6] ARM: provide individual is_translation_fault() and is_permission_fault() Russell King (Oracle)
2026-03-02 10:54 ` Sebastian Andrzej Siewior
2026-03-02 10:57 ` [PATCH 0/6] ARM: cleanup fault handling Sebastian Andrzej Siewior
2026-03-19 15:37 ` Sebastian Andrzej Siewior
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=aaVyWFNu8scqZeEY@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=bigeasy@linutronix.de \
--cc=clrkwllms@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-rt-devel@lists.linux.dev \
--cc=rostedt@goodmis.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