qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Aaron Lindsay <alindsay@codeaurora.org>
To: qemu-devel@nongnu.org
Cc: qemu-arm@nongnu.org, Wei Huang <wei@redhat.com>,
	Peter Maydell <peter.maydell@linaro.org>,
	cov@codeaurora.org
Subject: [Qemu-devel] [RFC] Pointers for implementing AArch64 PMU instruction counter?
Date: Tue, 14 Feb 2017 16:49:21 -0500	[thread overview]
Message-ID: <20170214214921.GA7958@codeaurora.org> (raw)

I am interested in implementing an instruction counter to augment the
ongoing (mostly cycle-counter) PMU work on AArch64. The icount
infrastructure seems like the logical source for the instruction counts,
but I have a couple of implementation-related questions:

1. It looks like cpu_get_icount_raw() can serve as a good source for
directly reading the current instruction count. Does it seem reasonable
to only enable the instruction counter in the PMU when icount is enabled
and are there any caveats I've missed with using icount for this
purpose?

2. Triggering interrupts on overflow seems like it will take more work.
Does it seem reasonable to add a QEMU_CLOCK_VIRTUAL for the PMU so that
tcg_get_icount_limit() will overflow at the appropriate time for the PMU
if an instruction counter overflow interrupt is set? TBH, I'm not sure
how well this would work since the timer code mostly seems to deal with
time (as you might expect), keeping the icount values somewhat hidden
away.

Thanks for any feedback!

-Aaron

-- 
Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.

                 reply	other threads:[~2017-02-14 21:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20170214214921.GA7958@codeaurora.org \
    --to=alindsay@codeaurora.org \
    --cc=cov@codeaurora.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=wei@redhat.com \
    /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).