mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 06:15:24 +00:00
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: Dmitry Safonov <dsafonov@virtuozzo.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
committed by
Andrei Vagin
parent
0d945c97c2
commit
dd3f23e28d
@@ -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;
|
||||
|
Reference in New Issue
Block a user