qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC v12 38/65] target/arm: remove broad "else" statements when chec


From: Claudio Fontana
Subject: Re: [RFC v12 38/65] target/arm: remove broad "else" statements when checking accels
Date: Mon, 29 Mar 2021 08:58:39 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0

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~
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]