[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3ed8b576-723f-4c3b-8394-cd9255c2b63c@iscas.ac.cn>
Date: Mon, 9 Feb 2026 16:34:30 +0800
From: Vivian Wang <wangruikang@...as.ac.cn>
To: Hui Min Mina Chou <minachou@...estech.com>, pjw@...nel.org,
palmer@...belt.com, aou@...s.berkeley.edu, alex@...ti.fr,
linux-riscv@...ts.infradead.org, linux-kernel@...r.kernel.org
Cc: tim609@...estech.com, ben717@...estech.com, az70021@...il.com,
Charles Ci-Jyun Wu <dminus@...estech.com>
Subject: Re: [PATCH] riscv: fpu: refine FPU save flow
On 2/5/26 13:53, Hui Min Mina Chou wrote:
> From: Charles Ci-Jyun Wu <dminus@...estech.com>
>
> When Kernel first time run to arch_dup_task_struct(),
> it will check if sstatus.FS is dirty. If it is dirty,
> then it will do FPU save flow. But this field is
> floating currently. Meanwhile if the combination between
> platform(HW) and Kernel(SW) about FPU configuration
> is mismatch. eq: The platform is without FPU and Kernel
> is with FPU. Then Kernel may trigger illegal instruction
> here.
This doesn't really make sense. fstate_save checks for ((regs->status &
SR_FS) == SR_FS_DIRTY). Do you mean that a platform can be !has_fpu(),
yet come up with a task_pt_regs(...)->status that's SR_FS?
Do you have some reproduction steps on how this bug can be triggered?
QEMU should support disabling F/D.
If by "floating" you mean task_pt_regs(src)->status is uninitialized
somehow, that's the bug that needs to be fixed. Adding a band-aid here
just confuses everyone without addressing the problem.
Vivian "dramforever" Wang
Powered by blists - more mailing lists