On 11/16/2026 2:00 AM, Peter Maydell wrote:
On Mon, 16 Nov 2026 at 08:53, Philippe Mathieu-Daudé <philmd@oss.qualcomm.com> wrote:
On 13/11/26 19:55, Peter Maydell wrote:
As a more general question, is this something we would want for architectures where both endiannesses are relevant (e.g. mips, ppc64)? At the moment we consistently for all targets handle big vs little endian as "it's a separate target with its own executable". That's convenient because you can at compile time hardwire in things like variations in struct layout between the two. We could switch to doing that kind of thing at runtime, but what is the benefit we're aiming for by doing that?
I did the other conversions (Microblaze, Xtensa, PPC, MIPS, SH4) and wanted to test the water first where this would get more attention, with the series involving less changes.
My motivation is MIPS where we currently have 6 binaries and I'd like to add binaries to cover more ABIs without having a combinatory explosion and have 18 linux-user MIPS binaries. With this approach I reduced the current MIPS set to 3 binaries and add 2 more, ending with 5 covering more ABIs instead of currently 6.
In order to get there I need the few core changes introduced in this series, which affect all user binaries. I have the idea ARM users are the first ones interested by no performance change thus is where I started the benchmark to prove this approach have no impact in emulation.
The TargetInfo structure change (one initializer LTO-protected and all accessors via read-only exposed structure) is also what Richard was very keen to have (page size support planned) instead of the current approach.
I'm thus returning the question as: why would we not want to do this?
Mostly because what we have today works, and the idea of "the target ABI is known at compile-time" is quite deeply embedded in the way the linux-user code is written (both in terms of ifdefs and also C types being defined appropriately for one specific ABI).
The last part is what we had for system mode, and precisely what we have been able to eliminate while working on the single-binary. We could keep minimal wrappers to previous binaries in case we want to wait a few releases to completely remove them. In this case, the benefit is that the same existing binary (without endianness variant) will be able to run "more things". Since we talk about user-mode, it's strictly dependent on the program passed in parameter, and we don't need to manually specify endianness anywhere. For the "how to make sure it works like before?", as usual, testing, and a small leap of faith are required. Overall, I think it would be a nice move for user-mode.
The idea of not having to have 18 different MIPS linux-user binaries is pretty tempting, though.
thanks -- PMM
Regards, Pierrick