qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stafford Horne <shorne@gmail.com>
To: Joel Holdsworth <jholdsworth@nvidia.com>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [PATCH] hw/openrisc: Fixed undercounting of TTCR in continuous mode
Date: Mon, 5 Aug 2024 07:12:55 +0100	[thread overview]
Message-ID: <ZrBtZ4VKEC0dgmWG@antec> (raw)
In-Reply-To: <DM4PR12MB65656FF201E6BFB43FDB4A3BC8C62@DM4PR12MB6565.namprd12.prod.outlook.com>

On Mon, Jun 10, 2024 at 07:29:15PM +0000, Joel Holdsworth wrote:
> Hi Stafford, thanks for your response.
> 
> > - You sent this 2 times, is the only change in v2 the sender address?
> 
> Yes, I was just having some difficulty with Git and SMTP. Should be fixed now.

OK.

> >> In the existing design, TTCR is prone to undercounting when running in
> >> continuous mode. This manifests as a timer interrupt appearing to
> >> trigger a few cycles prior to the deadline set in SPR_TTMR_TP.
> 
> > This is a good find, I have noticed the timer is off when running on OpenRISC
> > but never tracked it down to this undercounting issue.  I also notice
> > unexplained RCU stalls when running in Linux when tere is no load, this timer
> issue might be related.
> 
> > Did you notice this via other system symptoms when running OpenRISC or just via
> > code auditing of QEMU?
> 
> I'm working on an OpenRISC port of Zephyr. The under-counting issue causes
> consistent deadlocks in my experiments with the test suite. I wouldn't be
> surprised if it causes problems for other OS's.

Thats cool.  I got around to testing the patch with Linux, unfortunately I didnt
see an improvement in the lockups I have been seeing during boot time.  But I am
sure this is a step in the right direction.

> > In QEMU there is a function clock_ns_to_ticks(). Could this maybe be used
> > instead to give us more standard fix?
> 
> Seems like a good idea, and I now have some nearly-complete patch that brings
> hw/openrisc/cputimer.c into closer alignment with
> target/mips/sysemu/cp0_timer.c.

Hi, I was waiting for this second version patch, v2.  Have you ever completed it?

> However, don't we run into problems with undercounting with clock_ns_to_ticks,
> because if I understand correctly it will round ticks down, not up?, which is
> the problem I was trying to avoid in the first place.

You might be right, but if that is the case maybe it's a but to raise to the
maintainers directly.  I was planning to look into this more cosely after you
sent the followup patch.

-Stafford


  reply	other threads:[~2024-08-05  6:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-07 22:29 [PATCH] hw/openrisc: Fixed undercounting of TTCR in continuous mode Joel Holdsworth via
2024-06-08 22:30 ` Stafford Horne
2024-06-10 19:29   ` Joel Holdsworth
2024-08-05  6:12     ` Stafford Horne [this message]
2024-11-13  7:00 ` Stafford Horne

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=ZrBtZ4VKEC0dgmWG@antec \
    --to=shorne@gmail.com \
    --cc=jholdsworth@nvidia.com \
    --cc=qemu-devel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).