[CRIU] [PATCH 4/4] zdtm: Align stack pointer for arm64

Vijaya Kumar K Vijaya.Kumar at caviumnetworks.com
Mon Dec 28 00:09:42 PST 2015


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: Vijaya Kumar K <vijayak at caviumnetworks.com>
---
 test/zdtm/lib/ns.c                       |    2 +-
 test/zdtm/live/static/fdt_shared.c       |    2 +-
 test/zdtm/live/static/mntns_link_remap.c |    2 +-
 test/zdtm/live/static/mntns_open.c       |    2 +-
 test/zdtm/live/static/mountpoints.c      |    2 +-
 test/zdtm/live/static/session02.c        |    2 +-
 test/zdtm/live/static/session03.c        |    2 +-
 7 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/test/zdtm/lib/ns.c b/test/zdtm/lib/ns.c
index 6e44342..8d7e7af 100644
--- a/test/zdtm/lib/ns.c
+++ b/test/zdtm/lib/ns.c
@@ -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;
diff --git a/test/zdtm/live/static/fdt_shared.c b/test/zdtm/live/static/fdt_shared.c
index e31191f..605bb6d 100644
--- a/test/zdtm/live/static/fdt_shared.c
+++ b/test/zdtm/live/static/fdt_shared.c
@@ -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,
diff --git a/test/zdtm/live/static/mntns_link_remap.c b/test/zdtm/live/static/mntns_link_remap.c
index d8e1fb9..6d62920 100644
--- a/test/zdtm/live/static/mntns_link_remap.c
+++ b/test/zdtm/live/static/mntns_link_remap.c
@@ -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;
diff --git a/test/zdtm/live/static/mntns_open.c b/test/zdtm/live/static/mntns_open.c
index 3ddfa76..2f91801 100644
--- a/test/zdtm/live/static/mntns_open.c
+++ b/test/zdtm/live/static/mntns_open.c
@@ -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;
 };
diff --git a/test/zdtm/live/static/mountpoints.c b/test/zdtm/live/static/mountpoints.c
index c1857a0..7ad5c92 100644
--- a/test/zdtm/live/static/mountpoints.c
+++ b/test/zdtm/live/static/mountpoints.c
@@ -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];
 };
diff --git a/test/zdtm/live/static/session02.c b/test/zdtm/live/static/session02.c
index 02d29f9..c4c3922 100644
--- a/test/zdtm/live/static/session02.c
+++ b/test/zdtm/live/static/session02.c
@@ -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;
 };
diff --git a/test/zdtm/live/static/session03.c b/test/zdtm/live/static/session03.c
index f10e1ef..a8e14b1 100644
--- a/test/zdtm/live/static/session03.c
+++ b/test/zdtm/live/static/session03.c
@@ -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;
 };
-- 
1.7.9.5



More information about the CRIU mailing list