Re: [PATCH V3] LoongArch: Provide kernel fpu functions

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

 



On Mon, 2023-03-06 at 20:49 +0800, Huacai Chen wrote:
> > > +     if (!is_fpu_owner())
> > > +             enable_fpu();
> > > +     else
> > > +             _save_fp(&current->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@xxxxxxxxxxx>
School of Aerospace Science and Technology, Xidian University




[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux