[CRIU] [PATCH 4/5] vdso: parasite -- Prepare new vdso mark structure.

Pavel Emelyanov xemul at parallels.com
Tue Jun 10 08:55:00 PDT 2014


On 06/10/2014 07:52 PM, Cyrill Gorcunov wrote:
> On Tue, Jun 10, 2014 at 07:42:57PM +0400, Pavel Emelyanov wrote:
>> On 06/06/2014 06:07 PM, Cyrill Gorcunov wrote:
>>
>>> @@ -78,26 +84,38 @@ static inline unsigned long vdso_vma_size(struct vdso_symtable *t)
>>>   */
>>>  struct vdso_mark {
>>>  	u64			signature;
>>> -	unsigned long		proxy_addr;
>>> -};
>>> +	unsigned long		proxy_vdso_addr;
>>> +
>>> +	unsigned long		version;
>>
>> This is write-only variable.
> 
> Yes, for a while. I wanted to polish code some more and add testing
> for the @version but desided to do that on top.
> 
>>>  
>>> +	/*
>>> +	 * In case of new vDSO format the VVAR area address
>>> +	 * neeed for easier discovering where it lives without
>>> +	 * relying on procfs output.
>>> +	 */
>>
>> How do we distinguish 3 cases from each other:
>>
>> 1. Old kernel w/o vvar area
>> 2. New kernel with vvar area
>> 3. New kernel with vvar area and error in its detection
> 
> By signature + proxy_vdso_addr. Old images which were
> created with previous version of criu won't have proxy_vdso_addr
> and such but have signature set to VDSO_MARK_SIGNATURE. New

Where? This patch removes the only assignment of v1 signature
which happens in vdso_put_mark.

> criu generates mark with VDSO_MARK_SIGNATURE_V2 where all
> members of vdso_mark are filled and depending if kernel
> has or has not vvar zone @proxy_vdso_addr either set to
> some valid VMA address. either set to BAD_ADDR, pointing that
> there is no vvar zone.
> 
>>
>> ?
>>
>>> +	unsigned long		proxy_vvar_addr;
>>> +};
>>>  /* Magic number (criuvdso) */
>>>  #define VDSO_MARK_SIGNATURE	(0x6f73647675697263ULL)
>>
>> This signature is no longer in use in the code. Why?
>>
>>> +#define VDSO_MARK_SIGNATURE_V2	(0x4f53447675697263ULL)	/* Magic number (criuvDSO) */
>>
>> Can we make these comments to be placed in one manner?
> 
> Sure. I think it came from the moment when I've been squashing the big
> series of small (but incomplete) patches into workable versions. Thanks.
> 
>>>  static inline bool is_vdso_mark(void *addr)
>>>  {
>>>  	struct vdso_mark *m = addr;
>>>  
>>> -	return m->signature == VDSO_MARK_SIGNATURE &&
>>> -		m->proxy_addr != VDSO_BAD_ADDR;
>>> +	return (m->signature == VDSO_MARK_SIGNATURE_V2 ||
>>> +		m->signature == VDSO_MARK_SIGNATURE) &&
>>> +		m->proxy_vdso_addr != VDSO_BAD_ADDR;
>>>  }
> 
> I just noticed that this is not correct, I need more detailed
> test here otherwise all will work of course but proxy will
> be piled again and again. Will fix.
> .
> 




More information about the CRIU mailing list