[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <lEQKYlJspHGzmd8DyuKKcpZege3zgX8WlhnHUM044EmEhtaElIqZrX-cZ5ApNx9ylcn8fS1JjzCPcmEP72WXnn4H0JrsFYge3Jba-YngKrs=@protonmail.com>
Date: Thu, 09 Oct 2025 04:35:36 +0000
From: Jari Ruusu <jariruusu@...tonmail.com>
To: Ard Biesheuvel <ardb+git@...gle.com>
Cc: "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>, Ard Biesheuvel <ardb@...nel.org>
Subject: Re: [PATCH v3 20/21] arm64/fpu: Enforce task-context only for generic kernel mode FPU
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()
--
Jari Ruusu 4096R/8132F189 12D6 4C3A DCDA 0AA4 27BD ACDF F073 3C80 8132 F189
Powered by blists - more mailing lists