Skip to content
  • Helge Deller's avatar
    bd4b7fd6
    linux-user/hppa: Fix segfaults on page zero · bd4b7fd6
    Helge Deller authored
    
    
    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: default avatarHelge Deller <deller@gmx.de>
    Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
    Message-Id: <YtWNC56seiV6VenA@p100>
    Signed-off-by: default avatarLaurent Vivier <laurent@vivier.eu>
    bd4b7fd6
    linux-user/hppa: Fix segfaults on page zero
    Helge Deller authored
    
    
    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: default avatarHelge Deller <deller@gmx.de>
    Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
    Message-Id: <YtWNC56seiV6VenA@p100>
    Signed-off-by: default avatarLaurent Vivier <laurent@vivier.eu>
Loading