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