On 17/04/2017 20:55, Pranith Kumar wrote: >>> +/* ARM does not have a user-space readble cycle counter available. >>> + * This is a compromise to get monotonically increasing time. >>> + */ >>> +static inline int64_t cpu_get_host_ticks(void) >>> +{ >>> + return get_clock(); >>> +} >> This doesn't look like it should be ARM-specific. Is it >> better than the current default implementation? If so, >> why not make this the default implementation? > > I think we can do that...
Yes, it is always better for emulation accuracy. It may be much slower, depending on your OS (especially if get_clock requires a user->kernel->user transition), but the current code is quite broken. Paolo >>> + >>> #else >>> /* The host CPU doesn't have an easily accessible cycle counter. >>> Just return a monotonically increasing value. This will be >> The comment here says that our default is already a monotonically >> increasing implementation -- is it wrong, or is there some other >> advantage of your version? > Comment #6 in the bug report by Laszlo Ersek explains why. > Incrementing by 1 for approximately 55 ms is what is causing the > divide by zero in grub.