[CRIU] [PATCH 5/5] vdso: x86 -- Add handling of vvar zones

Cyrill Gorcunov gorcunov at gmail.com
Tue Jun 10 09:01:05 PDT 2014


On Tue, Jun 10, 2014 at 07:51:26PM +0400, Pavel Emelyanov wrote:
> On 06/06/2014 06:07 PM, Cyrill Gorcunov wrote:
> 
> > @@ -261,44 +262,83 @@ int vdso_remap(char *who, unsigned long from, unsigned long to, size_t size)
> >  	return 0;
> >  }
> >  
> > -int vdso_proxify(char *who, struct vdso_symtable *sym_rt, VmaEntry *vma, unsigned long vdso_rt_parked_at)
> > +int vdso_proxify(char *who, struct vdso_symtable *sym_rt,
> > +		 VmaEntry *vdso_vma, VmaEntry *vvar_vma,
> > +		 unsigned long vdso_rt_parked_at)
> >  {
> >  	struct vdso_symtable s = VDSO_SYMTABLE_INIT;
> > -	size_t size = vma_entry_len(vma);
> 
> This remove is a cleanup effectively. Plz, keep this variable.

ok

> 
> > -	bool remap_rt = true;
> > +	bool remap_rt = false;
> 
> Oh, sh... This drastically changes the logic below, doesn't it? :)

nope actually ;) remap_rt is a sign if we can remap run-time vdso into
the pace where dumpee vdso lived. IOW, if we can use inplace remapping.
Because now we need to compare not only symbols but also the size of
vvar zone, we set it by default to false then

	bool remap_rt = false;
	if (vma_entry_len(vdso_vma) == vdso_vma_size(sym_rt)) {				// size ofvDSO matches
		if (i == ARRAY_SIZE(s.symbols)) {					// all symbols are found
			remap_rt = true;
		if (vvar_vma && sym_rt->vvar_start != VVAR_BAD_ADDR)			// we have also vvar zone
			remap_rt = (vvar_vma_size(sym_rt) == vma_entry_len(vvar_vma));	// and its size didn't changed

> > +#ifdef CONFIG_VDSO
> > +			if (!vma_area_is(vma_area, VMA_AREA_VVAR))
> 
> Some comment here would be nice. Is vvar area marked with _either_ io _or_ pf?

Both, vvar is IO | PF, but ok, I'll add.


More information about the CRIU mailing list