freebsd-nq/sys/arm
Konstantin Belousov 1680854946 Implement userspace gettimeofday(2) with HPET timecounter.
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.  Nothing can me done
against the access latency, but the syscall overhead can be removed.
System already provides mappable /dev/hpetX devices, which gives
straight access to the HPET registers page.

Add 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 from kernel to userspace, index might be changed and
libc invalidates its mapping as needed.

Remove cpu_fill_vdso_timehands() KPI, instead require that
timecounters which can be used from userspace, to provide
tc_fill_vdso_timehands{,32}() methods.  Merge i386 and amd64
libc/<arch>/sys/__vdso_gettc.c into one source file in the new
libc/x86/sys location.  __vdso_gettc() internal interface is changed
to move timecounter algorithm detection into the MD code.

Measurements show that RDTSC even with the syscall overhead is faster
than userspace HPET access.  But still, userspace HPET is three-four
times faster than syscall HPET on several Core2 and SandyBridge
machines.

Tested by:	Howard Su <howard0su@gmail.com>
Sponsored by:	The FreeBSD Foundation
MFC after:	1 month
Differential revision:	https://reviews.freebsd.org/D7473
2016-08-17 09:52:09 +00:00
..
allwinner Correct the size of the softc in a10_ehci 2016-08-14 13:17:59 +00:00
altera/socfpga Enable the build of micphy as part of generic miibus build, but only for 2016-07-28 05:59:56 +00:00
amlogic/aml8726
annapurna/alpine
arm Implement userspace gettimeofday(2) with HPET timecounter. 2016-08-17 09:52:09 +00:00
at91 Use the new(-ish) CP15_SCTLR macro to generate system control reg accesses 2016-05-23 20:07:17 +00:00
broadcom/bcm2835 Remove some NULL checks after M_WAITOK allocations from sys/arm/. 2016-08-09 16:02:35 +00:00
cavium/cns11xx Spaces->tab in comment. 2016-05-23 20:13:17 +00:00
conf Remove unused USB ethernet driver from BEAGLEBONE/AM335x kernel. 2016-07-23 17:36:17 +00:00
freescale Postpone allocation of IRQ resource to the time when interrupt 2016-06-03 11:05:55 +00:00
include Implement userspace gettimeofday(2) with HPET timecounter. 2016-08-17 09:52:09 +00:00
lpc Correct syntax errors that only show up when compiled with INVARIANTS. 2016-07-09 18:43:15 +00:00
mv Use nitems() macro instead of re-inventing it 2016-06-03 18:52:57 +00:00
nvidia TEGRA: Subclass Tegra PCIE driver from ofw_pci base driver. 2016-07-17 14:45:15 +00:00
qemu
rockchip
samsung/exynos Correct syntax errors that only show up when compiled with INVARIANTS. 2016-07-09 18:43:15 +00:00
ti Enable the build of micphy as part of generic miibus build, but only for 2016-07-28 05:59:56 +00:00
versatile
xilinx
xscale sys: replace comma with semicolon when pertinent. 2016-08-09 19:42:20 +00:00