Re: [PATCH 09/12] target-info: register le and be TargetInfo variants
Philippe Mathieu-Daudé <[email protected]>
| Newsgroups | org.nongnu.qemu-riscv,org.nongnu.qemu-arm,org.nongnu.qemu-devel |
|---|---|
| Message-ID | <[email protected]> |
On 24/8/26 21:01, Yonggang Luo wrote: > On Tue, Aug 25, 2026 at 12:22 AM Pierrick Bouvier < > [email protected]> wrote: >> >> On 8/23/2026 8:07 AM, Yonggang Luo wrote: >>> - Register target-info-<name>-le and -be from one system >>> target-info-def.c unit, sharing arch fields. >>> - Mark is_default from TARGET_BIG_ENDIAN so riscv/arm stay LE and >>> ppc/s390x stay BE when -target is omitted. >>> - Pick the unique default in target_info_qom_set_target() when more >>> than one TargetInfo is registered. Leave user-mode as a single >>> target_info(). >>> >>> Signed-off-by: Yonggang Luo <[email protected]> >>> --- >>> include/qemu/target-info-impl.h | 6 ++++ >>> include/qemu/target-info-init.h | 29 +++++++++++++--- >>> target-info-def.c | 61 +++++++++++++++++++++++++-------- >>> target-info-qom.c | 33 ++++++++++++++---- >>> 4 files changed, 104 insertions(+), 25 deletions(-) Clearly not the path we choose, have a look for example at how we converted MicroBlaze: $ git log --oneline */microblaze/ | fgrep -i endian 41c417290df target/microblaze: Fix endianness used to disassemble 1346a811234 hw/microblaze: Replace TARGET_BIG_ENDIAN -> target_big_endian() 9281c68deca target/microblaze: Directly check endianness via CPUConfig::endi flag 91fc6d8101d linux-user/microblaze: Fix little-endianness binary 0e259fa5a13 hw/microblaze: Remove the big-endian variants of ml605 and xlnx-zynqmp-pmu 141ec228deb hw/microblaze: Add endianness property to the petalogix_s3adsp1800 machine eb3020b6ed2 hw/microblaze: Evaluate TARGET_BIG_ENDIAN at compile time 840e0862c52 target/microblaze: Set disassemble_info::endian value in disas_set_info 415aae543ed target/microblaze: Consider endianness while translating code 2c9e8ddd769 target/microblaze: Introduce mo_endian() helper e87c93df113 hw/ssi/xilinx_spi: Make device endianness configurable 8a8c92c8afb hw/char/xilinx_uartlite: Make device endianness configurable df1f35ab67e hw/timer/xilinx_timer: Make device endianness configurable 644276db5d7 hw/net/xilinx_ethlite: Make device endianness configurable 2cdf693b197 hw/intc/xilinx_intc: Make device endianness configurable adc1a4a26a9 hw/loader: Pass ELFDATA endian order argument to load_elf() 8f27e70e3bc hw/microblaze: Propagate CPU endianness to microblaze_load_kernel() c36ec3a9655 hw/microblaze/s3adsp1800: Explicit CPU endianness 181b3a7bb03 hw/microblaze: Deprecate big-endian petalogix-ml605 & xlnx-zynqmp-pmu 6c8cec822f1 target/microblaze: Alias CPU endianness property as 'little-endian' >> Is it representing existing targets, or adding new ones per endianness? >> I'm not sure if the goal is to add new binaries, or mimic existing ones >> with specific parameters. > > > Is optional now, not a force requirement, this is needed when we use GDB > debug qemu riscv-be, as gdbstub are depends on target_info Again the bug you want to fix is on the gdbstub path.