qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] hw/ppc: fix decrementer with BookE timers


From: Clément Chigot
Subject: Re: [PATCH] hw/ppc: fix decrementer with BookE timers
Date: Fri, 20 Sep 2024 16:42:38 +0200

Hi Cédric,

On Tue, Aug 27, 2024 at 7:40 PM Cédric Le Goater <clg@kaod.org> wrote:
>
> Hello Clément,
>
> On 7/15/24 10:46, Clément Chigot wrote:
> > The BookE decrementer stops at 0, meaning that it won't decremented
> > towards "negative" values.
> > However, the current logic is inverted: decr is updated solely when
> > the resulting value would be negative.
>
> How did you hit the issue ? which machine ? I didn't see any error
> when booting Linux 6.6.3 on mpc8544ds, e500mc, e5500 and e6500.
>
> > Signed-off-by: Clément Chigot <chigot@adacore.com>
> > Fixed: 8e0a5ac87800 ("hw/ppc: Avoid decrementer rounding errors")
>
> LGTM,
>
> Reviewed-by: Cédric Le Goater <clg@redhat.com>

Unless I'm wrong this patch has not been queued yet. Is there any
reason for this ?
I just want to make sure it hasn't been forgotten.

Thanks,
Clément

> We have some automated tests with the ppce500 machine which it would be
> interesting  to extend to have a better coverage of booke.
>
> Thanks,
>
> C.
>
>
>
> > ---
> >   hw/ppc/ppc.c | 4 +++-
> >   1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/hw/ppc/ppc.c b/hw/ppc/ppc.c
> > index e6fa5580c0..9fc85c7de0 100644
> > --- a/hw/ppc/ppc.c
> > +++ b/hw/ppc/ppc.c
> > @@ -729,7 +729,9 @@ static inline int64_t __cpu_ppc_load_decr(CPUPPCState 
> > *env, int64_t now,
> >       int64_t decr;
> >
> >       n = ns_to_tb(tb_env->decr_freq, now);
> > -    if (next > n && tb_env->flags & PPC_TIMER_BOOKE) {
> > +
> > +    /* BookE timers stop when reaching 0.  */
> > +    if (next < n && tb_env->flags & PPC_TIMER_BOOKE) {
> >           decr = 0;
> >       } else {
> >           decr = next - n;
>
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]