From: wangyangbo <yangbonis@icloud.com>
To: tsbogend@alpha.franken.de, hejinyang@loongson.cn,
chenhuacai@kernel.org, peterz@infradead.org, frederic@kernel.org,
axboe@kernel.dk
Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org,
xiehuanjun@uniontech.com, wangyangbo <yangbonis@icloud.com>
Subject: [PATCH 1/1] MIPS: Fix fpu trap invoked by io-worker
Date: Mon, 13 Sep 2021 13:37:17 +0800 [thread overview]
Message-ID: <c3a171e31fab6eaaadd67b8e672c5d33aa9ee20c.1631510421.git.yangbonis@icloud.com> (raw)
In-Reply-To: <cover.1631510421.git.yangbonis@icloud.com>
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
prev parent reply other threads:[~2021-09-13 5:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-13 5:36 [PATCH 0/1] Create kernel thread possibly with USEDFPU flag in mips wangyangbo
2021-09-13 5:37 ` wangyangbo [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c3a171e31fab6eaaadd67b8e672c5d33aa9ee20c.1631510421.git.yangbonis@icloud.com \
--to=yangbonis@icloud.com \
--cc=axboe@kernel.dk \
--cc=chenhuacai@kernel.org \
--cc=frederic@kernel.org \
--cc=hejinyang@loongson.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=tsbogend@alpha.franken.de \
--cc=xiehuanjun@uniontech.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).