[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 1/1] target/ppc: don't byte swap ELFv2 signal handler
From: |
Richard Henderson |
Subject: |
Re: [PATCH v2 1/1] target/ppc: don't byte swap ELFv2 signal handler |
Date: |
Wed, 18 Mar 2020 12:57:30 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 |
On 3/18/20 10:01 AM, Vincent Fazio wrote:
> From: Vincent Fazio <address@hidden>
>
> 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
>
> Now, no swap is performed and execution continues properly.
>
> Signed-off-by: Vincent Fazio <address@hidden>
> Reviewed-by: Laurent Vivier <address@hidden>
> ---
> Changes since v1:
> - Drop host/target endianness callouts
> - Drop unnecessary pointer cast
> - Clarify commit message
Reviewed-by: Richard Henderson <address@hidden>
r~