[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 04/15] linux-user/elfload.c: Don't use _raw acce
From: |
Alex Bennée |
Subject: |
Re: [Qemu-devel] [PATCH 04/15] linux-user/elfload.c: Don't use _raw accessor functions |
Date: |
Thu, 15 Jan 2015 15:56:05 +0000 |
Peter Maydell <address@hidden> writes:
> The _raw accessor functions are an implementation detail that has
> leaked out to some callsites. Use get_user_u64() instead of ldq_raw().
>
> Signed-off-by: Peter Maydell <address@hidden>
Reviewed-by: Alex Bennée <address@hidden>
> ---
> linux-user/elfload.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/linux-user/elfload.c b/linux-user/elfload.c
> index e2596a4..399c021 100644
> --- a/linux-user/elfload.c
> +++ b/linux-user/elfload.c
> @@ -829,8 +829,11 @@ static inline void init_thread(struct target_pt_regs
> *_regs, struct image_info *
> _regs->gpr[1] = infop->start_stack;
> #if defined(TARGET_PPC64) && !defined(TARGET_ABI32)
> if (get_ppc64_abi(infop) < 2) {
> - _regs->gpr[2] = ldq_raw(infop->entry + 8) + infop->load_bias;
> - infop->entry = ldq_raw(infop->entry) + infop->load_bias;
> + uint64_t val;
> + get_user_u64(val, infop->entry + 8);
> + _regs->gpr[2] = val + infop->load_bias;
> + get_user_u64(val, infop->entry);
> + infop->entry = val + infop->load_bias;
> } else {
> _regs->gpr[12] = infop->entry; /* r12 set to global entry address */
> }
--
Alex Bennée
- [Qemu-devel] [PATCH 08/15] target-mips: Don't use _raw load/store accessors, (continued)
- [Qemu-devel] [PATCH 08/15] target-mips: Don't use _raw load/store accessors, Peter Maydell, 2015/01/15
- [Qemu-devel] [PATCH 09/15] cpu_ldst.h: Drop unused ld/st*_kernel defines, Peter Maydell, 2015/01/15
- [Qemu-devel] [PATCH 15/15] cpu_ldst.h, cpu-all.h, bswap.h: Update documentation on ld/st accessors, Peter Maydell, 2015/01/15
- [Qemu-devel] [PATCH 07/15] linux-user/main.c (m68k): Use get_user_u16 rather than lduw in cpu_loop, Peter Maydell, 2015/01/15
- [Qemu-devel] [PATCH 05/15] bsd-user/elfload.c: Don't use ldl() or ldq_raw(), Peter Maydell, 2015/01/15
- [Qemu-devel] [PATCH 02/15] monitor.c: Use ld*_p() instead of ld*_raw(), Peter Maydell, 2015/01/15
- [Qemu-devel] [PATCH 04/15] linux-user/elfload.c: Don't use _raw accessor functions, Peter Maydell, 2015/01/15
- Re: [Qemu-devel] [PATCH 04/15] linux-user/elfload.c: Don't use _raw accessor functions,
Alex Bennée <=
- Re: [Qemu-devel] [PATCH 00/15] Clean up cpu-ldst ld/st memory accessors, Lluís Vilanova, 2015/01/15
- Re: [Qemu-devel] [PATCH 00/15] Clean up cpu-ldst ld/st memory accessors, Richard Henderson, 2015/01/16