From: Marc Zyngier <maz@kernel.org>
To: Oliver Upton <oliver.upton@linux.dev>
Cc: kvmarm@lists.linux.dev, James Morse <james.morse@arm.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Zenghui Yu <yuzenghui@huawei.com>, Will Deacon <will@kernel.org>,
stable@vger.kernel.org
Subject: Re: [PATCH 2/3] KVM: arm64: Fix host-programmed guest events in nVHE
Date: Wed, 06 Mar 2024 09:59:57 +0000 [thread overview]
Message-ID: <87bk7rr882.wl-maz@kernel.org> (raw)
In-Reply-To: <20240305184840.636212-3-oliver.upton@linux.dev>
On Tue, 05 Mar 2024 18:48:39 +0000,
Oliver Upton <oliver.upton@linux.dev> wrote:
>
> Programming PMU events in the host that count during guest execution is
> a feature supported by perf, e.g.
>
> perf stat -e cpu_cycles:G ./lkvm run
>
> While this works for VHE, the guest/host event bitmaps are not carried
> through to the hypervisor in the nVHE configuration. Make
> kvm_pmu_update_vcpu_events() conditional on whether or not _hardware_
> supports PMUv3 rather than if the vCPU as vPMU enabled.
>
> Cc: stable@vger.kernel.org
> Fixes: 84d751a019a9 ("KVM: arm64: Pass pmu events to hyp via vcpu")
> Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
> ---
> include/kvm/arm_pmu.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/kvm/arm_pmu.h b/include/kvm/arm_pmu.h
> index 4b9d8fb393a8..df32355e3e38 100644
> --- a/include/kvm/arm_pmu.h
> +++ b/include/kvm/arm_pmu.h
> @@ -86,7 +86,7 @@ void kvm_vcpu_pmu_resync_el0(void);
> */
> #define kvm_pmu_update_vcpu_events(vcpu) \
> do { \
> - if (!has_vhe() && kvm_vcpu_has_pmu(vcpu)) \
> + if (!has_vhe() && kvm_arm_support_pmu_v3()) \
> vcpu->arch.pmu.events = *kvm_get_pmu_events(); \
> } while (0)
>
Reviewed-by: Marc Zyngier <maz@kernel.org>
M.
--
Without deviation from the norm, progress is not possible.
next prev parent reply other threads:[~2024-03-06 10:00 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-05 18:48 [PATCH 0/3] KVM: arm64: PMU fixes for nVHE, protected mode Oliver Upton
2024-03-05 18:48 ` [PATCH 1/3] KVM: arm64: pkvm: Actually enable/disable PMU events when running vCPU Oliver Upton
2024-03-06 10:06 ` Marc Zyngier
2024-03-06 10:18 ` Oliver Upton
2024-03-06 13:23 ` Fuad Tabba
2024-03-05 18:48 ` [PATCH 2/3] KVM: arm64: Fix host-programmed guest events in nVHE Oliver Upton
2024-03-06 9:59 ` Marc Zyngier [this message]
2024-03-05 18:48 ` [PATCH 3/3] KVM: arm64: Do not disable preemption in kvm_vcpu_pmu_restore_guest() Oliver Upton
2024-03-06 9:52 ` Marc Zyngier
2024-03-06 9:54 ` Oliver Upton
2024-03-26 13:44 ` (subset) [PATCH 0/3] KVM: arm64: PMU fixes for nVHE, protected mode Oliver Upton
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=87bk7rr882.wl-maz@kernel.org \
--to=maz@kernel.org \
--cc=james.morse@arm.com \
--cc=kvmarm@lists.linux.dev \
--cc=oliver.upton@linux.dev \
--cc=stable@vger.kernel.org \
--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