mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 14:25:49 +00:00
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>
This commit is contained in:
committed by
Andrei Vagin
parent
8c344ad6ab
commit
d9aadabc36
@@ -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
|
||||
|
Reference in New Issue
Block a user