[CRIU] [PATCH 06/14] checkpoint: Add dumping of FPU state

Cyrill Gorcunov gorcunov at openvz.org
Wed Dec 19 16:07:15 EST 2012


On Thu, Dec 20, 2012 at 12:53:49AM +0400, Pavel Emelyanov wrote:
> On 12/20/2012 12:36 AM, Cyrill Gorcunov wrote:
> > On Thu, Dec 20, 2012 at 12:26:09AM +0400, Pavel Emelyanov wrote:
> >> On 12/19/2012 08:31 PM, Cyrill Gorcunov wrote:
> >>>
> >>> The dumping of FPU state is done with help of ptrace
> >>> facility. There are two cases which we need to handle
> >>> depending on which features are available on host machine
> >>>
> >>> 1) The dump via ptrace(PTRACE_GETFPREGS ...)
> >>>
> >>>    In this case the kernel will use fxsave approach
> >>>    inside the kenrel and provides us back the data
> >>>    encoded in i387_fxsave_struct format.
> >>>
> >>> 2) The dump via ptrace(PTRACE_GETREGSET ...)
> >>>
> >>>    In this case the kernel will use xsave approach
> >>>    inside the kernel and provides us back the data
> >>>    encoded in xsave_struct format
> >>
> >> Doesn't kernel decide itself what way to get FPU stuff to use?
> > 
> > No, it doesn't. For backward compatibility reason. Previously
> 
> If it's for backward compatibility, then one cmd should be superior
> to the other. Are they such? Or do they report different stuff?

They are a bit different. The PTRACE_GETFPREGS uses fxsave output
format, while PTRACE_GETREGSET uses xsave format. Note one should
use PTRACE_GETREGSET iif xsave capability present, otherwise the
call fail, in turn if there is no xsave capability then we should
use PTRACE_GETFPREGS instead.

	Cyrill


More information about the CRIU mailing list