[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 06/10] elfload: only give abi_long/ulong the
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH v2 06/10] elfload: only give abi_long/ulong the alignment specified by the target |
Date: |
Thu, 04 Apr 2013 16:11:01 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4 |
Il 04/04/2013 16:09, Peter Maydell ha scritto:
> Agreed in principle, but you seem to have missed some structs
> which use target_ulong currently and which presumably should
> use abi_ulong instead, eg all the target_ucontext etc structs
> in linux-user/signal.c
Right.
> Also linux-user/elfload.c:symfind() is casting a pointer to
> target_ulong* and dereferencing it, and that might now cause
> an alignment fault on some host CPUs if the host CPU alignment
> requirements are stricter than the guest's.
I had seen this, but it is only used with bsearch and safe:
static const char *lookup_symbolxx(struct syminfo *s, target_ulong orig_addr)
{
#if ELF_CLASS == ELFCLASS32
struct elf_sym *syms = s->disas_symtab.elf32;
#else
struct elf_sym *syms = s->disas_symtab.elf64;
#endif
// binary search
struct elf_sym *sym;
sym = bsearch(&orig_addr, syms, s->disas_num_syms, sizeof(*syms), symfind);
...
}
Paolo
- [Qemu-devel] [PATCH v2 00/10] TARGET_*_ALIGNMENT cleanup, and config-target.mak trimming, Paolo Bonzini, 2013/04/03
- [Qemu-devel] [PATCH v2 01/10] elfload: fix size of ABI-dependent fields in core dumps, Paolo Bonzini, 2013/04/03
- [Qemu-devel] [PATCH v2 02/10] elfload: fix size of registers for N32, Paolo Bonzini, 2013/04/03
- [Qemu-devel] [PATCH v2 03/10] elfload: use tswapreg consistently in elf_core_copy_regs, Paolo Bonzini, 2013/04/03
- [Qemu-devel] [PATCH v2 04/10] elfload: use abi_short/ushort instead of target_short/ushort, Paolo Bonzini, 2013/04/03
- [Qemu-devel] [PATCH v2 06/10] elfload: only give abi_long/ulong the alignment specified by the target, Paolo Bonzini, 2013/04/03
- Re: [Qemu-devel] [PATCH v2 06/10] elfload: only give abi_long/ulong the alignment specified by the target, Peter Maydell, 2013/04/04
- Re: [Qemu-devel] [PATCH v2 06/10] elfload: only give abi_long/ulong the alignment specified by the target,
Paolo Bonzini <=
- Re: [Qemu-devel] [PATCH v2 06/10] elfload: only give abi_long/ulong the alignment specified by the target, Peter Maydell, 2013/04/04
- Re: [Qemu-devel] [PATCH v2 06/10] elfload: only give abi_long/ulong the alignment specified by the target, Paolo Bonzini, 2013/04/04
- Re: [Qemu-devel] [PATCH v2 06/10] elfload: only give abi_long/ulong the alignment specified by the target, Peter Maydell, 2013/04/04
- Re: [Qemu-devel] [PATCH v2 06/10] elfload: only give abi_long/ulong the alignment specified by the target, Paolo Bonzini, 2013/04/04
- Re: [Qemu-devel] [PATCH v2 06/10] elfload: only give abi_long/ulong the alignment specified by the target, Peter Maydell, 2013/04/04
[Qemu-devel] [PATCH v2 07/10] elfload: use abi_llong/ullong instead of target_llong/ullong, Paolo Bonzini, 2013/04/03
[Qemu-devel] [PATCH v2 08/10] configure: move CONFIG_QEMU_LDST_OPTIMIZATION to config-host.mak, Paolo Bonzini, 2013/04/03
[Qemu-devel] [PATCH v2 05/10] elfload: use abi_int/uint instead of target_int/uint, Paolo Bonzini, 2013/04/03