[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 07 Jul 2022 12:04:28 +0800
From: Xi Ruoyao <xry111@...111.site>
To: WANG Xuerui <kernel@...0n.name>, Qi Hu <huqi@...ngson.cn>,
Jiaxun Yang <jiaxun.yang@...goat.com>,
Huacai Chen <chenhuacai@...nel.org>
Cc: loongarch@...ts.linux.dev, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] LoongArch: Clean useless vcsr in loongarch_fpu.
On Thu, 2022-07-07 at 11:05 +0800, WANG Xuerui wrote:
> To be frank, at this point I think you're trying to hide something.
> (This is not your fault, blame someone else of course because they told
> you the fact.) In the old-world kernel the VCSR a.k.a. FCSR16 is
> certainly being saved/restored, and there's apparently no harm in doing
> so. And if the contents are indeed "undefined", why are the code there
> in the first place? Certainly the bits *are* meaningful, only that for
> some reason you aren't revealing the semantics and pretending that they
> are "undefined" and probably "do nothing externally observable" if
> accessed in the first place.
On a 3A5000LL, I did an experiment via a kernel module, which enables
LSX/LASX and tries to write and read fcsr16. I tried each bit (1, 2, 4,
8, ..., 1 << 31) one by one. The result: no matter which bit I wrote
into fcsr16, I always read out 0.
And I've objdump'ed a kernel shipped in an early Loongnix release. It
seems the only reference to fcsr16 is a "movgr2fcsr $r16, $r0"
instruction.
--
Xi Ruoyao <xry111@...111.site>
School of Aerospace Science and Technology, Xidian University
Powered by blists - more mailing lists