From: Marc Zyngier <maz@kernel.org>
To: Fuad Tabba <fuad.tabba@linux.dev>
Cc: Vincent Donnefort <vdonnefort@google.com>,
oupton@kernel.org, kvmarm@lists.linux.dev,
linux-arm-kernel@lists.infradead.org, joey.gouly@arm.com,
seiden@linux.ibm.com, suzuki.poulose@arm.com,
yuzenghui@huawei.com, catalin.marinas@arm.com, will@kernel.org,
kernel-team@android.com
Subject: Re: [PATCH v1] KVM: arm64: Use the host kvm_host_data for nr_event_counters
Date: Fri, 23 Oct 2026 13:43:35 +0100 [thread overview]
Message-ID: <86bj8kzix4.wl-maz@kernel.org> (raw)
In-Reply-To: <CA+EHjTwNOJCphq8YNxK4nUZFj0Xrw31Okx1fiFAS=sHY1Z3cnA@mail.gmail.com>
On Fri, 23 Oct 2026 13:29:04 +0100,
Fuad Tabba <fuad.tabba@linux.dev> wrote:
>
> Hi Vincent,
>
> On Fri, 23 Oct 2026 10:20:07 +0100, Vincent Donnefort
> <vdonnefort@google.com> wrote:
> [...]
> > So kvm_init_host_debug_data() initialises nr_event_counters in the
> > hypervisor's kvm_host_data, while kvm_arm_setup_mdcr_el2() reads the
> > host copy which is 0. With a HPMN of 0, this stops programmable event
> > counters from counting a non-protected guest.
>
> I tested this in pKVM with a non-protected guest counting with
> perf_event_open(). On its own the patch doesn't change what the guest
> sees: every counter, the cycle counter included, still reads 0. That's
> a separate bug: flush_hyp_vcpu() never copies vcpu->arch.pmu.events to
> the hyp vCPU, so the guest's events are never enabled on entry. I'll
> send a fix for that shortly.
Please synchronise with Vincent and sent this as a series fixing PMU
handling on pKVM, not as discrete patches.
The approach taken for this patch is wrong anyway, so you have plenty
of opportunity to work together.
Thanks,
M.
--
Without deviation from the norm, progress is not possible.
next prev parent reply other threads:[~2026-10-23 12:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-23 9:20 [PATCH v1] KVM: arm64: Use the host kvm_host_data for nr_event_counters Vincent Donnefort
2026-10-23 12:29 ` Fuad Tabba
2026-10-23 12:43 ` Marc Zyngier [this message]
2026-10-23 12:45 ` Fuad Tabba
2026-10-23 12:37 ` Marc Zyngier
2026-10-26 13:08 ` Vincent Donnefort
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=86bj8kzix4.wl-maz@kernel.org \
--to=maz@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=fuad.tabba@linux.dev \
--cc=joey.gouly@arm.com \
--cc=kernel-team@android.com \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=oupton@kernel.org \
--cc=seiden@linux.ibm.com \
--cc=suzuki.poulose@arm.com \
--cc=vdonnefort@google.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