Skip to content

Commit 8f69806

Browse files
rananta468mehmetb0
authored andcommitted
KVM: arm64: Ignore PMCNTENSET_EL0 while checking for overflow status
BugLink: https://bugs.launchpad.net/bugs/2095283 commit 54bbee190d42166209185d89070c58a343bf514b upstream. DDI0487K.a D13.3.1 describes the PMU overflow condition, which evaluates to true if any counter's global enable (PMCR_EL0.E), overflow flag (PMOVSSET_EL0[n]), and interrupt enable (PMINTENSET_EL1[n]) are all 1. Of note, this does not require a counter to be enabled (i.e. PMCNTENSET_EL0[n] = 1) to generate an overflow. Align kvm_pmu_overflow_status() with the reality of the architecture and stop using PMCNTENSET_EL0 as part of the overflow condition. The bug was discovered while running an SBSA PMU test [*], which only sets PMCR.E, PMOVSSET<0>, PMINTENSET<0>, and expects an overflow interrupt. Cc: [email protected] Fixes: 76d883c ("arm64: KVM: Add access handler for PMOVSSET and PMOVSCLR register") Link: https://github.com/ARM-software/sbsa-acs/blob/master/test_pool/pmu/operating_system/test_pmu001.c Signed-off-by: Raghavendra Rao Ananta <[email protected]> [ oliver: massaged changelog ] Reviewed-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Oliver Upton <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Koichiro Den <[email protected]>
1 parent 763b7aa commit 8f69806

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

arch/arm64/kvm/pmu-emul.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,6 @@ static u64 kvm_pmu_overflow_status(struct kvm_vcpu *vcpu)
371371

372372
if ((__vcpu_sys_reg(vcpu, PMCR_EL0) & ARMV8_PMU_PMCR_E)) {
373373
reg = __vcpu_sys_reg(vcpu, PMOVSSET_EL0);
374-
reg &= __vcpu_sys_reg(vcpu, PMCNTENSET_EL0);
375374
reg &= __vcpu_sys_reg(vcpu, PMINTENSET_EL1);
376375
}
377376

0 commit comments

Comments
 (0)