[CRIU] [PATCH 2/2] criu: arch,x86 -- Drop native ia32 pieces

Cyrill Gorcunov gorcunov at openvz.org
Fri Feb 10 03:18:33 PST 2017


Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 criu/arch/x86/crtools.c              | 17 -----------------
 criu/arch/x86/include/asm/parasite.h |  4 ----
 criu/arch/x86/include/asm/restore.h  |  9 ---------
 criu/arch/x86/include/asm/restorer.h | 27 +--------------------------
 criu/arch/x86/include/asm/types.h    |  4 ----
 criu/include/util-vdso.h             |  6 +++---
 6 files changed, 4 insertions(+), 63 deletions(-)

diff --git a/criu/arch/x86/crtools.c b/criu/arch/x86/crtools.c
index 0c3851adc43a..33f4048704ff 100644
--- a/criu/arch/x86/crtools.c
+++ b/criu/arch/x86/crtools.c
@@ -27,7 +27,6 @@
 #include "images/core.pb-c.h"
 #include "images/creds.pb-c.h"
 
-#ifdef CONFIG_X86_64
 int kdat_compat_sigreturn_test(void)
 {
 #ifdef CONFIG_COMPAT
@@ -50,7 +49,6 @@ int kdat_compat_sigreturn_test(void)
 #endif
 	return 0;
 }
-#endif /* CONFIG_X86_64 */
 
 int save_task_regs(void *x, user_regs_struct_t *regs, user_fpregs_struct_t *fpregs)
 {
@@ -370,11 +368,7 @@ int restore_fpu(struct rt_sigframe *sigframe, CoreEntry *core)
 	return 0;
 }
 
-#ifdef CONFIG_X86_64
 #define CPREG32(d)	f->compat.uc.uc_mcontext.d = r->d
-#else
-#define CPREG32(d)	f->uc.uc_mcontext.d = r->d
-#endif
 static void restore_compat_gpregs(struct rt_sigframe *f, UserX86RegsEntry *r)
 {
 	CPREG32(gs);
@@ -388,13 +382,10 @@ static void restore_compat_gpregs(struct rt_sigframe *f, UserX86RegsEntry *r)
 	CPREG32(ss);
 	CPREG32(flags);
 
-#ifdef CONFIG_X86_64
 	f->is_native = false;
-#endif
 }
 #undef CPREG32
 
-#ifdef CONFIG_X86_64
 #define CPREG64(d, s)	f->native.uc.uc_mcontext.d = r->s
 static void restore_native_gpregs(struct rt_sigframe *f, UserX86RegsEntry *r)
 {
@@ -440,11 +431,3 @@ int restore_gpregs(struct rt_sigframe *f, UserX86RegsEntry *r)
 	}
 	return 0;
 }
-#else /* !CONFIG_X86_64 */
-int restore_gpregs(struct rt_sigframe *f, UserX86RegsEntry *r)
-{
-	restore_compat_gpregs(f, r);
-	return 0;
-}
-#endif
-
diff --git a/criu/arch/x86/include/asm/parasite.h b/criu/arch/x86/include/asm/parasite.h
index 68fad095c745..0ef1d9a867bb 100644
--- a/criu/arch/x86/include/asm/parasite.h
+++ b/criu/arch/x86/include/asm/parasite.h
@@ -5,10 +5,6 @@
 #include <compel/plugins/std/syscall-codes.h>
 #include "asm/compat.h"
 
-#ifdef CONFIG_X86_32
-# define __parasite_entry __attribute__((regparm(3)))
-#endif
-
 static int arch_get_user_desc(user_desc_t *desc)
 {
 	int ret = __NR32_get_thread_area;
diff --git a/criu/arch/x86/include/asm/restore.h b/criu/arch/x86/include/asm/restore.h
index 7959e686b552..a3e7af92f771 100644
--- a/criu/arch/x86/include/asm/restore.h
+++ b/criu/arch/x86/include/asm/restore.h
@@ -5,7 +5,6 @@
 
 #include "images/core.pb-c.h"
 
-#ifdef CONFIG_X86_64
 #define JUMP_TO_RESTORER_BLOB(new_sp, restore_task_exec_start,		\
 			      task_args)				\
 	asm volatile(							\
@@ -19,14 +18,6 @@
 		       "g"(restore_task_exec_start),			\
 		       "g"(task_args)					\
 		     : "rsp", "rdi", "rsi", "rbx", "rax", "memory")
-#else /* CONFIG_X86_64 */
-#define JUMP_TO_RESTORER_BLOB(new_sp, restore_task_exec_start,		\
-			      task_args)				\
-	(void)new_sp;							\
-	(void)restore_task_exec_start;					\
-	(void)task_args;						\
-	;
-#endif /* CONFIG_X86_64 */
 
 static inline void core_get_tls(CoreEntry *pcore, tls_t *ptls)
 {
diff --git a/criu/arch/x86/include/asm/restorer.h b/criu/arch/x86/include/asm/restorer.h
index 2dc4fe1b7ffe..e8a61962095c 100644
--- a/criu/arch/x86/include/asm/restorer.h
+++ b/criu/arch/x86/include/asm/restorer.h
@@ -17,7 +17,7 @@ static inline void restore_tls(tls_t *ptls) { }
 static inline int
 arch_compat_rt_sigaction(void *stack, int sig, void *act) { return -1; }
 #endif /* !CONFIG_COMPAT */
-#ifdef CONFIG_X86_64
+
 #define RUN_CLONE_RESTORE_FN(ret, clone_flags, new_sp, parent_tid,      \
 			     thread_args, clone_restore_fn)             \
 	asm volatile(							\
@@ -70,27 +70,6 @@ arch_compat_rt_sigaction(void *stack, int sig, void *act) { return -1; }
 #endif
 
 extern int kdat_compat_sigreturn_test(void);
-#else /* CONFIG_X86_64 */
-#define RUN_CLONE_RESTORE_FN(ret, clone_flags, new_sp, parent_tid,      \
-			     thread_args, clone_restore_fn)             \
-	(void)ret;							\
-	(void)clone_flags;						\
-	(void)new_sp;							\
-	(void)parent_tid;						\
-	(void)thread_args;						\
-	(void)clone_restore_fn;						\
-	;
-#define ARCH_FAIL_CORE_RESTORE					\
-	asm volatile(						\
-		     "movl %0, %%esp			    \n"	\
-		     "xorl %%eax, %%eax			    \n"	\
-		     "jmp *%%eax			    \n"	\
-		     :						\
-		     : "r"(ret)					\
-		     : "memory")
-
-#define kdat_compat_sigreturn_test()			0
-#endif /* CONFIG_X86_64 */
 
 static inline void
 __setup_sas_compat(struct ucontext_ia32* uc, ThreadSasEntry *sas)
@@ -103,7 +82,6 @@ __setup_sas_compat(struct ucontext_ia32* uc, ThreadSasEntry *sas)
 static inline void
 __setup_sas(struct rt_sigframe* sigframe, ThreadSasEntry *sas)
 {
-#ifdef CONFIG_X86_64
 	if (sigframe->is_native) {
 		struct rt_ucontext *uc	= &sigframe->native.uc;
 
@@ -113,9 +91,6 @@ __setup_sas(struct rt_sigframe* sigframe, ThreadSasEntry *sas)
 	} else {
 		__setup_sas_compat(&sigframe->compat.uc, sas);
 	}
-#else
-	__setup_sas_compat(&sigframe->uc, sas);
-#endif
 }
 
 static inline void _setup_sas(struct rt_sigframe* sigframe, ThreadSasEntry *sas)
diff --git a/criu/arch/x86/include/asm/types.h b/criu/arch/x86/include/asm/types.h
index 4a93ffdeb746..3ff7fc630a63 100644
--- a/criu/arch/x86/include/asm/types.h
+++ b/criu/arch/x86/include/asm/types.h
@@ -12,7 +12,6 @@
 
 #include "images/core.pb-c.h"
 
-#ifdef CONFIG_X86_64
 static inline int core_is_compat(CoreEntry *c)
 {
 	switch (c->thread_info->gpregs->mode) {
@@ -24,9 +23,6 @@ static inline int core_is_compat(CoreEntry *c)
 			return -1;
 	}
 }
-#else /* CONFIG_X86_64 */
-static inline int core_is_compat(CoreEntry *c) { return 0; }
-#endif /* CONFIG_X86_64 */
 
 #define CORE_ENTRY__MARCH CORE_ENTRY__MARCH__X86_64
 
diff --git a/criu/include/util-vdso.h b/criu/include/util-vdso.h
index 642cee737ec5..ad4a48eb227d 100644
--- a/criu/include/util-vdso.h
+++ b/criu/include/util-vdso.h
@@ -49,7 +49,7 @@ struct vdso_symtable {
 			},						\
 	}
 
-#if defined(CONFIG_X86_32) || defined(CONFIG_VDSO_32)
+#ifdef CONFIG_VDSO_32
 
 #define Ehdr_t		Elf32_Ehdr
 #define Sym_t		Elf32_Sym
@@ -60,7 +60,7 @@ struct vdso_symtable {
 #define ELF_ST_TYPE	ELF32_ST_TYPE
 #define ELF_ST_BIND	ELF32_ST_BIND
 
-#else /* !CONFIG_X86_32 */
+#else /* CONFIG_VDSO_32 */
 
 #define Ehdr_t		Elf64_Ehdr
 #define Sym_t		Elf64_Sym
@@ -75,7 +75,7 @@ struct vdso_symtable {
 #define ELF_ST_BIND	ELF64_ST_BIND
 #endif
 
-#endif /* !CONFIG_X86_32 */
+#endif /* CONFIG_VDSO_32 */
 
 /* Size of VMA associated with vdso */
 static inline unsigned long vdso_vma_size(struct vdso_symtable *t)
-- 
2.7.4



More information about the CRIU mailing list