[10/12] x86: cpu -- Don't exit early if --cpu-cap=ins specified

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

Details

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

Commit Message

Cyrill Gorcunov Aug. 30, 2018, 11 a.m.
Since we're using bintmaps for options don't exit early
if --cpu-cap=ins specified because there might be a
combination of options.

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

Patch hide | download patch | download mbox

diff --git a/criu/arch/x86/cpu.c b/criu/arch/x86/cpu.c
index a3f173b31c11..ce62cb7cf62a 100644
--- a/criu/arch/x86/cpu.c
+++ b/criu/arch/x86/cpu.c
@@ -287,8 +287,10 @@  static int cpu_validate_features(compel_cpuinfo_t *cpu_info)
 	/*
 	 * Capability on instructions level only.
 	 */
-	if (opts.cpu_cap & CPU_CAP_INS)
-		return cpu_validate_ins_features(cpu_info);
+	if (opts.cpu_cap & CPU_CAP_INS) {
+		if (cpu_validate_ins_features(cpu_info))
+			return -1;
+	}
 
 	/*
 	 * Strict capability mode. Everything must match.

Comments

Dmitry Safonov Aug. 30, 2018, 1:15 p.m.
2018-08-30 12:00 GMT+01:00 Cyrill Gorcunov <gorcunov@gmail.com>:
> Since we're using bintmaps for options don't exit early
> if --cpu-cap=ins specified because there might be a
> combination of options.
>
> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>

Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com>

Thanks,
             Dmitry