[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openvz-criu
Subject:    [CRIU] [PATCH] cr-restore: align the stack on 8-byte boundary
From:       gorcunov () openvz ! org (Cyrill Gorcunov)
Date:       2013-01-29 8:57:53
Message-ID: 20130129085753.GB1737 () moon
[Download RAW message or body]

On Tue, Jan 29, 2013 at 09:22:17AM +0400, Pavel Emelyanov wrote:
> On 01/27/2013 09:23 AM, Alexander Kartashov wrote:
> > The section 5.2.1.2 of the AAPCS says that the stack must be 8-byte aligned
> > and this rule is broken when the thread restore_task_with_children()
> > is forked by the function fork_with_pid() since the variable ca
> > and its field stack are likely to be 4-byte aligned.
> > 
> > This patch forces 8-byte alingment of the field cr_clone_arg::stack.
> > This made the following tests pass on ARM:
> > * static/shm,
> > * static/ipc_namespace.
> > 
> > Particulary the unaligned stack results in incorrect passing
> > of the 64-bit argument to the function snprintf() in the function
> > sysctl_write_u64().
> > 
> > Signed-off-by: Alexander Kartashov <alekskartashov at parallels.com>
> 
> Applied.
> 
> Keep me in To/Cc when sending criu patches. This will speed things up.

Hmm, while it's safe at moment to make the alignment being 8 (even
on x86-32 it will work fine) I would appreciate if we adding some
comments in code itself next time.

Actually what it needs is the __stack attribute which should be
configured depending on architecture type we're building crtools
on. That said, let it be as is I'll clean it up once finish with
make mess.

	Cyrill

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic