Skip to content

Commit

Permalink
Port unprivileged restore to aarch64
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonKozlov committed Aug 10, 2023
1 parent 6db6025 commit d62b80e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
12 changes: 11 additions & 1 deletion criu/arch/aarch64/include/asm/restorer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
\
Expand All @@ -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")

/*
Expand Down
8 changes: 4 additions & 4 deletions criu/arch/x86/include/asm/restorer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
Expand Down

0 comments on commit d62b80e

Please sign in to comment.