qemu/linux-user/ppc
Vincent Fazio feb39b6228 target/ppc: don't byte swap ELFv2 signal handler
Previously, the signal handler would be byte swapped if the target and
host CPU used different endianness. This would cause a SIGSEGV when
attempting to translate the opcode pointed to by the swapped address.

 Thread 1 "qemu-ppc64" received signal SIGSEGV, Segmentation fault.
 0x00000000600a9257 in ldl_he_p (ptr=0x4c2c061000000000) at qemu/include/qemu/bswap.h:351
 351        __builtin_memcpy(&r, ptr, sizeof(r));

 #0  0x00000000600a9257 in ldl_he_p (ptr=0x4c2c061000000000) at qemu/include/qemu/bswap.h:351
 #1  0x00000000600a92fe in ldl_be_p (ptr=0x4c2c061000000000) at qemu/include/qemu/bswap.h:449
 #2  0x00000000600c0790 in translator_ldl_swap at qemu/include/exec/translator.h:201
 #3  0x000000006011c1ab in ppc_tr_translate_insn at qemu/target/ppc/translate.c:7856
 #4  0x000000006005ae70 in translator_loop at qemu/accel/tcg/translator.c:102

The signal handler will be byte swapped as a result of the __get_user()
call in sigaction() if it is necessary, no additional swap is required.

Signed-off-by: Vincent Fazio <vfazio@gmail.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20200319133244.8818-1-vfazio@xes-inc.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-03-24 11:56:37 +11:00
..
cpu_loop.c target/ppc: Implement the VTB for HV access 2019-12-17 10:39:48 +11:00
Makefile.objs linux-user, ppc: add syscall table generation support 2020-03-20 16:02:00 +01:00
signal.c target/ppc: don't byte swap ELFv2 signal handler 2020-03-24 11:56:37 +11:00
sockbits.h linux-user: move ppc socket.h definitions to ppc/sockbits.h 2018-05-25 10:10:55 +02:00
syscall.tbl linux-user: update syscall.tbl from linux 0bf999f9c5e7 2020-03-20 16:02:00 +01:00
syscallhdr.sh linux-user, ppc: add syscall table generation support 2020-03-20 16:02:00 +01:00
target_cpu.h linux-user: Introduce cpu_clone_regs_parent 2019-11-06 13:43:25 +01:00
target_elf.h linux-user: set default PPC64 CPU 2019-06-24 23:10:36 +02:00
target_fcntl.h linux-user: move ppc fcntl definitions to ppc/target_fcntl.h 2018-06-04 01:30:44 +02:00
target_signal.h linux-user: move generic signal definitions to generic/signal.h 2018-06-04 01:30:44 +02:00
target_structs.h linux-user: Clean up target_structs.h header guards 2016-07-12 16:19:16 +02:00
target_syscall.h linux-user: fix TARGET_NR_select 2016-09-22 07:24:21 +03:00
termbits.h Supply missing header guards 2019-06-12 13:20:21 +02:00