From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: "Clément Chigot" <chigot@adacore.com>, qemu-devel@nongnu.org
Cc: npiggin@gmail.com,
"Daniel Henrique Barboza" <danielhb413@gmail.com>,
qemu-ppc@nongnu.org, "Cédric Le Goater" <clg@kaod.org>
Subject: Re: [PATCH] hw/ppc: fix decrementer with BookE timers
Date: Tue, 27 Aug 2024 17:51:10 +0200 [thread overview]
Message-ID: <1db29701-e4f3-4376-b79d-cb7ea303a129@linaro.org> (raw)
In-Reply-To: <CAJ307Eh8aKvdi7kifGO0RoEpmyEXt9b7oYmYvFtw7KjgyepGxg@mail.gmail.com>
Adding Cédric
On 27/8/24 13:49, Clément Chigot wrote:
> Hey,
>
> Gentle ping
>
> Thanks Clément
>
> On Mon, Jul 29, 2024 at 10:33 AM Clément Chigot <chigot@adacore.com> wrote:
>>
>> Hi,
>>
>> Gentle ping + CC missing maintainers.
>>
>> Thanks Clément
>>
>> On Mon, Jul 15, 2024 at 10:46 AM Clément Chigot <chigot@adacore.com> 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.
>>>
>>> Signed-off-by: Clément Chigot <chigot@adacore.com>
>>> Fixed: 8e0a5ac87800 ("hw/ppc: Avoid decrementer rounding errors")
>>> ---
>>> 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;
>>> --
>>> 2.25.1
>>>
>
next prev parent reply other threads:[~2024-08-27 15:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-15 8:46 [PATCH] hw/ppc: fix decrementer with BookE timers Clément Chigot
2024-07-29 8:33 ` Clément Chigot
2024-08-27 11:49 ` Clément Chigot
2024-08-27 15:51 ` Philippe Mathieu-Daudé [this message]
2024-08-27 17:40 ` Cédric Le Goater
2024-08-28 7:21 ` Clément Chigot
2024-08-29 12:33 ` Cédric Le Goater
2024-08-29 13:36 ` Clément Chigot
2024-09-20 14:42 ` Clément Chigot
2024-09-20 15:46 ` Cédric Le Goater
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1db29701-e4f3-4376-b79d-cb7ea303a129@linaro.org \
--to=philmd@linaro.org \
--cc=chigot@adacore.com \
--cc=clg@kaod.org \
--cc=danielhb413@gmail.com \
--cc=npiggin@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.