qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] target-arm: fix ARMv7M stack alignment on reset


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH] target-arm: fix ARMv7M stack alignment on reset
Date: Wed, 4 Sep 2013 10:42:32 +0100

On 4 September 2013 10:23, Sebastian Ottlik <address@hidden> wrote:
> When the initial SP is loaded from the vector table on ARMv7M systems the two
> least significant bits are ignored as the stack is always aligned at a four 
> byte
> boundary (see ARM DDI 0403C, B1.4.1 and B1.5.5). So far QEMU did not ignore
> these bits leading to a stack alignment inconsitent with real hardware for
> binaries that rely on this behaviour. This patch fixes this issue by masking 
> the
> two least significant bits when loading the SP.

Yes, the pseudocode in the v7M ARM ARM is clear that the low two
bits are masked when loading SP from the vector table. Thanks for
the patch, I'll apply it to my ARM tree.

Reviewed-by: Peter Maydell <address@hidden>

PS: there is a newer version of the v7M ARMARM, DDI0403D. I'd
strongly encourage you to get a copy of this rather than continuing
to use the rev C as a reference (it's on the ARM infocenter; you'll
need to register on the website if you haven't already but that's
a simple 'fill in the form' process):
http://infocenter.arm.com/help/topic/com.arm.doc.ddi0403c/index.html
Rev D extensively clarifies and reorganizes the text, as well as
documenting the FP extensions.

-- PMM



reply via email to

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