[CRIU] [PATCH 05/12] x86: cpu -- Move strict capability mode into own block

Cyrill Gorcunov gorcunov at gmail.com
Thu Aug 30 14:00:20 MSK 2018


It should be there from the beginning but happen to escape.

Signed-off-by: Cyrill Gorcunov <gorcunov at gmail.com>
Reviewed-by: Dmitry Safonov <0x7f454c46 at gmaill.com>
---
 criu/arch/x86/cpu.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/criu/arch/x86/cpu.c b/criu/arch/x86/cpu.c
index 6ffe97131cc1..1945a3dc31d5 100644
--- a/criu/arch/x86/cpu.c
+++ b/criu/arch/x86/cpu.c
@@ -294,10 +294,12 @@ static int cpu_validate_features(compel_cpuinfo_t *cpu_info)
 	/*
 	 * Strict capability mode. Everything must match.
 	 */
-	if (memcmp(cpu_info->x86_capability, rt_cpu_info.x86_capability,
-		   sizeof(cpu_info->x86_capability))) {
-		pr_err("CPU capabilities do not match run time\n");
-		return -1;
+	if (opts.cpu_cap & CPU_CAP_CPU) {
+		if (memcmp(cpu_info->x86_capability, rt_cpu_info.x86_capability,
+			   sizeof(cpu_info->x86_capability))) {
+			pr_err("CPU capabilites do not match run time\n");
+			return -1;
+		}
 	}
 
 	return 0;
-- 
2.17.1



More information about the CRIU mailing list