On 6 October 2015 at 13:58, Paolo Bonzini <pbonz...@redhat.com> wrote: > > > On 06/10/2015 14:49, Peter Maydell wrote: >> Yeah, there's no guarantee on userspace access. I think the >> fastest way to get some kind of count is to use a library >> function that boils down to gettimeofday(2), which we will >> do purely in userspace in the kernel VDSO if possible.
Looking closer, clock_gettime() also has a userspace only fastpath in the VDSO. > Could we just use CNTVCT_EL0? Which cores have it? Not guaranteed to be enabled for userspace access by the kernel, and even if it is enabled, the kernel folks don't (last time I checked) consider this userspace ABI -- it's only there for the benefit of the VDSO. (CNTVCT_EL0 is how the fast clock_gettime and getimeofday paths are implemented.) thanks -- PMM