mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Jiaxun Yang" <jiaxun.yang@flygoat.com>
To: "Thomas Bogendoerfer" <tsbogend@alpha.franken.de>
Cc: "Maciej W. Rozycki" <macro@orcam.me.uk>,
	"Jonathan Corbet" <corbet@lwn.net>,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	"linux-mips@vger.kernel.org" <linux-mips@vger.kernel.org>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: Re: [PATCH v3] MIPS: Implement ieee754 NAN2008 emulation mode
Date: Thu, 11 Jul 2024 09:47:36 +0800	[thread overview]
Message-ID: <4cb980c8-4b96-4ed0-85af-9baa1b7ef30c@app.fastmail.com> (raw)
In-Reply-To: <Zo457UgAkhbAgm2R@alpha.franken.de>



在2024年7月10日七月 下午3:36,Thomas Bogendoerfer写道:
> On Wed, Jul 10, 2024 at 01:34:41PM +0800, Jiaxun Yang wrote:
>> 
>> 
>> 在2024年7月9日七月 下午4:55,Thomas Bogendoerfer写道:
>> > On Fri, Jun 28, 2024 at 01:33:06AM +0100, Jiaxun Yang wrote:
>> >> 
>> >> 
>> >> 在2024年6月27日六月 下午8:54,Maciej W. Rozycki写道:
>> >> > On Thu, 27 Jun 2024, Jiaxun Yang wrote:
>> >> >
>> >> >> >> @@ -318,6 +318,10 @@ void mips_set_personality_nan(struct arch_elf_state *state)
>> >> >> >>  	t->thread.fpu.fcr31 = c->fpu_csr31;
>> >> >> >>  	switch (state->nan_2008) {
>> >> >> >>  	case 0:
>> >> >> >> +		if (!(c->fpu_msk31 & FPU_CSR_NAN2008))
>> >> >> >> +			t->thread.fpu.fcr31 &= ~FPU_CSR_NAN2008;
>> >> >> >> +		if (!(c->fpu_msk31 & FPU_CSR_ABS2008))
>> >> >> >> +			t->thread.fpu.fcr31 &= ~FPU_CSR_ABS2008;
>> >> >> >
>> >> >> > why is this needed?
>> >> >> 
>> >> >> Because t->thread.fpu.fcr31 comes from c->fpu_csr31, in this case we the default
>> >> >> value of c->fpu_csr31 is read from hardware and we don't know what would that be.
>> >> >
>> >> >  But it has always been like this.  What has changed with your patch that 
>> >> > you need to mask the bit out now?
>> >> 
>> >> After this patch kernel's copy of t->thread.fpu.fcr31 can disagree with hardware.
>> >> When disagree happens, we trigger emulation.
>> >> 
>> >> Before that patch for nan legacy binary running on nan2008 CPU t->thread.fpu.fcr31
>> >> will still be nan2008 (for ieee754=relaxed) so that's not relevant.
>> >
>> > I'm considering to apply your patch, how much testing/verification did
>> > this patch see ? Do have some test binaries ?
>> 
>> It has been tested against Debian rootfs. There is no need to test againt special binary,
>> but you need NaN2008 hardware such as Loongson 3A4000.
>
> that's just one case, what about NaN2008 binaries on a legacy MIPS CPU ?

Boot tested CIP United's NaN2008 Debian port, works good so far [1].

[1]: http://repo.oss.cipunited.com/debian/README.nan2008.txt

Thanks
- Jiaxun

>
> Thomas.
>
> -- 
> Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
> good idea.                                                [ RFC1925, 2.3 ]

-- 
- Jiaxun

  parent reply	other threads:[~2024-07-11  1:47 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-12  8:38 Jiaxun Yang
2024-06-27 10:58 ` Thomas Bogendoerfer
2024-06-27 11:21   ` Jiaxun Yang
2024-06-27 19:54     ` Maciej W. Rozycki
2024-06-28  0:33       ` Jiaxun Yang
2024-07-09  8:55         ` Thomas Bogendoerfer
2024-07-10  5:34           ` Jiaxun Yang
2024-07-10  7:36             ` Thomas Bogendoerfer
2024-07-10  8:16               ` Jiaxun Yang
2024-07-10  9:21               ` Maciej W. Rozycki
2024-07-11  1:53                 ` Jiaxun Yang
2024-07-11 10:20                   ` Maciej W. Rozycki
2024-07-12  0:36                     ` Jiaxun Yang
2024-07-12 12:22                       ` Maciej W. Rozycki
2024-07-14  3:11                         ` Jiaxun Yang
2024-07-15 12:15                           ` Maciej W. Rozycki
2024-07-15 12:35                             ` Jiaxun Yang
2024-07-15 14:01                               ` Maciej W. Rozycki
2024-07-15 16:38                                 ` YunQiang Su
2024-08-22  8:02                               ` Thomas Bogendoerfer
2024-08-22  9:20                                 ` Jiaxun Yang
2024-07-11  1:47               ` Jiaxun Yang [this message]
2024-07-12 11:21 ` Thomas Bogendoerfer

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=4cb980c8-4b96-4ed0-85af-9baa1b7ef30c@app.fastmail.com \
    --to=jiaxun.yang@flygoat.com \
    --cc=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=macro@orcam.me.uk \
    --cc=philmd@linaro.org \
    --cc=tsbogend@alpha.franken.de \
    /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

all inboxes | Powered by JetHome®