Commit 58c1309a authored by Dmitry Safonov's avatar Dmitry Safonov Committed by Andrei Vagin

ia32: Rename has_compat_sigreturn => compat_cr

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: 's avatarDmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent 2c425ed6
......@@ -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;
}
......
......@@ -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
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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;
......
......@@ -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)
......
......@@ -1058,7 +1058,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
......
......@@ -33,7 +33,7 @@ struct kerndat_s {
unsigned long task_size;
bool ipv6;
bool has_loginuid;
bool has_compat_sigreturn;
bool compat_cr;
enum pagemap_func pmap;
unsigned int has_xtlocks;
unsigned long mmap_min_addr;
......
......@@ -557,11 +557,11 @@ err:
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;
}
......
......@@ -503,8 +503,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();
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment