[CRIU] [PATCH 08/13] vdso: Remap runtime vdso copy to safe place
Pavel Emelyanov
xemul at parallels.com
Thu May 23 07:09:33 EDT 2013
On 05/22/2013 11:09 PM, Cyrill Gorcunov wrote:
>
> Runtime vdso need to be kept in some safe place when all
> self-vmas are unmapped. So we reserve space for it in restorer
> blob area and then remap it into. It's quite important to do
> a remap here rather than data copy because otherwise pfn
> of vdso disappear and in future we won't be able to detect
> vdso are on dumping stage.
>
> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> ---
> cr-restore.c | 35 ++++++++++++++++++++++++++++++++---
> include/restorer.h | 5 +++++
> include/vdso.h | 2 ++
> pie/restorer.c | 18 ++++++++++++++++++
> pie/vdso.c | 17 +++++++++++++++++
> vdso.c | 5 +++++
> 6 files changed, 79 insertions(+), 3 deletions(-)
>
This looks nice, but I don't see much sense in writing _plain_ wrapper
over memcpy and sys_mremap. Just call them directly.
Other than this:
> + * Figure out how much memory runtime vdso will need.
> + */
> + vdso_copy_rt_symbols(&vdso_sym_rt);
No need in copying symbols on stack and then on arguments. Copy them on
arguments on demand.
> + vdso_rt_size = symtable_vma_size(&vdso_sym_rt);
> + if (vdso_rt_size)
> + vdso_rt_delta = ALIGN(restore_bootstrap_len, PAGE_SIZE) - restore_bootstrap_len;
> +
> + /*
> + /*
> + * Where is a safe place for runtime vdso being kept
> + * (non intersecting with anything else) since we need
> + * it being accessible even when own self-vmas are unmaped.
> + */
> + vdso_rt_parked_at = exec_mem_hint + restore_bootstrap_len;
> + vdso_rt_parked_at += vdso_rt_delta;
>
Plz, follow existing way of filling the bootstrap area.
mem += prev_area_size;
next_area = mem
bla_bla_bla;
mem += next_area_size
next2_area = mem
bla_bla_bla2
mem += next2_area_size
bla_bla_bla3
More information about the CRIU
mailing list