Merge branch kvm-arm64/pmu-fixes-6.2 into kvmarm-master/fixes
authorMarc Zyngier <maz@kernel.org>
Thu, 5 Jan 2023 15:25:43 +0000 (15:25 +0000)
committerMarc Zyngier <maz@kernel.org>
Thu, 5 Jan 2023 15:25:43 +0000 (15:25 +0000)
* kvm-arm64/pmu-fixes-6.2:
  : .
  : Fix for an incredibly stupid bug in the PMU rework that went into
  : 6.2. Brown paper bag time.
  : .
  KVM: arm64: PMU: Fix PMCR_EL0 reset value

Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/kvm/sys_regs.c

index d5ee52d6bf7326f9254298631ef2fc0824c0e176..c6cbfe6b854b310f74608c87136b81b5691ef51f 100644 (file)
@@ -646,7 +646,7 @@ static void reset_pmcr(struct kvm_vcpu *vcpu, const struct sys_reg_desc *r)
                return;
 
        /* Only preserve PMCR_EL0.N, and reset the rest to 0 */
-       pmcr = read_sysreg(pmcr_el0) & ARMV8_PMU_PMCR_N_MASK;
+       pmcr = read_sysreg(pmcr_el0) & (ARMV8_PMU_PMCR_N_MASK << ARMV8_PMU_PMCR_N_SHIFT);
        if (!kvm_supports_32bit_el0())
                pmcr |= ARMV8_PMU_PMCR_LC;