On Wed, 8 Jul 2020 11:32:09 -0500
Scott Cheloha <[email protected]> wrote:

> On Wed, Jul 08, 2020 at 09:36:03AM -0600, Theo de Raadt wrote:
> > Ugly test program (not showing it) seems to show syncronized clocks on
> > powerpc, or at least closely sycronized.  It might be one register.
> 
> I guess I'll share mine, then.
> 
> With this program I can consistently catch an offset of -2 to -1 on my
> G5.  Such a small offset is probably fine, right?  I'm curious if it
> gets any larger on other machines.

/sys/arch/macppc/macppc/cpu.c has code to "Sync timebase" of the cpus.
One cpu does h->tb = ppc_mftb() + 100000; other does ppc_mttb(h->tb).

Your -2 to -1 implies that time went backwards!  I don't like this, but
time also goes backwards in OpenBSD/amd64 and in other systems.
(Microsoft Docs, "Acquiring high-resolution time stamps", says that
stamps "from different threads", within a small range of uncertainty,
have "ambiguous ordering".)

Reply via email to