[CRIU] [PATCH 4/9] vdso: Remap runtime vdso copy to safe place
Cyrill Gorcunov
gorcunov at openvz.org
Fri May 24 06:55:08 EDT 2013
On Fri, May 24, 2013 at 01:29:41PM +0400, Pavel Emelyanov wrote:
> On 05/24/2013 01:42 AM, 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>
> > ---
> > arch/arm/include/asm/vdso.h | 1 +
> > arch/arm/vdso-pie.c | 5 +++++
> > arch/x86/include/asm/vdso.h | 1 +
> > arch/x86/vdso-pie.c | 16 ++++++++++++++++
> > cr-restore.c | 30 +++++++++++++++++++++++++++---
> > include/restorer.h | 5 +++++
> > pie/restorer.c | 18 ++++++++++++++++++
> > 7 files changed, 73 insertions(+), 3 deletions(-)
> >
> > + if (vdso_remap("rt-vdso", vma_entry->start,
> > + args->vdso_rt_parked_at,
> > + vdso_vma_size(&args->vdso_sym_rt)))
>
> Since you want to use helper, let's benefit from that and
> make it look like
>
> vdso_remap("rt-vdso", vma_entry, args)
>
> so that it decided where from and where to to remap it.
Idea is good, but it's not that simple. Look, vdso_remap is used
in 2 cases
- remap runtime vdso to parked area
- remap proxy vdso from premmaped address to original
address it had in dumped program
IOW, it uses @args as source address and @vma_entry as target
and reverse. If I did it as
vdso_remap("rt-vdso", vma_entry, args)
I would have to add one more argument -- @direction. Will
you approve that?
More information about the CRIU
mailing list