[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC v2 10/24] target/arm: only perform TCG cpu and machine inits if
From: |
Claudio Fontana |
Subject: |
Re: [RFC v2 10/24] target/arm: only perform TCG cpu and machine inits if tcg enabled |
Date: |
Tue, 2 Mar 2021 08:58:06 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 |
On 3/2/21 4:36 AM, Richard Henderson wrote:
> On 3/1/21 8:49 AM, Claudio Fontana wrote:
>> @@ -1321,6 +1323,7 @@ static void arm_cpu_realizefn(DeviceState *dev, Error
>> **errp)
>> }
>> }
>>
>> +#ifdef CONFIG_TCG
>> {
>> uint64_t scale;
>>
>> @@ -1346,7 +1349,8 @@ static void arm_cpu_realizefn(DeviceState *dev, Error
>> **errp)
>> cpu->gt_timer[GTIMER_HYPVIRT] = timer_new(QEMU_CLOCK_VIRTUAL,
>> scale,
>> arm_gt_hvtimer_cb, cpu);
>> }
>> -#endif
>> +#endif /* CONFIG_TCG */
>
> You can use tcg_enabled here.
It is not possible currently. I probably could write a comment about it.
It would break migration for the --enable-kvm --enable-tcg build, due to
+#ifdef CONFIG_TCG
VMSTATE_TIMER_PTR(gt_timer[GTIMER_PHYS], ARMCPU),
VMSTATE_TIMER_PTR(gt_timer[GTIMER_VIRT], ARMCPU),
+#else
+ VMSTATE_UNUSED(sizeof(QEMUTimer *)),
+ VMSTATE_UNUSED(sizeof(QEMUTimer *)),
+#endif /* CONFIG_TCG */
>
>> - }
>>
>> #ifndef CONFIG_USER_ONLY
>> - cpu->pmu_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, arm_pmu_timer_cb,
>> - cpu);
>> + cpu->pmu_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL,
>> arm_pmu_timer_cb,
>> + cpu);
>
> Incorrect indentation change.
> Otherwise, LGTM.
>
>
> r~
>
you need more lines of context in this patch than what you are quoting here,
the indentation change is intended.
The whole code, including cpu->pmu_timer is now only executed under
tcg_enabled().
Thanks,
CLaudio