[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:45:40 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4 |
Il 04/04/2013 16:37, Peter Maydell ha scritto:
>> Regarding the others, none of them are in target-generic places, and
>> > none of them affect m68k (ARM only uses non-standard alignment for llong):
>> >
>> > - linux-user/mips64/syscall.h is correct with target_ulong, and in
>> > general MIPS is best left as it is (it often uses uint32_t/uint64_t or
>> > target_long/ulong explicitly so that n32 is handled correctly).
> Hmm, is this really right? target_ulong before this patch would
> have had an explicit alignment attribute, and it no longer does.
> So if you're running a mips64 guest on an m68k host then you'll
> now get structs with the natural m68k alignment rather than the
> desired mips64 alignment...
Note that target_ulong and abi_ulong would have different sizes. Better
to get alignment wrong on m68k, than size wrong on all platforms. :)
Also I think this should not be a problem. These structures have no
holes in them, the padding is always written down explicitly and they
are accessed (or should be) via copy_from/to_user.
> (I can entirely believe that we get this wrong in a lot of
> places, and that in theory just about anything in a target_
> struct needs an alignment specifier.)
Yes, or more simply just use abi_* types. It doesn't help that
potential problems would only show up on m68k.
Paolo
- [Qemu-devel] [PATCH v2 02/10] elfload: fix size of registers for N32, (continued)
- [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, 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
- 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
[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
[Qemu-devel] [PATCH v2 09/10] configure: move common libraries to config-host.mak, Paolo Bonzini, 2013/04/03