From: Dmitry Osipenko <digetx@gmail.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
qemu-arm <qemu-arm@nongnu.org>,
Peter Crosthwaite <crosthwaitepeter@gmail.com>,
Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Subject: Re: [Qemu-devel] [PATCH v2] hw/ptimer: Don't wrap around counter for expired timer that uses tick handler
Date: Mon, 27 Jun 2016 21:26:02 +0300 [thread overview]
Message-ID: <5814242b-8a8c-852a-51e8-268033b51200@gmail.com> (raw)
In-Reply-To: <CAFEAcA8HFfuEHP-d8+H3DC06+RpjjXqQoCX81w2Yr+Txsn5fSw@mail.gmail.com>
On 27.06.2016 16:27, Peter Maydell wrote:
> I guess this fixes a regression, but it looks really weird.
> Why should the timer behaviour change if there happens to be
> a bottom half present? That should be an internal implementation
> detail. It's also a bit odd that use_icount is in the check:
> that shouldn't generally affect device emulation behaviour...
In case of a polled timer that doesn't have ptimer trigger bottom half callback
setup, we are free to wrap around counter since timer behaviour isn't changed
from ptimer user perspective, as it won't be able to change it's state in the
handler.
I just decided to keep that wraparound feature for a case of a polled free
running timer, this should result in a better distribution of the polled value.
The potential users of that feature are "imx_epit" and "digic" timer device
models. I should have mentioned it in the commit message to avoid confusion, sorry.
It is still an internal implementation detail, not sure what you are meaning.
Could you elaborate, please?
"use_icount" is redundant now and should be omitted, good point.
This patch is supposed to fix IRQ set -> timer expire/counter wraparound
ordering. I'm wondering whether we have same ordering issue with the scheduled
ptimer trigger callback. I can imagine the following scenario:
1) ptimer_tick() -> periodic counter reloaded or set to "0" in oneshot mode and
ptimer_trigger() schedules trigger callback
2) device uses ptimer_get_count() but the scheduled callback still pending
execution.
That should happen in the same QEMU "cycle" to cause a potential issue. Is this
possible? I'm not familiar with how AIO scheduler works.
The potential fix could be: to directly call trigger callback from ptimer_tick()
after changing the delta value.
--
Dmitry
next prev parent reply other threads:[~2016-06-27 18:26 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-25 12:35 [Qemu-devel] [PATCH v2] hw/ptimer: Don't wrap around counter for expired timer that uses tick handler Dmitry Osipenko
2016-06-25 12:47 ` Dmitry Osipenko
2016-06-25 13:20 ` Mark Cave-Ayland
2016-06-25 13:59 ` Dmitry Osipenko
2016-06-27 13:27 ` Peter Maydell
2016-06-27 18:26 ` Dmitry Osipenko [this message]
2016-06-30 15:02 ` Peter Maydell
2016-06-30 19:01 ` Dmitry Osipenko
2016-07-01 16:36 ` Peter Maydell
2016-07-01 17:49 ` Dmitry Osipenko
2016-07-04 9:55 ` Peter Maydell
2016-07-07 10:53 ` Peter Maydell
2016-07-07 12:20 ` Dmitry Osipenko
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=5814242b-8a8c-852a-51e8-268033b51200@gmail.com \
--to=digetx@gmail.com \
--cc=crosthwaitepeter@gmail.com \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--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).