Skip to content

Commit be38e4f

Browse files
committed
xtensa: don't clear cpenable unconditionally on release
Clearing cpenable special register for a task without changing coprocessor owner for the coprocessors that were enabled will result in coprocessor context flush and immediate reload at the next attempt to access this coprocessor if it happens before the context switch. Avoid it by only clearing cpenable special register if coprocessor_release_all is called for the current task. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
1 parent 5dacbbe commit be38e4f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎arch/xtensa/kernel/process.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ void coprocessor_release_all(struct thread_info *ti)
8787
}
8888

8989
ti->cpenable = cpenable;
90-
xtensa_set_sr(0, cpenable);
90+
if (ti == current_thread_info())
91+
xtensa_set_sr(0, cpenable);
9192

9293
preempt_enable();
9394
}

0 commit comments

Comments
 (0)