[CRIU] [PATCH 09/10] restore: Add restoration of alternative signal stack

Pavel Emelyanov xemul at parallels.com
Thu Jul 4 04:52:56 EDT 2013


On 07/04/2013 03:46 PM, Cyrill Gorcunov wrote:
> On Thu, Jul 04, 2013 at 03:29:48PM +0400, Cyrill Gorcunov wrote:
>> On Thu, Jul 04, 2013 at 03:25:17PM +0400, Pavel Emelyanov wrote:
>>>>  
>>>> +	if (core->thread_core->sas) {
>>>> +		task_args->has_sas = true;
>>>> +		task_args->sas = *core->thread_core->sas;
>>>
>>> Can we avoid has_sas bool and reuse some sas's field invalid value for that?
>>> E.g. ss_sp == NULL means no stack looks valid to me.
>>
>> Sure. I simply wanted to follow has_ manner we already use.
> 
> Brain context switch failure ;) Pavel I have to carry a _copy_ of sas. IOW
> 
> 	task_args->sas = *core->thread_core->sas;
> 
> thus no, has_sas needed here.

Why?

if (core->thread_core->sas)
	task_args->sas = *core->thread_core_sas;
else
	task_args->sas->ss_sp = (void *)-1; /* impossible value for sp */

later

if (sas->ss_sp != (void *)-1)
	/* restore sas */

> .
> 




More information about the CRIU mailing list