Re: [PATCH v18] arm64: mm: Handle Granule Protection Faults (GPFs)
From: Catalin Marinas
Date: Wed Sep 16 2026 - 13:57:05 EST
On Wed, Sep 16, 2026 at 05:39:31PM +0100, Catalin Marinas wrote:
> On Sun, Sep 13, 2026 at 08:04:58AM +0100, Suzuki K Poulose wrote:
> > +static int do_gpf(unsigned long far, unsigned long esr, struct pt_regs *regs)
> > +{
> > + if (!user_mode(regs) && !is_el1_instruction_abort(esr) &&
> > + fixup_exception(regs, esr))
> > + return 0;
> > +
> > + return 1;
> > +}
>
> We discussed briefly offline. With the latest patches around, would we
> ever end up with private memory mapped in the VMM and hence the GPF? If
> not, I would still keep this handling but add a
> WARN_ON_ONCE(user_mode(regs)).
Actually, even better:
WARN_ON_ONCE(is_ttbr0_addr(untagged_addr(far)));
to capture uaccess. The user_mode() test you have above can stay the
same.
--
Catalin