Commit da17b223 authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by Andrei Vagin

parasite: Do not get task regs twice on start

First time regs are saved on ctl->orig.regs in parasite_prep_ctl,
the 2nd time regs are got inside x86/arch_task_compatible, while
it can use the on-ctl copy.

travis-ci: success for Don't get task regs twice
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
Reviewed-by: 's avatarDmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent 44c15c6c
...@@ -95,16 +95,9 @@ int kdat_compat_sigreturn_test(void) ...@@ -95,16 +95,9 @@ int kdat_compat_sigreturn_test(void)
} }
#endif /* CONFIG_X86_64 */ #endif /* CONFIG_X86_64 */
int ptrace_get_regs(pid_t pid, user_regs_struct_t *regs); static int arch_task_compatible(struct parasite_ctl *ctl)
static int arch_task_compatible(pid_t pid)
{ {
user_regs_struct_t r; return !user_regs_native(&ctl->orig.regs);
int ret = ptrace_get_regs(pid, &r);
if (ret)
return -1;
return !user_regs_native(&r);
} }
#define USER32_CS 0x23 #define USER32_CS 0x23
...@@ -133,7 +126,7 @@ bool arch_can_dump_task(struct parasite_ctl *ctl) ...@@ -133,7 +126,7 @@ bool arch_can_dump_task(struct parasite_ctl *ctl)
pid_t pid = ctl->rpid; pid_t pid = ctl->rpid;
int ret; int ret;
ret = arch_task_compatible(pid); ret = arch_task_compatible(ctl);
if (ret < 0) if (ret < 0)
return false; return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment