From: Marc Zyngier <maz@kernel.org>
To: Leo Yan <leo.yan@linaro.org>
Cc: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
kvm@vger.kernel.org, James Morse <james.morse@arm.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Oliver Upton <oliver.upton@linux.dev>,
Zenghui Yu <yuzenghui@huawei.com>,
Huang Shijie <shijie@os.amperecomputing.com>,
Mark Rutland <mark.rutland@arm.com>,
Will Deacon <will@kernel.org>
Subject: Re: [PATCH] KVM: arm64: pmu: Resync EL0 state on counter rotation
Date: Tue, 15 Aug 2023 07:32:40 +0100 [thread overview]
Message-ID: <87leecq0hj.wl-maz@kernel.org> (raw)
In-Reply-To: <20230814071627.GA3963214@leoy-huanghe>
On Mon, 14 Aug 2023 08:16:27 +0100,
Leo Yan <leo.yan@linaro.org> wrote:
>
> On Fri, Aug 11, 2023 at 07:05:20PM +0100, Marc Zyngier wrote:
> > Huang Shijie reports that, when profiling a guest from the host
> > with a number of events that exceeds the number of available
> > counters, the reported counts are wildly inaccurate. Without
> > the counter oversubscription, the reported counts are correct.
> >
> > Their investigation indicates that upon counter rotation (which
> > takes place on the back of a timer interrupt), we fail to
> > re-apply the guest EL0 enabling, leading to the counting of host
> > events instead of guest events.
>
> Seems to me, it's not clear for why the counter rotation will cause
> the issue.
Maybe unclear to you, but rather clear to me (and most people else on
Cc).
>
> In the example shared by Shijie in [1], the cycle counter is enabled
> for both host and guest
No. You're misreading the example. We're profiling the guest from the
host, and the guest has no PMU access.
> and cycle counter is a dedicated event
> which does not share counter with other events. Even there have
> counter rotation, it should not impact the cycle counter.
Who says that we're counting cycles using the cycle counter? This is
an event like any other, and it can be counted on any counter.
>
> I mean if we cannot explain clearly for this part, we don't find the
> root cause, and this patch (and Shijie's patch) just walks around the
> issue.
We have the root cause. You just need to think a bit harder.
M.
--
Without deviation from the norm, progress is not possible.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-08-15 6:33 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-11 18:05 [PATCH] KVM: arm64: pmu: Resync EL0 state on counter rotation Marc Zyngier
2023-08-14 2:58 ` Shijie Huang
2023-08-15 6:27 ` Marc Zyngier
2023-08-15 7:24 ` Shijie Huang
2023-08-14 5:03 ` kernel test robot
2023-08-14 7:16 ` Leo Yan
2023-08-14 8:12 ` Shijie Huang
2023-08-14 8:47 ` Leo Yan
2023-08-14 9:15 ` Shijie Huang
2023-08-14 9:29 ` Shijie Huang
2023-08-14 10:01 ` Leo Yan
2023-08-15 2:59 ` Shijie Huang
2023-08-15 6:32 ` Marc Zyngier [this message]
2023-08-16 3:04 ` Leo Yan
2023-08-16 3:31 ` Shijie Huang
2023-08-16 21:15 ` kernel test robot
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=87leecq0hj.wl-maz@kernel.org \
--to=maz@kernel.org \
--cc=james.morse@arm.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.linux.dev \
--cc=leo.yan@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=mark.rutland@arm.com \
--cc=oliver.upton@linux.dev \
--cc=shijie@os.amperecomputing.com \
--cc=suzuki.poulose@arm.com \
--cc=will@kernel.org \
--cc=yuzenghui@huawei.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).