diff --git a/criu/arch/aarch64/include/asm/restorer.h b/criu/arch/aarch64/include/asm/restorer.h index 64a9c24eb..c35fd8baf 100644 --- a/criu/arch/aarch64/include/asm/restorer.h +++ b/criu/arch/aarch64/include/asm/restorer.h @@ -30,6 +30,15 @@ "b clone_end \n" \ \ "thread_run: \n" \ + "mov x8, #"__stringify(__NR_gettid)" \n" \ + "svc #0 \n" \ + "cmp x0, %7 \n" \ + "beq cont \n" \ + "mov x0, #2 \n" \ + "mov x8, #"__stringify(__NR_exit)" \n" \ + "svc #0 \n" \ + \ + "cont: \n" \ "ldp x1, x0, [sp] \n" \ "br x1 \n" \ \ @@ -40,7 +49,8 @@ "r"(&parent_tid), \ "r"(&thread_args[i].pid), \ "r"(clone_restore_fn), \ - "r"(&thread_args[i]) \ + "r"(&thread_args[i]), \ + "r"(thread_args[i].pid) \ : "x0", "x1", "x2", "x3", "x8", "memory") /* diff --git a/criu/arch/x86/include/asm/restorer.h b/criu/arch/x86/include/asm/restorer.h index 6cd48ebff..7e9086aa0 100644 --- a/criu/arch/x86/include/asm/restorer.h +++ b/criu/arch/x86/include/asm/restorer.h @@ -68,13 +68,13 @@ static inline int set_compat_robust_list(uint32_t head_ptr, uint32_t len) "thread_run: \n" \ "movl $"__stringify(__NR_gettid)", %%eax \n" \ "syscall \n" \ - "cmpq %%rax, %7 \n" \ - "je cont \n" \ - "mov $2, %%rdi \n" \ + "cmpq %%rax, %7 \n" \ + "je cont \n" \ + "mov $2, %%rdi \n" \ "movl $"__stringify(__NR_exit)", %%eax \n" \ "syscall \n" \ \ - "cont:\n" \ + "cont: \n" \ "xorq %%rbp, %%rbp \n" \ "movq 0(%%rsp), %%rax \n" \ "movq 8(%%rsp), %%rdi \n" \