mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 06:15:24 +00:00
aarch64: Fix restore for multithreaded processes
The stack handling in the RUN_CLONE_RESTORE_FN macro for AArch64 was incorrect, resulting in a segfault of the restored process. With this change the pthread00 test case (and probably others) runs to completion and passes. Signed-off-by: Christopher Covington <cov@codeaurora.org> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
committed by
Pavel Emelyanov
parent
0c366dd887
commit
70f28122e5
@@ -51,8 +51,9 @@ struct rt_sigframe {
|
|||||||
thread_args, clone_restore_fn) \
|
thread_args, clone_restore_fn) \
|
||||||
asm volatile( \
|
asm volatile( \
|
||||||
"clone_emul: \n" \
|
"clone_emul: \n" \
|
||||||
"and x1, %2, #~15 \n" \
|
"ldr x1, %2 \n" \
|
||||||
"sub x1, x2, #16 \n" \
|
"and x1, x1, #~15 \n" \
|
||||||
|
"sub x1, x1, #16 \n" \
|
||||||
"stp %5, %6, [x1] \n" \
|
"stp %5, %6, [x1] \n" \
|
||||||
"mov x0, %1 \n" \
|
"mov x0, %1 \n" \
|
||||||
"mov x2, %3 \n" \
|
"mov x2, %3 \n" \
|
||||||
@@ -72,14 +73,13 @@ struct rt_sigframe {
|
|||||||
"clone_end: \n" \
|
"clone_end: \n" \
|
||||||
: "=r"(ret) \
|
: "=r"(ret) \
|
||||||
: "r"(clone_flags), \
|
: "r"(clone_flags), \
|
||||||
"r"(new_sp), \
|
"m"(new_sp), \
|
||||||
"r"(&parent_tid), \
|
"r"(&parent_tid), \
|
||||||
"r"(&thread_args[i].pid), \
|
"r"(&thread_args[i].pid), \
|
||||||
"r"(clone_restore_fn), \
|
"r"(clone_restore_fn), \
|
||||||
"r"(&thread_args[i]) \
|
"r"(&thread_args[i]) \
|
||||||
: "x0", "x1", "x2", "x3", "x8", "memory")
|
: "x0", "x1", "x2", "x3", "x8", "memory")
|
||||||
|
|
||||||
|
|
||||||
#define ARCH_FAIL_CORE_RESTORE \
|
#define ARCH_FAIL_CORE_RESTORE \
|
||||||
asm volatile( \
|
asm volatile( \
|
||||||
"mov sp, %0 \n" \
|
"mov sp, %0 \n" \
|
||||||
|
Reference in New Issue
Block a user