[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMj1kXHMAb_AzfTK1ze3L_kA4wPxXqNOZfj_Qj5ccU6oHVo6fQ@mail.gmail.com>
Date: Thu, 9 Oct 2025 08:40:49 -0700
From: Ard Biesheuvel <ardb@...nel.org>
To: Jari Ruusu <jariruusu@...tonmail.com>
Cc: Ard Biesheuvel <ardb+git@...gle.com>,
"linux-arm-kernel@...ts.infradead.org" <linux-arm-kernel@...ts.infradead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-crypto@...r.kernel.org" <linux-crypto@...r.kernel.org>,
"herbert@...dor.apana.org.au" <herbert@...dor.apana.org.au>, "ebiggers@...nel.org" <ebiggers@...nel.org>
Subject: Re: [PATCH v3 20/21] arm64/fpu: Enforce task-context only for generic
kernel mode FPU
On Wed, 8 Oct 2025 at 21:35, Jari Ruusu <jariruusu@...tonmail.com> wrote:
>
> Ard Biesheuvel wrote:
> > So enforce that kernel_fpu_begin() can only be called from task context,
> > and [redundantly] disable preemption. This removes the need for users of
> > this API to provide a kernel mode FP/SIMD state after a future patch
> > that makes that compulsory for preemptible task context.
> [snip]
> > --- a/arch/arm64/include/asm/fpu.h
> > +++ b/arch/arm64/include/asm/fpu.h
> [snip]
> > +static inline void kernel_fpu_begin(void)
> > +{
> > + BUG_ON(!in_task());
> > + preempt_disable();
> ^^^^^^^------this looks okay
> > + kernel_neon_begin();
> > +}
> > +
> > +static inline void kernel_fpu_end(void)
> > +{
> > + kernel_neon_end();
> > + preempt_disable();
> ^^^^^^^------this looks wrong
> > +}
>
> Maybe that second one should be preempt_enable()
>
Indeed, thanks for spotting that.
Powered by blists - more mailing lists