diff options
author | Max Filippov <jcmvbkbc@gmail.com> | 2018-11-26 16:30:51 -0800 |
---|---|---|
committer | Max Filippov <jcmvbkbc@gmail.com> | 2018-12-04 14:08:23 -0800 |
commit | be38e4f2cc08d91515b86a4a8ea75ba902795873 (patch) | |
tree | fec12d0daf2fadea20cce426118fbb560bd6fb41 /arch/xtensa/kernel/process.c | |
parent | 5dacbbef3d29598dcb6ecf747a7dae4fbb4ce039 (diff) | |
download | linux-be38e4f2cc08d91515b86a4a8ea75ba902795873.tar.gz linux-be38e4f2cc08d91515b86a4a8ea75ba902795873.tar.bz2 linux-be38e4f2cc08d91515b86a4a8ea75ba902795873.zip |
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>
Diffstat (limited to 'arch/xtensa/kernel/process.c')
-rw-r--r-- | arch/xtensa/kernel/process.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/xtensa/kernel/process.c b/arch/xtensa/kernel/process.c index be9e0c3df9d2..27be75e88ed3 100644 --- a/arch/xtensa/kernel/process.c +++ b/arch/xtensa/kernel/process.c @@ -87,7 +87,8 @@ void coprocessor_release_all(struct thread_info *ti) } ti->cpenable = cpenable; - xtensa_set_sr(0, cpenable); + if (ti == current_thread_info()) + xtensa_set_sr(0, cpenable); preempt_enable(); } |