[RFC PATCH] arm64/fpsimd: Implement strict mode for kernel mode SIMD

Mark Brown broonie at kernel.org
Fri Oct 3 10:15:51 PDT 2025


On Fri, Oct 03, 2025 at 06:21:21PM +0200, Ard Biesheuvel wrote:

> So implement a strict FP/SIMD mode that does disable access to the
> FP/SIMD registers, so that inadvertent accesses trap and cause an
> exception.

I like this idea.  However, my first thought when I stated looking
through the code was that it lines up with the idea I had to move the
way we access to the FP state (kernel_neon_*(), disabling preemption to
access userspace state in registers and flushing to memory) to use a
get/put model.  The idea was to make the patterns we use for taking
ownership of the FP state and the lifetime of that ownership more
consistent, and support validation like this.  It's a bigger change than
what you've done here but with the updates to manage the traps it'll be
touching a lot of the same places and I think it'd be really useful from
a maintainability point of view even if we don't actually end up doing
anything with the traps.

I'll have a proper look at the change next week.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20251003/6c0e4499/attachment.sig>


More information about the linux-arm-kernel mailing list