lkml.org 
[lkml]   [2021]   [Sep]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/1] MIPS: Fix fpu trap invoked by io-worker
Date
From: wangyangbo <wangyangbo@uniontech.com>

Create worker thread from original user task in mips, possibly copying
FPU flag from user task, introducing save_fp when switch_to, triggering
do_cpu trap. So clear USEDFPU flag for IO_WORKER in copy_thread.

Signed-off-by: wangyangbo <yangbonis@icloud.com>
---
arch/mips/kernel/process.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
index 95aa86fa6077..0095006d48c7 100644
--- a/arch/mips/kernel/process.c
+++ b/arch/mips/kernel/process.c
@@ -135,6 +135,9 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
status |= ST0_EXL;
#endif
childregs->cp0_status = status;
+
+ if (p->flags & PF_IO_WORKER)
+ clear_tsk_thread_flag(p, TIF_USEDFPU);
return 0;
}

--
2.20.1
\
 
 \ /
  Last update: 2021-09-13 07:47    [W:0.227 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site