From: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
To: YunQiang Su <wzssyqa@gmail.com>
Cc: "YunQiang Su" <yunqiang.su@cipunited.com>,
linux-mips <linux-mips@vger.kernel.org>,
"Maciej W. Rozycki" <macro@orcam.me.uk>,
"Jiaxun Yang" <jiaxun.yang@flygoat.com>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
stable@vger.kernel.org
Subject: Re: [PATCH v9] MIPS: force use FR=0 for FPXX binaries
Date: Tue, 30 Mar 2021 14:24:37 +0200 [thread overview]
Message-ID: <20210330122437.GA10355@alpha.franken.de> (raw)
In-Reply-To: <CAKcpw6Vd6pCT2PB4pZATnEq8Y4pSj4cwNFZgg6yK6VjoeY+N-Q@mail.gmail.com>
On Mon, Mar 29, 2021 at 06:28:40PM +0800, YunQiang Su wrote:
> Thomas Bogendoerfer <tsbogend@alpha.franken.de> 于2021年3月29日周一 下午5:30写道:
> >
> > On Mon, Mar 29, 2021 at 01:09:18PM +0800, YunQiang Su wrote:
> > > YunQiang Su <yunqiang.su@cipunited.com> 于2021年3月22日周一 上午10:00写道:
> > > >
> > > > The MIPS FPU may have 3 mode:
> > > > FR=0: MIPS I style, all of the FPR are single.
> > > > FR=1: all 32 FPR can be double.
> > > > FRE: redirecting the rw of odd-FPR to the upper 32bit of even-double FPR.
> > > >
> > > > The binary may have 3 mode:
> > > > FP32: can only work with FR=0 and FRE mode
> > > > FPXX: can work with all of FR=0/FR=1/FRE mode.
> > > > FP64: can only work with FR=1 mode
> > > >
> > > > Some binary, for example the output of golang, may be mark as FPXX,
> > > > while in fact they are FP32. It is caused by the bug of design and linker:
> > > > Object produced by pure Go has no FP annotation while in fact they are FP32;
> > > > if we link them with the C module which marked as FPXX,
> > > > the result will be marked as FPXX. If these fake-FPXX binaries is executed
> > > > in FR=1 mode, some problem will happen.
> > > >
> > > > In Golang, now we add the FP32 annotation, so the future golang programs
> > > > won't have this problem. While for the existing binaries, we need a
> > > > kernel workaround.
> > > >
> > >
> > > We meet a new problem in Debian: with the O32_FP64 enabled kernel,
> > > mips64el may also be affected.
> > > https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=983583
> >
> > hmm, raising this issue in this context before knowing more details,
> > feels very trigger happy to me and this doesn't help accepting anything,
> > jfyi...
> >
> > Could you please provide a link for downloading a golang binary, which
> > would need this patch to run ?
> >
>
> For rootfs, you can download
> http://58.246.137.130:20180/debian-from/rootfs/buster-mipsel.tar.xz
> or create by:
> sudo debootstrap --arch mipsel --include golang-1.11-go \
> buster buster-mipsel http://deb.debian.org/debian
>
> For binary packages, you can download:
> https://packages.debian.org/buster/mipsel/golang-1.11-go/download
>
> just chroot the rootfs and run:
> /usr/lib/go-1.11/bin/go
> It will crash if kernel's O32_FP64 option is enabled.
now I'm confused. Do go binaries crash the kernel ? Or is this just
the issue _not_ related to this patch ?
I want a single go binary, which I can inspect about the FPXX thing and
see how easy it would be to just patch the binary and make it run without
this patch.
Thomas.
--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]
next prev parent reply other threads:[~2021-03-30 12:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-22 1:59 [PATCH v9] MIPS: force use FR=0 for FPXX binaries YunQiang Su
2021-03-29 5:09 ` YunQiang Su
2021-03-29 8:55 ` YunQiang Su
2021-03-29 9:00 ` Thomas Bogendoerfer
2021-03-29 10:28 ` YunQiang Su
2021-03-30 12:24 ` Thomas Bogendoerfer [this message]
2021-03-30 14:22 ` Maciej W. Rozycki
2021-03-30 15:34 ` Maciej W. Rozycki
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=20210330122437.GA10355@alpha.franken.de \
--to=tsbogend@alpha.franken.de \
--cc=f4bug@amsat.org \
--cc=jiaxun.yang@flygoat.com \
--cc=linux-mips@vger.kernel.org \
--cc=macro@orcam.me.uk \
--cc=stable@vger.kernel.org \
--cc=wzssyqa@gmail.com \
--cc=yunqiang.su@cipunited.com \
/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