qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Philippe Mathieu-Daudé" <philmd@redhat.com>,
	qemu-arm <qemu-arm@nongnu.org>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"QEMU Developers" <qemu-devel@nongnu.org>
Subject: Re: [RFC 0/4] transaction-based ptimer API
Date: Fri, 4 Oct 2019 13:00:58 +0100	[thread overview]
Message-ID: <CAFEAcA_cReY=9a40pJ3J1esWTEise-Q29DPqVgm9AAHx9FesvQ@mail.gmail.com> (raw)
In-Reply-To: <2edcfdab-0682-2728-2632-e4f5bb6cd7e2@redhat.com>

On Fri, 4 Oct 2019 at 12:57, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> On 04/10/19 13:48, Peter Maydell wrote:
> > must be between matched calls to ptimer_transaction_begin() and
> > ptimer_transaction_commit().  When ptimer_transaction_commit() is
> > called it will evaluate the state of the timer after all the changes
> > in the transaction, and call the callback if necessary.
>
> Could ptimer_stop/ptimer_run act as the begin and commit functions?
> That is, ptimer_set_* can be called only between ptimer_stop and ptimer_run?

No, because stop/run causes the ptimer to "lose time"
(we stop the underlying timer and restart it). It's
very common for a device to want to change the ptimer
properties without a stop/restart -- "set the ptimer
count value when the guest writes to the device's counter
register" is the common one. Of the three begin/commit
blocks in the arm_timer.c conversion, only one of those
involves calls to stop/run, and even there we only
call stop/run if the write to the control register
modified the enable bit.

thanks
-- PMM


  reply	other threads:[~2019-10-04 12:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-04 11:48 [RFC 0/4] transaction-based ptimer API Peter Maydell
2019-10-04 11:48 ` [RFC 1/4] hw/timer/arm_timer: Add trace events Peter Maydell
2019-10-07 13:19   ` Richard Henderson
2019-10-04 11:48 ` [RFC 2/4] ptimer: Rename ptimer_init() to ptimer_init_with_bh() Peter Maydell
2019-10-07 13:20   ` Richard Henderson
2019-10-04 11:48 ` [RFC 3/4] ptimer: Provide new transaction-based API Peter Maydell
2019-10-04 12:56   ` Peter Maydell
2019-10-07 13:30   ` Richard Henderson
2019-10-04 11:48 ` [RFC 4/4] hw/timer/arm_timer.c: Switch to transaction-based ptimer API Peter Maydell
2019-10-07 13:32   ` Richard Henderson
2019-10-04 11:57 ` [RFC 0/4] " Paolo Bonzini
2019-10-04 12:00   ` Peter Maydell [this message]
2019-10-04 12:08     ` Paolo Bonzini

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='CAFEAcA_cReY=9a40pJ3J1esWTEise-Q29DPqVgm9AAHx9FesvQ@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=pbonzini@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.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).