[CRIU] [PATCH 08/14] restore: Reserve space in restorer for FPU frame

Cyrill Gorcunov gorcunov at openvz.org
Wed Dec 19 15:40:24 EST 2012


On Thu, Dec 20, 2012 at 12:26:31AM +0400, Pavel Emelyanov wrote:
> On 12/19/2012 08:31 PM, Cyrill Gorcunov wrote:
> > 
> > For code simplicity we reserve the maximum size which
> > might be needed to form an FPU frame (ie for both
> > xsave and fxsave operations).
> > 
> > Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> > ---
> >  include/restorer.h | 6 ++++++
> >  1 file changed, 6 insertions(+)
> > 
> 
> 
> > +
> > +	bool				has_fpu;
> > +	union {
> > +		struct xsave_struct	xsave;
> > +		unsigned char		__pad[sizeof(struct xsave_struct) + FP_XSTATE_MAGIC2_SIZE];
> 
> What is this padding for?

We need 4 bytes to be allocated right after xsave, and technically it's better
to refer to it as singe block in structure, ie union.

	Cyrill


More information about the CRIU mailing list