]> git.proxmox.com Git - mirror_qemu.git/commit
linux-user/hppa: Fix segfaults on page zero
authorHelge Deller <deller@gmx.de>
Mon, 18 Jul 2022 16:40:43 +0000 (18:40 +0200)
committerLaurent Vivier <laurent@vivier.eu>
Mon, 25 Jul 2022 08:42:11 +0000 (10:42 +0200)
commitbd4b7fd6ba98e2d660356f1f52edcec5c51b0991
treea36878982b7add3f893e832e91b79a81af17e020
parent5288bee45fbd33203b61f8c76e41b15bb5913e6e
linux-user/hppa: Fix segfaults on page zero

This program:

    int main(void) { asm("bv %r0(%r0)"); return 0; }

produces on real hppa hardware the expected segfault:

    SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x3} ---
    killed by SIGSEGV +++
    Segmentation fault

But when run on linux-user you get instead internal qemu errors:

ERROR: linux-user/hppa/cpu_loop.c:172:cpu_loop: code should not be reached
Bail out! ERROR: linux-user/hppa/cpu_loop.c:172:cpu_loop: code should not be reached
ERROR: accel/tcg/cpu-exec.c:933:cpu_exec: assertion failed: (cpu == current_cpu)
Bail out! ERROR: accel/tcg/cpu-exec.c:933:cpu_exec: assertion failed: (cpu == current_cpu)

Fix it by adding the missing case for the EXCP_IMP trap in
cpu_loop() and raise a segfault.

Signed-off-by: Helge Deller <deller@gmx.de>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <YtWNC56seiV6VenA@p100>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
linux-user/hppa/cpu_loop.c