[5/9] x86: cpu -- Move strict capability mode into own block

Submitted by Cyrill Gorcunov on Aug. 7, 2018, 4:35 p.m.

Details

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

Commit Message

Cyrill Gorcunov Aug. 7, 2018, 4:35 p.m.
It should be there from the beginning but happen to escape.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.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 10529260df05..6fe6ace6a198 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 capabilites 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;

Comments

Dmitry Safonov Aug. 20, 2018, 12:27 p.m.
2018-08-07 17:35 GMT+01:00 Cyrill Gorcunov <gorcunov@gmail.com>:
> 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>

Thanks,
             Dmitry