Right now, userspace (fast) gettimeofday(2) on x86 only works for RDTSC. For older machines, like Core2, where RDTSC is not C2/C3 invariant, and which fall to HPET hardware, this means that the call has both the penalty of the syscall and of the uncached hw behind the QPI or PCIe connection to the sought bridge. We cannot do anything against the access latency, but the syscall overhead can be removed. We have mappable /dev/hpetX devices, which can be used there.
Patch adds yet another algorithm to the x86 'vdso' timehands. Libc is updated to handle both RDTSC and HPET. For HPET, the index of the hpet device to mmap is passed, index might be changed and libc invalidates its mapping.
The cpu_fill_vdso_timehands() functions are removed, instead timecounters get the method to fill vdso timehands, which makes the new algorithms additions to the kernel side rather clean. Libc does have to switch() based on the algo variant still.
I changed the hpet device permissions from 0600 to 0644. There are additional knobs which disable mmapings, honored for libc fast_gettime knob, and there are devfs usual methods to control permissions. But in fact, I do not see anything wrong with providing userspace the read-only access to the HPET registers page unconditionally.