Skip to content

Commit b8995a1

Browse files
committed
Revert "arm64: fpsimd: Implement lazy restore for kernel mode FPSIMD"
This reverts commit 2632e25. 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: [email protected] Reported-by: Johannes Nixdorf <[email protected]> Link: https://lore.kernel.org/all/[email protected]/ Signed-off-by: Will Deacon <[email protected]>
1 parent f0cc697 commit b8995a1

File tree

2 files changed

+0
-19
lines changed

2 files changed

+0
-19
lines changed

arch/arm64/include/asm/processor.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ struct thread_struct {
171171
struct debug_info debug; /* debugging */
172172

173173
struct user_fpsimd_state kernel_fpsimd_state;
174-
unsigned int kernel_fpsimd_cpu;
175174
#ifdef CONFIG_ARM64_PTR_AUTH
176175
struct ptrauth_keys_user keys_user;
177176
#ifdef CONFIG_ARM64_PTR_AUTH_KERNEL

arch/arm64/kernel/fpsimd.c

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1509,30 +1509,12 @@ void do_fpsimd_exc(unsigned long esr, struct pt_regs *regs)
15091509

15101510
static void fpsimd_load_kernel_state(struct task_struct *task)
15111511
{
1512-
struct cpu_fp_state *last = this_cpu_ptr(&fpsimd_last_state);
1513-
1514-
/*
1515-
* Elide the load if this CPU holds the most recent kernel mode
1516-
* FPSIMD context of the current task.
1517-
*/
1518-
if (last->st == &task->thread.kernel_fpsimd_state &&
1519-
task->thread.kernel_fpsimd_cpu == smp_processor_id())
1520-
return;
1521-
15221512
fpsimd_load_state(&task->thread.kernel_fpsimd_state);
15231513
}
15241514

15251515
static void fpsimd_save_kernel_state(struct task_struct *task)
15261516
{
1527-
struct cpu_fp_state cpu_fp_state = {
1528-
.st = &task->thread.kernel_fpsimd_state,
1529-
.to_save = FP_STATE_FPSIMD,
1530-
};
1531-
15321517
fpsimd_save_state(&task->thread.kernel_fpsimd_state);
1533-
fpsimd_bind_state_to_cpu(&cpu_fp_state);
1534-
1535-
task->thread.kernel_fpsimd_cpu = smp_processor_id();
15361518
}
15371519

15381520
void fpsimd_thread_switch(struct task_struct *next)

0 commit comments

Comments
 (0)