Commit 528106a5 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

vdso: Mark runtime vdso if proxy needed

In case if we need vdso proxy there is a need
to recognize it somehow on further checkpoint
action. But such vdso won't be recognized by
the kernel and [vdso] mark won't appear in
procfs output. Thus we put own mark on it.
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent bc66eb53
......@@ -246,6 +246,7 @@ int vdso_proxify(char *who, struct vdso_symtable *sym_rt, VmaEntry *vma, unsigne
struct vdso_symtable s = VDSO_SYMTABLE_INIT;
size_t size = vma_entry_len(vma);
bool remap_rt = true;
struct vdso_mark *m;
unsigned int i;
/*
......@@ -297,5 +298,14 @@ int vdso_proxify(char *who, struct vdso_symtable *sym_rt, VmaEntry *vma, unsigne
return -1;
}
/*
* Put a special mark into runtime vdso, thus at next checkpoint
* routine we could detect this vdso and do not dump it, since
* it's auto-generated every new session if proxy required.
*/
m = (void *)vdso_rt_parked_at;
INIT_VDSO_MARK(m);
m->proxy_addr = vma->start;
return 0;
}
......@@ -68,6 +68,38 @@ static inline unsigned long vdso_vma_size(struct vdso_symtable *t)
return t->vma_end - t->vma_start;
}
/*
* Special mark which allows to identify runtime vdso where
* calls from proxy vdso are redirected. This mark usually
* placed at the start of vdso area where Elf header lives.
* Since such runtime vdso is solevey used by proxy and
* nobody else is supposed to access it, it's more-less
* safe to screw the Elf header with @signature and
* @proxy_addr.
*
* The @proxy_addr deserves a few comments. When we redirect
* the calls from proxy to runtime vdso, on next checkpoint
* it won't be possible to find which VMA is proxy, thus
* we save its address in the member.
*/
struct vdso_mark {
u64 signature;
unsigned long proxy_addr;
};
/* Magic number (criuvdso) */
#define VDSO_MARK_SIGNATURE (0x6f73647675697263ULL)
#define VDSO_MARK_INIT \
{ \
.signature = VDSO_MARK_SIGNATURE, \
.proxy_addr = VDSO_BAD_ADDR, \
}
#define INIT_VDSO_MARK(m) \
*(m) = (struct vdso_mark)VDSO_MARK_INIT
extern struct vdso_symtable vdso_sym_rt;
extern u64 vdso_pfn;
extern int vdso_init(void);
......
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