On 3/26/21 1:36 PM, Claudio Fontana wrote:
@@ -638,24 +638,21 @@ static int cpu_pre_save(void *opaque)
if (tcg_enabled()) {
          pmu_op_start(&cpu->env);
+        if (!write_cpustate_to_list(cpu, false)) {
+            /* This should never fail. */
+            abort();
+        }
      }
-
      if (kvm_enabled()) {
          if (!write_kvmstate_to_list(cpu)) {
              /* This should never fail */
              abort();
          }
-
          /*
           * kvm_arm_cpu_pre_save() must be called after
           * write_kvmstate_to_list()
           */
          kvm_arm_cpu_pre_save(cpu);
-    } else {
-        if (!write_cpustate_to_list(cpu, false)) {
-            /* This should never fail. */
-            abort();
-        }
      }

Hmm.  Not perfect.  I can't decide on

  if (tcg) {
     ...
  } else if (kvm) {
     ...
  }

or

  if (tcg) {
    pmu
  }
  if (kvm || tcg) {
    write_cpustate_to_list
  }
  if (kvm) {
    rest of kvm stuff
  }


r~

Reply via email to