Commit 6aede7f1 authored by Vijaya Kumar K's avatar Vijaya Kumar K Committed by Pavel Emelyanov

zdtm: Align stack pointer for arm64

arm64 requires stack pointer to be aligned to 16 bytes.
Update all test cases that are using clone system call
to have 16 byte aligned stack pointer.
Signed-off-by: 's avatarVijaya Kumar K <vijayak@caviumnetworks.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent cda3a079
......@@ -143,7 +143,7 @@ static int prepare_namespaces(void)
/* All arguments should be above stack, because it grows down */
struct ns_exec_args {
char stack[NS_STACK_SIZE];
char stack[NS_STACK_SIZE] __attribute__((aligned (16)));
char stack_ptr[0];
int argc;
char **argv;
......
......@@ -48,7 +48,7 @@ static void wait_children()
static pid_t clone_child(int (*fn)(void *), int flags)
{
char stack[STACK_SIZE];
char stack[STACK_SIZE] __attribute__((aligned (16)));
pid_t pid;
pid = clone(fn, stack + STACK_SIZE,
......
......@@ -29,7 +29,7 @@ TEST_OPTION(dirname, string, "directory name", 1);
#define NS_STACK_SIZE 4096
/* All arguments should be above stack, because it grows down */
struct ns_exec_args {
char stack[NS_STACK_SIZE];
char stack[NS_STACK_SIZE] __attribute__((aligned (16)));
char stack_ptr[0];
int fd;
int sync;
......
......@@ -29,7 +29,7 @@ char fpath[PATH_MAX];
#define NS_STACK_SIZE 4096
/* All arguments should be above stack, because it grows down */
struct ns_exec_args {
char stack[NS_STACK_SIZE];
char stack[NS_STACK_SIZE] __attribute__((aligned (16)));
char stack_ptr[0];
int fd;
};
......
......@@ -22,7 +22,7 @@ static char buf[1024];
#define NS_STACK_SIZE 4096
/* All arguments should be above stack, because it grows down */
struct ns_exec_args {
char stack[NS_STACK_SIZE];
char stack[NS_STACK_SIZE] __attribute__((aligned (16)));
char stack_ptr[0];
int status_pipe[2];
};
......
......@@ -67,7 +67,7 @@ static void mainloop()
#define CLONE_STACK_SIZE 4096
/* All arguments should be above stack, because it grows down */
struct clone_args {
char stack[CLONE_STACK_SIZE];
char stack[CLONE_STACK_SIZE] __attribute__((aligned (16)));
char stack_ptr[0];
int id;
};
......
......@@ -109,7 +109,7 @@ static void mainloop()
#define CLONE_STACK_SIZE 4096
/* All arguments should be above stack, because it grows down */
struct clone_args {
char stack[CLONE_STACK_SIZE];
char stack[CLONE_STACK_SIZE] __attribute__((aligned (16)));
char stack_ptr[0];
int id;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment