qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] hw/timer: fix int underflow


From: Peter Maydell
Subject: Re: [PATCH] hw/timer: fix int underflow
Date: Tue, 14 Jan 2025 10:50:45 +0000

On Tue, 14 Jan 2025 at 10:40, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> On 1/14/25 11:14, Peter Maydell wrote:
> >> So, to my opinion, explicit cast to "long long" is necessary
> >> here to get the expected behavior.
> >
> > I wasn't saying the existing code was necessarily correct,
> > or that your proposed change was necessarily wrong.
> > I was saying your patch didn't come with any analysis of
> > what the actual hardware behaviour is, which is
> > how you would determine whether the fix you propose
> > is the correct one, or if it should be some other
> > change instead. (Some of my response was trying to
> > provide some of that analysis.)
> I would say that the patch is more or less obvious in the sense that the
> intent of the code is to model a counter (which counts up by 1 and
> cannot miss a step) with a timer within a process that could be
> preempted.  You probably will not find an answer in the datasheet, other
> than by analyzing the signal diagrams, because this scenario simply
> cannot exist with a hardware counter.

Well, for a start, you want to look at the datasheet
to check that this really is modelling a counter and
how wide the counter is (32 bits in this case).

thanks
-- PMM



reply via email to

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