CVSROOT: /cvs
Module name: src
Changes by: [email protected] 2019/08/09 09:20:05
Modified files:
sys/arch/amd64/amd64: cpu.c tsc.c
sys/arch/amd64/include: cpu.h cpuvar.h
Log message:
Add TSC synchronization for multiprocessor machines.
CPU0 is the reference clock and all others are skewed. During CPU
initialization the clocks synchronize by keeping a registry of each CPU
clock skewness and adapting the TSC read routine accordingly.
This commit also re-enables TSC as the default time source.
Future work includes MSR-based synchronization via IA32_TSC_ADJUST
and perhaps adding a task that is executed periodically to keep the
clocks in sync in case they drift apart.
Inspired from NetBSD.
Tested by many and thoroughly reviewed by kettenis@, thank you!
OK kettenis@, deraadt@