From: Tzu-Ching Yang <shingekinocore@gmail.com>
To: "Maciej W. Rozycki" <macro@orcam.me.uk>
Cc: "Thomas Bogendoerfer" <tsbogend@alpha.franken.de>,
linux-mips@vger.kernel.org, "Arnd Bergmann" <arnd@arndb.de>,
"Yury Norov" <yury.norov@gmail.com>,
"Rasmus Villemoes" <linux@rasmusvillemoes.dk>,
linux-kernel@vger.kernel.org,
"Gregory CLEMENT" <gregory.clement@bootlin.com>,
"Théo Lebrun" <theo.lebrun@bootlin.com>,
"Benoît Monin" <benoit.monin@bootlin.com>,
"Jiaxun Yang" <jiaxun.yang@flygoat.com>
Subject: Re: [PATCH] MIPS: Make cpu_has_mips64r6 constant on 64-bit r6 kernels
Date: Mon, 23 Nov 2026 20:37:46 +0800 [thread overview]
Message-ID: <20261123123746.2963491-1-shingekinocore@gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.21.2611231038330.54328@angie.orcam.me.uk>
On Mon, 23 Nov 2026, Maciej W. Rozycki wrote:
> > Your form and v1 differ only on pre-r6 kernels. I built both on
>
> Then you're doing something wrong; with __isa_ge_or_flag() I get:
[...]
> $ objdump -d vmlinux-base | grep -c dclz
> 18
> $ objdump -d vmlinux-has-mips64r6 | grep -c dclz
> 1430
Sorry, I worded that badly: I compared your form with v1, not with
mainline. Against mainline, in bytes of bloat-o-meter -t with GCC
16.2:
defconfig your form v1
--------- --------- -------
64r6el -105340 -105340
32r6el 0 0
64r2el +264 0
32r2el +3352 0
On the r6 kernels the two give the same vmlinux, byte for byte, so
your form has all of the gain that you show. On the pre-r6 kernels it
makes cpu_has_mips64r6 a run-time test, hence the growth; v1 leaves
their vmlinux as it is.
> I maintain that __isa_ge_or_flag() is the correct approach.
Understood. v2 will use your form: cpu_has_mips64r6 as cpu_has_64bits
&& __isa_ge_or_flag(6, MIPS_CPU_ISA_M64R6), with __isa_ge_and_flag()
removed.
> FWIW an early check for the ISA mismatch might be worth having if at all
> feasible, reporting the issue via a firmware printf()-like callback where
> available. Said JR instruction could be recoded as JALR $0, ... if this
> turns out feasible. Not a requirement for your change of course.
Thanks, I will look into that separately.
Tzu-Ching
prev parent reply other threads:[~2026-11-23 12:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-30 14:04 Tzu-Ching Yang
2026-10-30 15:27 ` Maciej W. Rozycki
2026-11-23 3:57 ` Tzu-Ching Yang
2026-11-23 11:32 ` Maciej W. Rozycki
2026-11-23 12:37 ` Tzu-Ching Yang [this message]
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=20261123123746.2963491-1-shingekinocore@gmail.com \
--to=shingekinocore@gmail.com \
--cc=arnd@arndb.de \
--cc=benoit.monin@bootlin.com \
--cc=gregory.clement@bootlin.com \
--cc=jiaxun.yang@flygoat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=macro@orcam.me.uk \
--cc=theo.lebrun@bootlin.com \
--cc=tsbogend@alpha.franken.de \
--cc=yury.norov@gmail.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
all inboxes | Powered by JetHome®