All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Martin <Dave.Martin@arm.com>
To: Marc Zyngier <maz@kernel.org>
Cc: Johannes Nixdorf <mixi@shadowice.org>,
	Ard Biesheuvel <ardb@kernel.org>, Mark Brown <broonie@kernel.org>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [BUG] dm-crypt broken after 2632e2521769 ("arm64: fpsimd: Implement lazy restore for kernel mode FPSIMD")
Date: Thu, 16 May 2024 18:16:40 +0100	[thread overview]
Message-ID: <ZkY/eEyif3xACRCh@e133380.arm.com> (raw)
In-Reply-To: <cb8822182231850108fa43e0446a4c7f@kernel.org>

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@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@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2024-05-16 17:17 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-16 16:22 [BUG] dm-crypt broken after 2632e2521769 ("arm64: fpsimd: Implement lazy restore for kernel mode FPSIMD") Johannes Nixdorf
2024-05-16 16:25 ` Marc Zyngier
2024-05-16 17:16   ` Dave Martin [this message]
2024-05-16 17:17   ` Ard Biesheuvel
2024-05-17 11:37     ` Will Deacon
2024-05-17 11:40     ` Mark Brown
2024-05-17 11:57     ` Mark Rutland
2024-05-16 17:34   ` Johannes Nixdorf
2024-05-21  6:22   ` Johannes Nixdorf
2024-05-21  8:55     ` Ard Biesheuvel
2024-05-21 12:56       ` Mark Brown
2024-05-21 18:34     ` Will Deacon
2024-05-21 18:44       ` Mark Brown
2024-05-21 18:57         ` Ard Biesheuvel
2024-05-21 20:06       ` Janne Grunau
2024-05-21 20:06         ` Janne Grunau
2024-05-21 20:21         ` Mark Brown
2024-05-21 20:21           ` Mark Brown
2024-05-21 21:23           ` Janne Grunau
2024-05-21 21:23             ` Janne Grunau
2024-05-22 11:14             ` Mark Brown
2024-05-22 11:14               ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZkY/eEyif3xACRCh@e133380.arm.com \
    --to=dave.martin@arm.com \
    --cc=ardb@kernel.org \
    --cc=broonie@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=maz@kernel.org \
    --cc=mixi@shadowice.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.