qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/5] configure: move TARGET_*_ALIGNMENT to targe


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH 1/5] configure: move TARGET_*_ALIGNMENT to target-*/cpu.h
Date: Tue, 2 Apr 2013 18:17:39 +0100

On 2 April 2013 17:56, Paolo Bonzini <address@hidden> wrote:
> Il 02/04/2013 18:43, Peter Maydell ha scritto:
>> Doesn't this incorrectly set the long alignment to 8
>> for ppc64abi32? (Probably similar problem for
>> sparc32plus and mipsn32. The underlying point here is that
>> alignment is an ABI decision and you can have more than one
>> ABI for a particular TARGET_FOO.)
>
> Hmm, seems like you're right _but_ I am not sure if the *current* code
> is correct.  On real hardware, the CPUs are certainly not able to do
> unaligned 32-bit accesses, and target_long/target_ulong pointers look
> like they're never used for data that comes from target memory.

Did you check linux-user too? I'm pretty sure we have structs
and so on that mirror target memory and use target_ulong.

> What these targets want to have 32-bit alignment is really
> abi_long/abi_ulong, and that's already okay. Alex, Blue, Aurelien,
> can you test the above three targets?

Mmm, rather than speculating we should just confirm what gcc
thinks the alignment of void* should be on these targets
(since "a thing the size of a pointer" is what target_long/ulong
represent, I think.)


That said, we should keep bugfixes and cleanup patches separated,
so on approach for proceeding with these cleanup patches is just
to define TARGET_LONG_ALIGNMENT based on TARGET_ABI32 or whatever is
appropriate for each target CPU. Then we retain the same behaviour.

-- PMM



reply via email to

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