Commit dd3f23e2 authored by Dmitry Safonov's avatar Dmitry Safonov Committed by Andrei Vagin

cr-restore: prepare removing arch_export_unmap_compat for !CONFIG_COMPAT

We don't need __export_unmap_compat() for !CONFIG_COMPAT in restorer
blob. This preparation will allow to move compatible unmap that's
written in x86 asm from generic restorer blob to arch/x86.
Signed-off-by: 's avatarDmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent 0d945c97
......@@ -2931,6 +2931,15 @@ static int rst_prep_creds(pid_t pid, CoreEntry *core, unsigned long *creds_pos)
return 0;
}
static void *restorer_munmap_addr(CoreEntry *core, void *restorer_blob)
{
#ifdef CONFIG_COMPAT
if (core_is_compat(core))
return restorer_sym(restorer_blob, arch_export_unmap_compat);
#endif
return restorer_sym(restorer_blob, arch_export_unmap);
}
static int sigreturn_restore(pid_t pid, struct task_restore_args *task_args, unsigned long alen, CoreEntry *core)
{
void *mem = MAP_FAILED;
......@@ -3036,12 +3045,7 @@ static int sigreturn_restore(pid_t pid, struct task_restore_args *task_args, uns
*/
task_args->clone_restore_fn = restorer_sym(mem, arch_export_restore_thread);
restore_task_exec_start = restorer_sym(mem, arch_export_restore_task);
if (core_is_compat(core))
rsti(current)->munmap_restorer =
restorer_sym(mem, arch_export_unmap_compat);
else
rsti(current)->munmap_restorer =
restorer_sym(mem, arch_export_unmap);
rsti(current)->munmap_restorer = restorer_munmap_addr(core, mem);
task_args->bootstrap_start = mem;
mem += restorer_len;
......
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