Commit f25f91e5 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Andrei Vagin

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: 's avatarDmitry Safonov <0x7f454c46@gmail.com>
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent bb760d88
...@@ -29,6 +29,20 @@ ...@@ -29,6 +29,20 @@
static compel_cpuinfo_t rt_cpu_info; 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) int cpu_init(void)
{ {
if (compel_cpuid(&rt_cpu_info)) if (compel_cpuid(&rt_cpu_info))
...@@ -57,7 +71,7 @@ int cpu_init(void) ...@@ -57,7 +71,7 @@ int cpu_init(void)
!!compel_cpu_has_feature(X86_FEATURE_XGETBV1), !!compel_cpu_has_feature(X86_FEATURE_XGETBV1),
!!compel_cpu_has_feature(X86_FEATURE_XSAVES)); !!compel_cpu_has_feature(X86_FEATURE_XSAVES));
return 0; return cpu_has_unsupported_features() ? -1 : 0;
} }
int cpu_dump_cpuinfo(void) int cpu_dump_cpuinfo(void)
...@@ -219,6 +233,9 @@ static int cpu_validate_ins_features(compel_cpuinfo_t *cpu_info) ...@@ -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) 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 (opts.cpu_cap == CPU_CAP_FPU) {
/* /*
* If we're requested to check FPU only ignore * If we're requested to check FPU only ignore
......
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