You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
qemu/linux-user/microblaze
Philippe Mathieu-Daudé 91fc6d8101 linux-user/microblaze: Fix little-endianness binary
MicroBlaze CPU model has a "little-endian" property, pointing to
the @endi internal field. Commit c36ec3a965 ("hw/microblaze:
Explicit CPU endianness") took care of having all MicroBlaze
boards with an explicit default endianness, so later commit
415aae543e ("target/microblaze: Consider endianness while
translating code") could infer the endianness at runtime from
the @endi field, and not a compile time via the TARGET_BIG_ENDIAN
definition. Doing so, we forgot to make the endianness explicit
on user emulation, so there all CPUs are started with the default
"little-endian=off" value, leading to breaking support for little
endian binaries:

  $ readelf -h ./hello-world-mbel
  ELF Header:
    Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
    Class:                             ELF32
    Data:                              2's complement, little endian

  $ qemu-microblazeel ./hello-world-mbel
  qemu: uncaught target signal 11 (Segmentation fault) - core dumped
  Segmentation fault (core dumped)

Fix by restoring the previous behavior of starting with the
builtin endianness of the binary:

  $ qemu-microblazeel ./hello-world-mbel
  Hello World

Cc: qemu-stable@nongnu.org
Fixes: 415aae543e ("target/microblaze: Consider endianness while translating code")
Reported-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
Message-Id: <20251006173350.17455-1-philmd@linaro.org>
1 week ago
..
cpu_loop.c bsd-user, linux-user: introduce qemu_process_cpu_events 1 month ago
elfload.c linux-user/microblaze: Fix little-endianness binary 1 week ago
meson.build meson: linux-user 5 years ago
signal.c linux-user/microblaze: Fold target_pt_regs.r* to an array 2 months ago
sockbits.h linux-user: move socket.h generic definitions to generic/sockbits.h 8 years ago
syscall.tbl target/ppc: Fix lxvx/stxvx facility check 1 year ago
syscallhdr.sh license: Update deprecated SPDX tag GPL-2.0 to GPL-2.0-only 1 year ago
target_cpu.h linux user: Fix Lesser GPL version number 5 years ago
target_elf.h linux-user: Rename elf_check_arch 2 months ago
target_errno_defs.h linux-user: Extract target errno to 'target_errno_defs.h' 4 years ago
target_fcntl.h linux-user: move generic fcntl definitions to generic/fcntl.h 7 years ago
target_flat.h linux-user: move target_flat.h to target subdirs 3 years ago
target_mman.h linux-user: Define ELF_ET_DYN_BASE in $guest/target_mman.h 2 years ago
target_prctl.h linux-user: Split out do_prctl and subroutines 4 years ago
target_proc.h linux-user: Split out cpu/target_proc.h 2 years ago
target_ptrace.h linux-user/microblaze: Fold target_pt_regs.r* to an array 2 months ago
target_resource.h linux-user: Move generic TARGET_RLIMIT* definitions to generic/target_resource.h 4 years ago
target_signal.h linux-user: Move TARGET_SA_RESTORER out of generic/signal.h 8 months ago
target_structs.h linux-user: Move target_struct.h generic definitions to generic/ 4 years ago
target_syscall.h linux-user/microblaze: Create target_ptrace.h 2 months ago
termbits.h linux-user: Add generic 'termbits.h' for some archs 5 years ago