Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/checkpoint-restore/criu.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2018-06-14 20:27:26 +0300
committerAndrei Vagin <avagin@virtuozzo.com>2018-06-18 21:07:30 +0300
commitd9aadabc36587008a470349fce40b13a888c0db4 (patch)
treea7f6d6a69d126771c166524e290259c95ec350bf
parent8c344ad6abff3a39d66142befb93867e745d2860 (diff)
x86: cpu -- Report when unsupported compact xsave frame detected
We don't have yet support of compacted xsave frames so report error on cpu-check, checkpoint, restore actions. Basically it is done in cpu_init routine which is called in the sites we're interested in. Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
-rw-r--r--criu/arch/x86/cpu.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/criu/arch/x86/cpu.c b/criu/arch/x86/cpu.c
index 375a77550..c7def8883 100644
--- a/criu/arch/x86/cpu.c
+++ b/criu/arch/x86/cpu.c
@@ -29,6 +29,20 @@
static compel_cpuinfo_t rt_cpu_info;
+static int cpu_has_unsupported_features(void)
+{
+ /*
+ * We don't support yet compacted xsave format so
+ * exit early if present.
+ */
+ if (compel_cpu_has_feature(X86_FEATURE_XSAVES)) {
+ pr_err("Unsupported compact xsave frame on runtime cpu present\n");
+ return 1;
+ }
+
+ return 0;
+}
+
int cpu_init(void)
{
if (compel_cpuid(&rt_cpu_info))
@@ -57,7 +71,7 @@ int cpu_init(void)
!!compel_cpu_has_feature(X86_FEATURE_XGETBV1),
!!compel_cpu_has_feature(X86_FEATURE_XSAVES));
- return 0;
+ return cpu_has_unsupported_features() ? -1 : 0;
}
int cpu_dump_cpuinfo(void)
@@ -219,6 +233,9 @@ static int cpu_validate_ins_features(compel_cpuinfo_t *cpu_info)
static int cpu_validate_features(compel_cpuinfo_t *cpu_info)
{
+ if (cpu_has_unsupported_features())
+ return -1;
+
if (opts.cpu_cap == CPU_CAP_FPU) {
/*
* If we're requested to check FPU only ignore