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

Re: [Xen-devel] [PATCH ARM v6 01/14] mini-os: x86_64: make thread stacks 16-byte aligned



Ian Campbell, le Thu 17 Jul 2014 16:50:25 +0100, a Ãcrit :
> On Wed, 2014-07-16 at 12:07 +0100, Thomas Leonard wrote:
> > Otherwise, passing doubles to varargs functions causes a crash.
> > 
> > Signed-off-by: Thomas Leonard <talex5@xxxxxxxxx>
> 
> > +    /* Must ensure that (%rsp + 8) is 16-byte aligned at the start of 
> > thread_starter. */
> 
> Is this really effectively a requirement for the stack to start out
> misaligned?

Yes. From the x86_64 ABI pdf I have here:

â
The end of the input argument area shall be aligned on a 16 byte boundary.
In other words, the value (%rsp - 8) is always a multiple of 16 when control is
transferred to the function entry point.
â

So the proposed comment is exactly the ABI requirement. Maybe it should
even say

/* x86_64 ABI requires that (%rsp + 8) is 16-byte aligned at the start of 
thread_starter. */

Samuel

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.