From 067f7ca9fd4db04b9e6be163a0bef89cbfc7d7c3 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sat, 22 Apr 2023 08:54:02 +0000 Subject: [PATCH] Revert "KVM: arm64: PMU: Don't save PMCR_EL0.{C,P} for the vCPU" This reverts commit 74347b99d4ebbbab43ac21b7a4420ab03369c568. It breaks the current Android kernel abi. It will be brought back at the next KABI break update. Bug: 161946584 Change-Id: Ic2ad434700f477dbecc2fd0f66275c4b3fb11406 Signed-off-by: Greg Kroah-Hartman --- arch/arm64/kvm/pmu-emul.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/arm64/kvm/pmu-emul.c b/arch/arm64/kvm/pmu-emul.c index 67770375c5ee..50b6ba593a10 100644 --- a/arch/arm64/kvm/pmu-emul.c +++ b/arch/arm64/kvm/pmu-emul.c @@ -511,8 +511,7 @@ void kvm_pmu_handle_pmcr(struct kvm_vcpu *vcpu, u64 val) if (!kvm_vcpu_has_pmu(vcpu)) return; - /* The reset bits don't indicate any state, and shouldn't be saved. */ - __vcpu_sys_reg(vcpu, PMCR_EL0) = val & ~(ARMV8_PMU_PMCR_C | ARMV8_PMU_PMCR_P); + __vcpu_sys_reg(vcpu, PMCR_EL0) = val; if (val & ARMV8_PMU_PMCR_E) { kvm_pmu_enable_counter_mask(vcpu,