[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~
>
- [RFC v12 30/65] target/arm: fix style of arm_cpu_do_interrupt functions before move, (continued)
- [RFC v12 30/65] target/arm: fix style of arm_cpu_do_interrupt functions before move, Claudio Fontana, 2021/03/26
- [RFC v12 26/65] target/arm: move aarch64_sync_32_to_64 (and vv) to cpu code, Claudio Fontana, 2021/03/26
- [RFC v12 29/65] target/arm: move sve_exception_el out of TCG helpers, Claudio Fontana, 2021/03/26
- [RFC v12 31/65] target/arm: move exception code out of tcg/helper.c, Claudio Fontana, 2021/03/26
- [RFC v12 32/65] target/arm: move TCGCPUOps to tcg/tcg-cpu.c, Claudio Fontana, 2021/03/26
- [RFC v12 38/65] target/arm: remove broad "else" statements when checking accels, Claudio Fontana, 2021/03/26
- [RFC v12 35/65] target/arm: remove kvm include file for PSCI and arm-powerctl, Claudio Fontana, 2021/03/26
- [RFC v12 39/65] target/arm: remove kvm-stub.c, Claudio Fontana, 2021/03/26
- [RFC v12 40/65] tests/qtest: skip bios-tables-test test_acpi_oem_fields_virt for KVM, Claudio Fontana, 2021/03/26
- [RFC v12 36/65] target/arm: move kvm-const.h, kvm.c, kvm64.c, kvm_arm.h to kvm/, Claudio Fontana, 2021/03/26
- Re: [RFC v12 36/65] target/arm: move kvm-const.h, kvm.c, kvm64.c, kvm_arm.h to kvm/, Richard Henderson, 2021/03/28
- Re: [RFC v12 36/65] target/arm: move kvm-const.h, kvm.c, kvm64.c, kvm_arm.h to kvm/, Richard Henderson, 2021/03/28