Messages in this thread | | | Subject | Re: [PATCH V3] LoongArch: Provide kernel fpu functions | From | Xi Ruoyao <> | Date | Mon, 06 Mar 2023 21:00:33 +0800 |
| |
On Mon, 2023-03-06 at 20:49 +0800, Huacai Chen wrote: > > > + if (!is_fpu_owner()) > > > + enable_fpu(); > > > + else > > > + _save_fp(¤t->thread.fpu); > > Do we need initialize fcsr rather than using random fcsr value > > of other processes? There may be fpu exception enabled by > > other tasks. > Emm, I think initialize fcsr to 0 is better here.
I guess it's necessary: if we use a "dirty" FSCR0 with some exceptions enabled (esp. inaccurate exception which is expected as disabled by most developers), we may end up oops with a kernel FPE... -- Xi Ruoyao <xry111@xry111.site> School of Aerospace Science and Technology, Xidian University
| |