qemu-devel
[Top][All Lists]
Advanced

[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:26:39 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4

Il 04/04/2013 16:18, Peter Maydell ha scritto:
>>> 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
> Ah yes, you're right. Sorry.

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).

- linux-user/openrisc/syscall.h could use abi_ulong instead of
target_ulong, and abi_uint instead of uint32_t, but it doesn't change
anything so it is more of a cleanup

- linux-user/syscall_defs.h's use of target_ulong for st_ino would be a
bug, but on these architectures target_ulong==abi_ulong.  In general the
whole struct should be using abi_* types, but again it is more of a cleanup.

So the patch is okay as is, I think.

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]