Commit 9b491e5c authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

x86: restore -- Allow to restore fpu even if image is incomatible with cpu state

Sometime, especially when testing, we migrate checkpointed tasks between
nodes which have different CPU capabilities. In particular some CPUs have
xsave feature while others -- do not. So to be able to continue migration
procedure even in such conditions one should specify

	--cpu-cap ^fpu

on command line which would force criu to restore FPU state ignoring extended
status present in image file.
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 056047bd
......@@ -7,6 +7,7 @@
#include "asm/types.h"
#include "asm/fpu.h"
#include "cr_options.h"
#include "compiler.h"
#include "ptrace.h"
#include "parasite-syscall.h"
......@@ -326,12 +327,19 @@ static bool valid_xsave_frame(CoreEntry *core)
return false;
}
} else {
/*
* If the image has xsave area present then CPU we're restoring
* on must have X86_FEATURE_XSAVE feature until explicitly
* stated in options.
*/
if (core->thread_info->fpregs->xsave) {
if (opts.cpu_cap & CPU_CAP_FPU) {
pr_err("FPU xsave area present, "
"but host cpu doesn't support it\n");
return false;
} else
pr_warn_once("FPU is about to restore ignoring ymm state!\n");
}
return true;
}
return true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment