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

Submitted by Cyrill Gorcunov on Aug. 30, 2018, 11 a.m.

Details

Message ID 20180830110027.12706-6-gorcunov@gmail.com
State Accepted
Series "x86: cpu -- Rework feature testing"
Headers show

Commit Message

Cyrill Gorcunov Aug. 30, 2018, 11 a.m.
It should be there from the beginning but happen to escape.

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

Patch hide | download patch | download mbox

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;