[PATCH] arm64: mte: optimize asynchronous tag check fault flag check

Catalin Marinas catalin.marinas at arm.com
Wed Nov 18 12:07:50 EST 2020


On Wed, Nov 18, 2020 at 08:53:16AM -0800, Peter Collingbourne wrote:
> On Wed, Nov 18, 2020 at 3:24 AM Catalin Marinas <catalin.marinas at arm.com> wrote:
> > On Tue, Nov 17, 2020 at 07:20:51PM -0800, Peter Collingbourne wrote:
> > > diff --git a/arch/arm64/kernel/syscall.c b/arch/arm64/kernel/syscall.c
> > > index e4c0dadf0d92..f533e83fd722 100644
> > > --- a/arch/arm64/kernel/syscall.c
> > > +++ b/arch/arm64/kernel/syscall.c
> > > @@ -123,7 +123,7 @@ static void el0_svc_common(struct pt_regs *regs, int scno, int sc_nr,
> > >       local_daif_restore(DAIF_PROCCTX);
> > >       user_exit();
> > >
> > > -     if (system_supports_mte() && (flags & _TIF_MTE_ASYNC_FAULT)) {
> > > +     if (IS_ENABLED(CONFIG_ARM64_MTE) && (flags & _TIF_MTE_ASYNC_FAULT)) {
[...]
> > That said, I'm happy to take this patch, most likely it replaces some
> > static branch with tbnz on this path. Given that MTE is on in defconfig,
> > do we actually need the IS_ENABLED() check? If we remove it, it would be
> > more consistent with the similar check in do_notify_resume().
> 
> If we don't mind the additional conditional branch on
> CONFIG_ARM64_MTE=n kernels we don't need the IS_ENABLED() check. I'll
> remove it.

No need to, I'll do it when applying the patch.

-- 
Catalin



More information about the linux-arm-kernel mailing list