[PATCH] xtensa: don't clear cpenable unconditionally on release

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



fast_coprocessor exception handler expects that the coprocessor owner
task never gets the "coprocessor disabled" exception for a coprocessor
that is marked as enabled in the thread_info::cpenable. If that happens
it will reload potentially outdated context from the thread_info
structure into the coprocessor registers.
Only call coprocessor_clear_cpenable from the coprocessor_release_all
if the latter is called for the current task.

Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Max Filippov <jcmvbkbc@xxxxxxxxx>
---
 arch/xtensa/kernel/process.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/xtensa/kernel/process.c b/arch/xtensa/kernel/process.c
index 3fa0c440f664..6c7c80106f60 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;
-	coprocessor_clear_cpenable();
+	if (ti == current_thread_info())
+		coprocessor_clear_cpenable();
 
 	preempt_enable();
 }
-- 
2.11.0




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux