[CRIU] [PATCH 2/3] ia32: Rename has_compat_sigreturn => compat_cr
Dmitry Safonov
dsafonov at virtuozzo.com
Fri Apr 21 13:28:11 PDT 2017
This naming is left from the first compatible kernel patches.
At that time to return to 32-bit task rt_sigreturn was used with
a special flag.
Now it's not true anymore, the naming doesn't relate.
Signed-off-by: Dmitry Safonov <dsafonov at virtuozzo.com>
---
compel/arch/x86/src/lib/infect.c | 2 +-
compel/include/uapi/infect.h | 2 +-
criu/arch/aarch64/include/asm/restorer.h | 2 +-
criu/arch/arm/include/asm/restorer.h | 2 +-
criu/arch/ppc64/include/asm/restorer.h | 2 +-
criu/arch/x86/crtools.c | 2 +-
criu/arch/x86/include/asm/restorer.h | 2 +-
criu/cr-check.c | 2 +-
criu/include/kerndat.h | 2 +-
criu/kerndat.c | 4 ++--
criu/parasite-syscall.c | 4 ++--
criu/vdso.c | 2 +-
12 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/compel/arch/x86/src/lib/infect.c b/compel/arch/x86/src/lib/infect.c
index b64a55d97748..9c919e64ef13 100644
--- a/compel/arch/x86/src/lib/infect.c
+++ b/compel/arch/x86/src/lib/infect.c
@@ -406,7 +406,7 @@ bool arch_can_dump_task(struct parasite_ctl *ctl)
if (ret < 0)
return false;
- if (ret && !(ctl->ictx.flags & INFECT_HAS_COMPAT_SIGRETURN)) {
+ if (ret && !(ctl->ictx.flags & INFECT_COMPATIBLE)) {
pr_err("Can't dump task %d running in 32-bit mode\n", pid);
return false;
}
diff --git a/compel/include/uapi/infect.h b/compel/include/uapi/infect.h
index da0ca3a69e84..005d6bda64f2 100644
--- a/compel/include/uapi/infect.h
+++ b/compel/include/uapi/infect.h
@@ -123,7 +123,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
+#define INFECT_COMPATIBLE 0x8 /* can run parasite inside compat tasks */
/*
* There are several ways to describe a blob to compel
diff --git a/criu/arch/aarch64/include/asm/restorer.h b/criu/arch/aarch64/include/asm/restorer.h
index b5dd42e54319..60cd99fb5c35 100644
--- a/criu/arch/aarch64/include/asm/restorer.h
+++ b/criu/arch/aarch64/include/asm/restorer.h
@@ -52,7 +52,7 @@
: "sp", "x0", "memory")
-#define kdat_compat_sigreturn_test() 0
+#define kdat_compatible_cr() 0
int restore_gpregs(struct rt_sigframe *f, UserAarch64RegsEntry *r);
int restore_nonsigframe_gpregs(UserAarch64RegsEntry *r);
diff --git a/criu/arch/arm/include/asm/restorer.h b/criu/arch/arm/include/asm/restorer.h
index f7b963baec13..007260a3a11e 100644
--- a/criu/arch/arm/include/asm/restorer.h
+++ b/criu/arch/arm/include/asm/restorer.h
@@ -53,7 +53,7 @@
: "memory")
-#define kdat_compat_sigreturn_test() 0
+#define kdat_compatible_cr() 0
int restore_gpregs(struct rt_sigframe *f, UserArmRegsEntry *r);
int restore_nonsigframe_gpregs(UserArmRegsEntry *r);
diff --git a/criu/arch/ppc64/include/asm/restorer.h b/criu/arch/ppc64/include/asm/restorer.h
index c779a1869b5b..d16ec26ac081 100644
--- a/criu/arch/ppc64/include/asm/restorer.h
+++ b/criu/arch/ppc64/include/asm/restorer.h
@@ -48,7 +48,7 @@
"r"(&thread_args[i]) /* %6 */ \
: "memory","0","3","4","5","6","7","14","15")
-#define kdat_compat_sigreturn_test() 0
+#define kdat_compatible_cr() 0
int restore_gpregs(struct rt_sigframe *f, UserPpc64RegsEntry *r);
int restore_nonsigframe_gpregs(UserPpc64RegsEntry *r);
diff --git a/criu/arch/x86/crtools.c b/criu/arch/x86/crtools.c
index bce19aa6e758..d0121b48e308 100644
--- a/criu/arch/x86/crtools.c
+++ b/criu/arch/x86/crtools.c
@@ -26,7 +26,7 @@
#include "images/core.pb-c.h"
#include "images/creds.pb-c.h"
-int kdat_compat_sigreturn_test(void)
+int kdat_compatible_cr(void)
{
#ifdef CONFIG_COMPAT
unsigned long auxval;
diff --git a/criu/arch/x86/include/asm/restorer.h b/criu/arch/x86/include/asm/restorer.h
index e8a61962095c..acd7218f833b 100644
--- a/criu/arch/x86/include/asm/restorer.h
+++ b/criu/arch/x86/include/asm/restorer.h
@@ -69,7 +69,7 @@ arch_compat_rt_sigaction(void *stack, int sig, void *act) { return -1; }
# define ARCH_MAP_VDSO_32 0x2002
#endif
-extern int kdat_compat_sigreturn_test(void);
+extern int kdat_compatible_cr(void);
static inline void
__setup_sas_compat(struct ucontext_ia32* uc, ThreadSasEntry *sas)
diff --git a/criu/cr-check.c b/criu/cr-check.c
index 1a1cd80ebe0e..ec0020dba4fc 100644
--- a/criu/cr-check.c
+++ b/criu/cr-check.c
@@ -1059,7 +1059,7 @@ static int check_loginuid(void)
static int check_compat_cr(void)
{
#ifdef CONFIG_COMPAT
- if (kdat_compat_sigreturn_test())
+ if (kdat_compatible_cr())
return 0;
pr_warn("compat_cr is not supported. Requires kernel >= v4.9\n");
#else
diff --git a/criu/include/kerndat.h b/criu/include/kerndat.h
index 60c69c3e1978..c248a1b8f53e 100644
--- a/criu/include/kerndat.h
+++ b/criu/include/kerndat.h
@@ -34,7 +34,7 @@ struct kerndat_s {
unsigned long task_size;
bool ipv6;
bool has_loginuid;
- bool has_compat_sigreturn;
+ bool compat_cr;
bool sk_ns;
enum pagemap_func pmap;
unsigned int has_xtlocks;
diff --git a/criu/kerndat.c b/criu/kerndat.c
index 22dd1e8c4224..bf21cfa70ba8 100644
--- a/criu/kerndat.c
+++ b/criu/kerndat.c
@@ -581,11 +581,11 @@ int kerndat_nsid(void)
static int kerndat_compat_restore(void)
{
- int ret = kdat_compat_sigreturn_test();
+ int ret = kdat_compatible_cr();
if (ret < 0) /* failure */
return ret;
- kdat.has_compat_sigreturn = !!ret;
+ kdat.compat_cr = !!ret;
return 0;
}
diff --git a/criu/parasite-syscall.c b/criu/parasite-syscall.c
index 30b0a5ed49c1..93d790aacc85 100644
--- a/criu/parasite-syscall.c
+++ b/criu/parasite-syscall.c
@@ -515,8 +515,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;
+ if (kdat.compat_cr)
+ ictx->flags |= INFECT_COMPATIBLE;
ictx->log_fd = log_get_fd();
diff --git a/criu/vdso.c b/criu/vdso.c
index 8bc7b5d3b951..5f7cad4ed3b8 100644
--- a/criu/vdso.c
+++ b/criu/vdso.c
@@ -455,7 +455,7 @@ int vdso_init(void)
pr_err("Failed to fill self vdso symtable\n");
return -1;
}
- if (kdat.has_compat_sigreturn &&
+ if (kdat.compat_cr &&
vdso_fill_compat_symtable(&vdso_sym_rt, &vdso_compat_rt)) {
pr_err("Failed to fill compat vdso symtable\n");
return -1;
--
2.12.2
More information about the CRIU
mailing list