On 7/29/20 12:01 PM, Paolo Bonzini wrote: > On 29/07/20 10:48, Claudio Fontana wrote: >>> If you want you can add to your accelerator ops series one for >>> qemu_get_clock_ns(QEMU_CLOCK_VIRTUAL), cpu_get_ticks() and >>> qemu_start_warp_timer(), that would certainly work for me; >> >> The problem I see here is, as usual, one of meaning. >> >> Are qemu_get_clock_ns, cpu_get_ticks and qemu_start_warp_timer >> accelerator-specific cpu interfaces? > > qemu_get_clock_ns(QEMU_CLOCK_VIRTUAL) is because it needs to take icount > into account, likewise for cpu_get_ticks(); icount is TCG and qtest > specific (with subtle differences between TCG makes icount optional and > qtest makes it mandatory, so further separation of the two concepts is > totally fine for me). > > qemu_start_warp_timer() also is accelerator-specific because, besides > icount not being applicable to virtualizing accelerators, the warp timer > is not needed for qtest, only for TCG. > >> Looking at their implementation, currently I don't think they are, what do >> you think? >> >> Should these be grouped together with >> >> create_vcpu_thread, >> kick_vcpu_thread, >> synchronize_cpu_state >> >> in the same interface? > > I think so. > > Paolo >
One problem I noticed is that qemu_clock_get_ns is util/qemu-timer.c, which is tools _and_ softmmu, while I tried to extract the softmmu-only timer code in softmmu/cpu-timers.c, and the way I saw it, accelerator cpu interface was softmmu only.. Will pause and keep thinking about this. Thanks, Claudio