[CRIU] [PATCH 63/78] infect arm & aarch64: Remove kdat

Cyrill Gorcunov gorcunov at openvz.org
Mon Nov 7 08:36:48 PST 2016


From: Pavel Emelyanov <xemul at virtuozzo.com>

In these gents the task_size should be known.

Signed-off-by: Pavel Emelyanov <xemul at virtuozzo.com>
---
 criu/arch/aarch64/infect.c | 1 -
 criu/arch/arm/infect.c     | 3 +--
 criu/include/infect.h      | 1 +
 criu/parasite-syscall.c    | 1 +
 4 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/criu/arch/aarch64/infect.c b/criu/arch/aarch64/infect.c
index 3a9cb10cd229..aeb73478179e 100644
--- a/criu/arch/aarch64/infect.c
+++ b/criu/arch/aarch64/infect.c
@@ -6,7 +6,6 @@
 #include <compel/plugins/std/syscall-codes.h>
 #include "asm/types.h"
 #include "criu-log.h"
-#include "kerndat.h"
 #include "parasite-syscall.h"
 #include "compel/include/errno.h"
 #include "infect.h"
diff --git a/criu/arch/arm/infect.c b/criu/arch/arm/infect.c
index 6fe6142be2de..b22e98d9c779 100644
--- a/criu/arch/arm/infect.c
+++ b/criu/arch/arm/infect.c
@@ -5,7 +5,6 @@
 #include <compel/asm/processor-flags.h>
 #include "asm/types.h"
 #include "criu-log.h"
-#include "kerndat.h"
 #include "parasite-syscall.h"
 #include "compel/include/errno.h"
 #include "infect.h"
@@ -100,7 +99,7 @@ void *remote_mmap(struct parasite_ctl *ctl,
 
 	err = compel_syscall(ctl, __NR_mmap2, &map,
 			(unsigned long)addr, length, prot, flags, fd, offset >> 12);
-	if (err < 0 || map > kdat.task_size)
+	if (err < 0 || map > ctl->ictx.task_size)
 		map = 0;
 
 	return (void *)map;
diff --git a/criu/include/infect.h b/criu/include/infect.h
index c0f31d16b81f..fc4f949f9e77 100644
--- a/criu/include/infect.h
+++ b/criu/include/infect.h
@@ -102,6 +102,7 @@ struct infect_ctx {
 	int (*make_sigframe)(void *, struct rt_sigframe *, struct rt_sigframe *, k_rtsigset_t *);
 	void *regs_arg;
 
+	unsigned long		task_size;
 	unsigned long		syscall_ip;				/* entry point of infection */
 	unsigned long		flags;			/* fine-tune (e.g. faults) */
 
diff --git a/criu/parasite-syscall.c b/criu/parasite-syscall.c
index 3b9d2a625ef1..1821efd85fc5 100644
--- a/criu/parasite-syscall.c
+++ b/criu/parasite-syscall.c
@@ -549,6 +549,7 @@ struct parasite_ctl *parasite_infect_seized(pid_t pid, struct pstree_item *item,
 	ictx->save_regs = save_task_regs;
 	ictx->make_sigframe = make_sigframe;
 	ictx->regs_arg = item->core[0];
+	ictx->task_size = kdat.task_size;
 	ictx->syscall_ip = p;
 	pr_debug("Parasite syscall_ip at %#lx\n", p);
 
-- 
2.7.4



More information about the CRIU mailing list