[BUG] dm-crypt broken after 2632e2521769 ("arm64: fpsimd: Implement lazy restore for kernel mode FPSIMD")

Dave Martin Dave.Martin at arm.com
Thu May 16 10:16:40 PDT 2024


On Thu, May 16, 2024 at 05:25:32PM +0100, Marc Zyngier wrote:
> + Ard, Broonie
> 
> On 2024-05-16 17:22, Johannes Nixdorf wrote:
> > I noticed frequent FS corruption on my M1 MacBook running Linux after
> > the Asahi Linux Kernel was updated to 6.9.x (from 6.6.x).
> > 
> > A git bisect pointed me to 2632e2521769 ("arm64: fpsimd: Implement lazy
> > restore for kernel mode FPSIMD").

It's a while since I worked on this code, and things have moved in the
meantime, but there seems to be an asymmetry between where
fpsimd_bind_state_to_cpu() is called here and where the analogous
fpsimd_bind_task_to_cpu() is called for the regular task state.

Originally, these hooks did the bookkeeping at load-time to record where
the state is loaded.  To record this info for the user task state at
sched-in time but to defer it until sched-out time for the kernel state
looks weird to me.  I'd be concerned that the state is getting messed
up on the back of an interrupt or similar in the meantime.

I haven't fully understood what the current version of this code is
doing, but that might be a place to start looking...

Cheers
---Dave

> > 
> > This was reproduced with fio's examples/basic-verify.fio (1GB of writing
> > was not reliably, 10GB triggered it reliably) on vanilla kernels and
> > happens on any storage backend behind dm-crypt.
> > 
> > I was advised to report it here on IRC.
> > 
> > This was independently described in [1].
> > 
> > Regards,
> > Johannes Nixdorf
> > 
> > [1]: https://github.com/tpwrules/nixos-apple-silicon/issues/200
> > 
> > _______________________________________________
> > linux-arm-kernel mailing list
> > linux-arm-kernel at lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 
> -- 
> Jazz is not dead. It just smells funny...
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel



More information about the linux-arm-kernel mailing list