On 3/28/21 7:11 PM, Richard Henderson wrote: > 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) { > ... > } >
this is fine for me, > or > > if (tcg) { > pmu > } > if (kvm || tcg) { > write_cpustate_to_list > } > if (kvm) { > rest of kvm stuff > } > this is incorrect, so the choice is easy, lets do the first. Thanks, Claudio > > r~ >