On 6/3/25 08:26, Thomas Huth wrote:
On 05/03/2025 17.59, Pierrick Bouvier wrote:
On 3/5/25 07:39, Philippe Mathieu-Daudé wrote:
Introduce an API to get information specific to a binary
from the binary name (argv[0]).
Initialize it from qemu_init() on system emulation.
What we want here is more a include/qemu/target_info.h, which will
allow to query the name of it, and helper for every architecture:
target_is_aarch64()
target_is_ppc64()
...
Eventually, we can add combined getters like:
target_is_64bit()
...
Naming "legacy" something that will be present in the long term is not
the best move I think.
FWIW, I agree, this should rather be target_is_64bit() or something
similar, like target_words_bigendian() ?
This API is to allow refactoring code for heterogeneous emulation,
without changing user-facing behavior of current qemu-system binaries,
which I now consider as 'legacy'.
Once all current restrictions removed, the new qemu-system-heterogeneous
binary is expected to run any combination of targets.
qemu-system-$target will be a call to qemu-system-heterogeneous with
a restricted subset, possibly in the form of:
$ qemu-system-heterogeneous --target aarch64-softmmu
^ equivalent of today's qemu-system-aarch64
If you don't like 'qemu_legacy_binary_' prefix, I can use
'qemu_single_binary_' instead.
target_is_64bit() is misleading, for example in:
$ qemu-system-aarch64 -M zynqmp
we create 64-bit and 32-bit ARM cores.