05.03.2024 16:52, Peter Maydell wrote:
From: Richard Henderson <richard.hender...@linaro.org>

If translation is disabled, the default memory type is Device, which
requires alignment checking.  This is more optimally done early via
the MemOp given to the TCG memory operation.

Reviewed-by: Philippe Mathieu-Daudé <phi...@linaro.org>
Reported-by: Idan Horowitz <idan.horow...@gmail.com>
Signed-off-by: Richard Henderson <richard.hender...@linaro.org>
Message-id: 20240301204110.656742-6-richard.hender...@linaro.org
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1204
Signed-off-by: Richard Henderson <richard.hender...@linaro.org>
Signed-off-by: Peter Maydell <peter.mayd...@linaro.org>

Hi!

Apparently this change also breaks picolibc testsuite (between
8.2 and 9.0, bisect points to this commit).

For example:

./qemu-system-arm \
  -m 1G \
  -chardev stdio,mux=on,id=stdio0 \
  -semihosting-config enable=on,chardev=stdio0,arg=program-name \
  -monitor none \
  -serial none \
  -machine none,accel=tcg \
  -cpu cortex-a8 \
  -device 
loader,file=/tmp/picolibc-1.8.6/arm-none-eabi/test/printf_scanf_thumb_v7_fp_softfp,cpu-num=0
 \
  -nographic

(yes, this testsuite uses qemu-system as a substitute of
qemu-user, sort of, (ab)using -device loader)

Before this change:

hello world 1
checking floating point
checking pos args
checking long long
checking c99 formats

(exit code = 0)

After this change:

hello world 1
checking floating point
checking pos args
ARM fault: undef
        R0:   0x00000002
        R1:   0x00005c90
        R2:   0x201ffeac
        R3:   0x20200000
        R4:   0x00000000
        R5:   0x20000004
        R6:   0x201ffec4
        PC:   0x00000364



Another test from the same picolibc:

timeout 1s ./qemu-system-arm \
  -m 1G \
  -chardev stdio,mux=on,id=stdio0 \
  -semihosting-config enable=on,chardev=stdio0,arg=program-name \
  -monitor none \
  -serial none \
  -machine none,accel=tcg \
  -cpu cortex-a7 \
  -device 
loader,file=/tmp/picolibc-1.8.6/arm-none-eabi/newlib/testsuite/newlib.string/tstring_thumb_v7_nofp,cpu-num=0
 \
  -nographic

This one succeeds immediately before this change, and
just times out (qemu is basically doing nothing, according to
strace) after this commit.



Exactly the same happens up to current qemu master (ie, 9.1-tobe).
So is not https://gitlab.com/qemu-project/qemu/-/issues/2326
and is not fixed by 4c2c0474693229c1f533239bb983495c5427784d
"target/arm: Fix usage of MMU indexes when EL3 is AArch32".



picolibc is built this way:

picolibc-1.8.6$ meson setup . arm-none-eabi \
  --prefix=/usr \
  -Dc_args='-Wdate-time' \
  -Dtests=true \
  --cross-file scripts/cross-arm-none-eabi.txt \
  -Dspecsdir=/usr/lib/picolibc/arm-none-eabi \
  -Dincludedir=lib/picolibc/arm-none-eabi/include \
  -Dlibdir=lib/picolibc/arm-none-eabi/lib


Thanks,

/mjt

Reply via email to