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

x86: cpu -- Move xsave testing into fpu capability block

xsave sizes should sit in fpu capability block because
instruction and strick mode checkig is a different
thing.
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@gmail.com>
Reviewed-by: 's avatarDmitry Safonov <0x7f454c46@gmaill.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent cfc1d564
......@@ -261,7 +261,6 @@ static int cpu_validate_features(compel_cpuinfo_t *cpu_info)
} else
return 0;
#undef __mismatch_fpu_bit
}
/*
* Make sure the xsave features are compatible. We already hit the
......@@ -270,7 +269,7 @@ static int cpu_validate_features(compel_cpuinfo_t *cpu_info)
* xsave frame size directly by xsave instruction with greedy
* feature mask causing programs to misbehave.
*/
if (cpu_info->xfeatures_mask != rt_cpu_info.xfeatures_mask) {
if (cpu_info->xfeatures_mask > rt_cpu_info.xfeatures_mask) {
uint64_t m = cpu_info->xfeatures_mask & ~rt_cpu_info.xfeatures_mask;
pr_err("CPU xfeatures has unsupported bits (%#llx)\n",
(unsigned long long)m);
......@@ -284,6 +283,7 @@ static int cpu_validate_features(compel_cpuinfo_t *cpu_info)
cpu_info->xsave_size_max, rt_cpu_info.xsave_size_max);
return -1;
}
}
/*
* Capability on instructions level only.
......
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