[CRIU] [PATCH 1/2] cr-restore: prepare removing arch_export_unmap_compat for !CONFIG_COMPAT
Dmitry Safonov
dsafonov at virtuozzo.com
Fri Apr 28 11:30:46 PDT 2017
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 at virtuozzo.com>
---
criu/cr-restore.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/criu/cr-restore.c b/criu/cr-restore.c
index 0c9f42bd81b8..c71e43f8f0b3 100644
--- a/criu/cr-restore.c
+++ b/criu/cr-restore.c
@@ -3021,6 +3021,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;
@@ -3131,12 +3140,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;
--
2.12.2
More information about the CRIU
mailing list