KVM: arm64: PMU: Move the ID_AA64DFR0_EL1.PMUver limit to VM creation
[platform/kernel/linux-rpi.git] / arch / arm64 / kvm / arm.c
index 94d33e2..f956aab 100644 (file)
@@ -164,6 +164,12 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type)
        set_default_spectre(kvm);
        kvm_arm_init_hypercalls(kvm);
 
+       /*
+        * Initialise the default PMUver before there is a chance to
+        * create an actual PMU.
+        */
+       kvm->arch.dfr0_pmuver.imp = kvm_arm_pmu_get_pmuver_limit();
+
        return ret;
 out_free_stage2_pgd:
        kvm_free_stage2_pgd(&kvm->arch.mmu);