[CRIU] [PATCH 62/78] infect x86: Remove kdat

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


From: Pavel Emelyanov <xemul at virtuozzo.com>

The kdat is used to check whether we have compat sigreturn
in the kernel. Compel can check it himself, but criu already
knows this.

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

diff --git a/criu/arch/x86/infect.c b/criu/arch/x86/infect.c
index 31c8ef49cc29..c0e848054904 100644
--- a/criu/arch/x86/infect.c
+++ b/criu/arch/x86/infect.c
@@ -8,7 +8,6 @@
 #include <compel/asm/fpu.h>
 
 #include "asm/cpu.h"
-#include "kerndat.h"
 
 #include <compel/asm/processor-flags.h>
 #include <compel/cpu.h>
@@ -236,7 +235,7 @@ bool arch_can_dump_task(struct parasite_ctl *ctl)
 	if (ret < 0)
 		return false;
 
-	if (ret && !kdat.has_compat_sigreturn) {
+	if (ret && !(ctl->ictx.flags & INFECT_HAS_COMPAT_SIGRETURN)) {
 		pr_err("Can't dump task %d running in 32-bit mode\n", pid);
 		return false;
 	}
diff --git a/criu/include/infect.h b/criu/include/infect.h
index 2db90e6183c8..c0f31d16b81f 100644
--- a/criu/include/infect.h
+++ b/criu/include/infect.h
@@ -115,6 +115,7 @@ extern struct infect_ctx *compel_infect_ctx(struct parasite_ctl *);
 #define INFECT_NO_MEMFD		0x1	/* don't use memfd() */
 #define INFECT_FAIL_CONNECT	0x2	/* make parasite connect() fail */
 #define INFECT_NO_BREAKPOINTS	0x4	/* no breakpoints in pie tracking */
+#define INFECT_HAS_COMPAT_SIGRETURN 0x8
 
 typedef int (*save_regs_t)(void *, user_regs_struct_t *, user_fpregs_struct_t *);
 extern int compel_get_task_regs(pid_t pid, user_regs_struct_t regs, save_regs_t, void *);
diff --git a/criu/parasite-syscall.c b/criu/parasite-syscall.c
index 970ab45cafa6..3b9d2a625ef1 100644
--- a/criu/parasite-syscall.c
+++ b/criu/parasite-syscall.c
@@ -558,6 +558,8 @@ struct parasite_ctl *parasite_infect_seized(pid_t pid, struct pstree_item *item,
 		ictx->flags |= INFECT_FAIL_CONNECT;
 	if (fault_injected(FI_NO_BREAKPOINTS))
 		ictx->flags |= INFECT_NO_BREAKPOINTS;
+	if (kdat.has_compat_sigreturn)
+		ictx->flags |= INFECT_HAS_COMPAT_SIGRETURN;
 
 	parasite_ensure_args_size(dump_pages_args_size(vma_area_list));
 	parasite_ensure_args_size(aio_rings_args_size(vma_area_list));
-- 
2.7.4



More information about the CRIU mailing list