Re: [PATCH 5/7] tools/nolibc: handle 64-bit system call arguments on MIPS N32
From: Thomas Weißschuh
Date: Mon Apr 20 2026 - 12:51:23 EST
Hi David,
On 2026-04-19 22:35:07+0100, David Laight wrote:
> On Sun, 19 Apr 2026 17:30:13 +0200
> Willy Tarreau <w@xxxxxx> wrote:
> > On Sat, Apr 18, 2026 at 01:54:55PM +0200, Thomas Weißschuh wrote:
(...)
> I would suggest using "+r" for the in-out registers; and [arg5] for the
> ones that get pushed, reliably counting to 7 is hard :-)
Yeah, we could do this. As the code barely changes I am not convinced it
makes a big difference, though. It wouldn't be part of this patchset
anyways. If you want to send a patch, please go ahead :-)
> Related to one of the other patches, I can't imagine how N32 getting
> a 64bit value truncated would be a qemu bug.
> Just seems wrong - isn't the cpu just running in 64bit mode ?
That is true for QEMU "system" mode. And there everything works
correctly. But the bug exists in QEMU "user" mode. This does not
simulate a CPU. Instead a single executable is executed on the host by
converting code and system calls on demand. That translation is
architectures/ABI-specific and the N32 implementation uses 32-bit
variables.
(...)
Thomas