[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] hw/ppc: Fix clock update drift
From: |
Nicholas Piggin |
Subject: |
Re: [PATCH] hw/ppc: Fix clock update drift |
Date: |
Thu, 29 Jun 2023 17:45:26 +1000 |
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: qemu-stable@nongnu.org
> >> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> >> ---
> >
> >
> > 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