2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 22:05:36 +00:00

dump: update task registers if a signal is started handling

When we try to execute a parasite code, a signal can be started
handling, so we need to update a task registers, which will be saved in
a core file.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Andrey Vagin
2013-05-24 16:20:13 +04:00
committed by Pavel Emelyanov
parent 9b656a47d0
commit 0cda60e334
4 changed files with 12 additions and 6 deletions

View File

@@ -77,7 +77,8 @@ int syscall_seized(struct parasite_ctl *ctl, int nr, unsigned long *ret,
regs.ARM_r5 = arg6;
parasite_setup_regs(ctl->syscall_ip, 0, &regs);
err = __parasite_execute(ctl, ctl->pid.real, &regs);
err = __parasite_execute(ctl, ctl->pid.real, &regs,
&ctl->threads[0].regs_orig);
if (err)
return err;

View File

@@ -101,7 +101,8 @@ int syscall_seized(struct parasite_ctl *ctl, int nr, unsigned long *ret,
regs.r9 = arg6;
parasite_setup_regs(ctl->syscall_ip, 0, &regs);
err = __parasite_execute(ctl, ctl->pid.real, &regs);
err = __parasite_execute(ctl, ctl->pid.real, &regs,
&ctl->threads[0].regs_orig);
if (err)
return err;

View File

@@ -93,7 +93,9 @@ int syscall_seized(struct parasite_ctl *ctl, int nr, unsigned long *ret,
unsigned long arg5,
unsigned long arg6);
extern int __parasite_execute(struct parasite_ctl *ctl, pid_t pid, user_regs_struct_t *regs);
extern int __parasite_execute(struct parasite_ctl *ctl, pid_t pid,
user_regs_struct_t *regs,
user_regs_struct_t *regs_orig);
extern bool arch_can_dump_task(pid_t pid);
extern int parasite_fixup_vdso(struct parasite_ctl *ctl, pid_t pid,

View File

@@ -63,7 +63,9 @@ static struct vma_area *get_vma_by_ip(struct list_head *vma_area_list, unsigned
}
/* we run at @regs->ip */
int __parasite_execute(struct parasite_ctl *ctl, pid_t pid, user_regs_struct_t *regs)
int __parasite_execute(struct parasite_ctl *ctl, pid_t pid,
user_regs_struct_t *regs,
user_regs_struct_t *regs_orig)
{
siginfo_t siginfo;
int status;
@@ -171,7 +173,7 @@ retry_signal:
pr_perror("Can't obtain registers (pid: %d)", pid);
goto err;
}
ctl->threads[0].regs_orig = r;
*regs_orig = r;
}
goto again;
@@ -208,7 +210,7 @@ static int parasite_execute_by_id(unsigned int cmd, struct parasite_ctl *ctl, in
parasite_setup_regs(ctl->parasite_ip, thread->rstack, &regs);
ret = __parasite_execute(ctl, pid, &regs);
ret = __parasite_execute(ctl, pid, &regs, &thread->regs_orig);
if (ret == 0)
ret = (int)REG_RES(regs);