On Thu Jun 29, 2023 at 5:34 PM AEST, Cédric Le Goater wrote: > On 6/29/23 09:04, Frederic Barrat wrote: > > > > > > On 29/06/2023 04:07, Nicholas Piggin wrote: > >> The clock update logic reads the clock twice to compute the new clock > >> value, with a value derived from the later time subtracted from a value > >> derived from the earlier time. The delta causes time to be lost. > >> > >> This can ultimately result in time becoming unsynchronized between CPUs > >> and that can cause OS lockups, timeouts, watchdogs, etc. This can be > >> seen running a KVM guest (that causes lots of TB updates) on a powernv > >> SMP machine. > >> > >> Fix this by reading the clock once. > >> > >> Cc: [email protected] > >> Signed-off-by: Nicholas Piggin <[email protected]> > >> --- > > > > > > Nice! It must have been a nightmare to debug. > > Do you know where that ATB spr comes from? I can't relate it to the ISA. > > You should look at the e500 CPU (BookE) specs.
Yeah it's in 2.07 in the Book E. It doesn't look like Linux uses it anywhere so I didn't actually test it, but the pattern looks the same as the others so I think it's should be right. Thanks, Nick
