From: Richard Henderson <richard.henderson@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>,
QEMU Developers <qemu-devel@nongnu.org>
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>
Subject: Re: ptimer use of bottom-half handlers
Date: Fri, 27 Sep 2019 10:40:19 -0700 [thread overview]
Message-ID: <40ec672d-b6a0-9b3b-f619-331b2fac05c2@linaro.org> (raw)
In-Reply-To: <CAFEAcA8HGEdHs74-m3Wa7RHU_ZE5g9kEidP-9Z69zhsMkCPRZQ@mail.gmail.com>
On 9/27/19 3:01 AM, Peter Maydell wrote:
> (2) call the device's callback function directly when the
> ptimer triggers from the QEMU timer expiry. But for
> the case of "a call to ptimer_set_count() etc caused
> the timer to trigger", don't call the callback, instead
> return a boolean from those functions which tells the
> caller that the timer triggered, and they need to deal
> with it (by calling their callback function when they've
> finished messing with the timer).
...
> I think overall I favour option 2, which is a bit more
> syntactically invasive in terms of changing API signatures etc,
> but semantically easier to reason about (because the
> callback-function in the device is still not called when
> the device might be partway through doing an update to
> the ptimer state that changes multiple parameters of the
> ptimer).
>
> Is there another cleverer fix that I haven't thought of?
If "other things" are being changed along with ptimer_set_count, then is the
boolean result of ptimer_set_count necessarily still relevant after the "other
things"?
Can we record the set of things to be done within a
ptimer_transaction_{begin,commit}() pair and then invoke the callback (if
necessary) when committing? Is it even easy to see the set of "other things"
that would need to be wrapped?
I think I need a bit of time understanding the use cases in hw/timer/ before
being able to suggest anything more definite...
r~
next prev parent reply other threads:[~2019-09-27 17:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-27 10:01 ptimer use of bottom-half handlers Peter Maydell
2019-09-27 17:40 ` Richard Henderson [this message]
2019-10-01 15:03 ` Peter Maydell
2019-10-04 17:40 ` Peter Maydell
2019-10-04 21:37 ` Richard Henderson
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=40ec672d-b6a0-9b3b-f619-331b2fac05c2@linaro.org \
--to=richard.henderson@linaro.org \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@redhat.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).