Commit b5dfd452 authored by Pavel Emelyanov's avatar Pavel Emelyanov

dump: Be more specific about inability to dump 32bit tasks on x86

Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent f95d509d
......@@ -46,12 +46,12 @@ void parasite_setup_regs(unsigned long new_ip, user_regs_struct_t *regs)
regs->ARM_cpsr &= PSR_f | PSR_s | PSR_x | PSR_T_BIT | MODE32_BIT;
}
int task_in_compat_mode(pid_t pid)
bool arch_can_dump_task(pid_t pid)
{
/*
* TODO: Add proper check here
*/
return 0;
return true;
}
int syscall_seized(struct parasite_ctl *ctl, int nr, unsigned long *ret,
......
......@@ -46,7 +46,7 @@ void parasite_setup_regs(unsigned long new_ip, user_regs_struct_t *regs)
regs->flags &= ~(X86_EFLAGS_TF | X86_EFLAGS_DF | X86_EFLAGS_IF);
}
int task_in_compat_mode(pid_t pid)
static int task_in_compat_mode(pid_t pid)
{
unsigned long cs, ds;
......@@ -68,6 +68,16 @@ int task_in_compat_mode(pid_t pid)
return cs != 0x33 || ds == 0x2b;
}
bool arch_can_dump_task(pid_t pid)
{
if (task_in_compat_mode(pid)) {
pr_err("Can't dump task %d running in 32-bit mode\n", pid);
return false;
}
return true;
}
int syscall_seized(struct parasite_ctl *ctl, int nr, unsigned long *ret,
unsigned long arg1,
unsigned long arg2,
......
......@@ -74,6 +74,6 @@ int syscall_seized(struct parasite_ctl *ctl, int nr, unsigned long *ret,
unsigned long arg6);
extern int __parasite_execute(struct parasite_ctl *ctl, pid_t pid, user_regs_struct_t *regs);
extern int task_in_compat_mode(pid_t pid);
extern bool arch_can_dump_task(pid_t pid);
#endif /* __CR_PARASITE_SYSCALL_H__ */
......@@ -767,10 +767,8 @@ struct parasite_ctl *parasite_prep_ctl(pid_t pid, struct vm_area_list *vma_area_
struct parasite_ctl *ctl = NULL;
struct vma_area *vma_area;
if (task_in_compat_mode(pid)) {
pr_err("Can't checkpoint task running in compat mode\n");
if (!arch_can_dump_task(pid))
goto err;
}
/*
* Control block early setup.
......
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