This is a note to let you know that I've just added the patch titled Revert "arm64: fpsimd: Implement lazy restore for kernel mode FPSIMD" to the 6.6-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: revert-arm64-fpsimd-implement-lazy-restore-for-kerne.patch and it can be found in the queue-6.6 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit b6fb5d8556512e9b817e4aa1fc270749c13feea4 Author: Will Deacon <will@xxxxxxxxxx> Date: Fri May 17 12:55:55 2024 +0100 Revert "arm64: fpsimd: Implement lazy restore for kernel mode FPSIMD" [ Upstream commit b8995a18417088bb53f87c49d200ec72a9dd4ec1 ] This reverts commit 2632e25217696712681dd1f3ecc0d71624ea3b23. Johannes (and others) report data corruption with dm-crypt on Apple M1 which has been bisected to this change. Revert the offending commit while we figure out what's going on. Cc: stable@xxxxxxxxxxxxxxx Reported-by: Johannes Nixdorf <mixi@xxxxxxxxxxxxx> Link: https://lore.kernel.org/all/D1B7GPIR9K1E.5JFV37G0YTIF@xxxxxxxxxxxxx/ Signed-off-by: Will Deacon <will@xxxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/arch/arm64/include/asm/processor.h b/arch/arm64/include/asm/processor.h index 5b0a04810b236..ce6eebd6c08bd 100644 --- a/arch/arm64/include/asm/processor.h +++ b/arch/arm64/include/asm/processor.h @@ -169,7 +169,6 @@ struct thread_struct { struct debug_info debug; /* debugging */ struct user_fpsimd_state kernel_fpsimd_state; - unsigned int kernel_fpsimd_cpu; #ifdef CONFIG_ARM64_PTR_AUTH struct ptrauth_keys_user keys_user; #ifdef CONFIG_ARM64_PTR_AUTH_KERNEL diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c index 92cb6dd1cfc1a..aa695057c93dd 100644 --- a/arch/arm64/kernel/fpsimd.c +++ b/arch/arm64/kernel/fpsimd.c @@ -1552,30 +1552,12 @@ void do_fpsimd_exc(unsigned long esr, struct pt_regs *regs) static void fpsimd_load_kernel_state(struct task_struct *task) { - struct cpu_fp_state *last = this_cpu_ptr(&fpsimd_last_state); - - /* - * Elide the load if this CPU holds the most recent kernel mode - * FPSIMD context of the current task. - */ - if (last->st == &task->thread.kernel_fpsimd_state && - task->thread.kernel_fpsimd_cpu == smp_processor_id()) - return; - fpsimd_load_state(&task->thread.kernel_fpsimd_state); } static void fpsimd_save_kernel_state(struct task_struct *task) { - struct cpu_fp_state cpu_fp_state = { - .st = &task->thread.kernel_fpsimd_state, - .to_save = FP_STATE_FPSIMD, - }; - fpsimd_save_state(&task->thread.kernel_fpsimd_state); - fpsimd_bind_state_to_cpu(&cpu_fp_state); - - task->thread.kernel_fpsimd_cpu = smp_processor_id(); } void fpsimd_thread_switch(struct task_struct *next)