[CRIU] [PATCH 2/2] x86: restore -- Allow to restore fpu even if image is incomatible with cpu state

Pavel Emelyanov xemul at parallels.com
Thu Jan 30 03:15:58 PST 2014


On 01/29/2014 04:41 PM, Cyrill Gorcunov wrote:
> On Wed, Jan 29, 2014 at 04:12:56PM +0400, Pavel Emelyanov wrote:
>>> +	/* Backward compatible mode: no fpu -> fxsave -> xsave transition allowed */
>>> +	FPU_MODE_COMPAT		= 0,
>>> +
>>> +	/* Any mode: process even breaking backward compatibility */
>>> +	FPU_MODE_ANY		= 1,
>>
>> Can you shed more light on this. Where do we have fpu/fxsave/xsave states
>> in the code? And why do we have only two modes, when there are 4 potential
>> conversions (1 of which is src_fpu == dst_fpu)? And why do we call it
>> "backward compatibility"?
> 
> So we might have machines with following configs -- no fpu (impossible since
> we're targeting more-less new x86-64 machines with builting fpu, but no fpu case
> may happen if someone manually modify image file) => fxsave (xmm regs) =>
> xsave (xmm + ymm regs). We can _safely_ restore images with lower capability
> on the machines with higher capabilities but not the reverse, becauase
> hell knows what program may do once restored, maybe it test cpuinfo by
> self, find that ymm registers are available and start using them.

So the short summary of the above.

The --fpu-mode compat means we restore only on equal of more capable CPU
The --fpu-mode any means we restore whatever gets restored

Right?


More information about the CRIU mailing list