Merge branch kvm-arm64/pmu-bl into kvmarm-master/next
authorMarc Zyngier <maz@kernel.org>
Tue, 8 Feb 2022 17:54:41 +0000 (17:54 +0000)
committerMarc Zyngier <maz@kernel.org>
Tue, 8 Feb 2022 17:54:41 +0000 (17:54 +0000)
* kvm-arm64/pmu-bl:
  : .
  : Improve PMU support on heterogeneous systems, courtesy of Alexandru Elisei
  : .
  KVM: arm64: Refuse to run VCPU if the PMU doesn't match the physical CPU
  KVM: arm64: Add KVM_ARM_VCPU_PMU_V3_SET_PMU attribute
  KVM: arm64: Keep a list of probed PMUs
  KVM: arm64: Keep a per-VM pointer to the default PMU
  perf: Fix wrong name in comment for struct perf_cpu_context
  KVM: arm64: Do not change the PMU event filter after a VCPU has run

Signed-off-by: Marc Zyngier <maz@kernel.org>
1  2 
arch/arm64/include/asm/kvm_host.h
arch/arm64/kvm/arm.c

Simple merge
@@@ -417,8 -430,8 +425,9 @@@ void kvm_arch_vcpu_put(struct kvm_vcpu 
        kvm_timer_vcpu_put(vcpu);
        kvm_vgic_put(vcpu);
        kvm_vcpu_pmu_restore_host(vcpu);
 +      kvm_arm_vmid_clear_active();
  
+       vcpu_clear_on_unsupported_cpu(vcpu);
        vcpu->cpu = -1;
  }
  
@@@ -707,7 -805,16 +720,15 @@@ static bool kvm_vcpu_exit_request(struc
                }
        }
  
+       if (unlikely(vcpu_on_unsupported_cpu(vcpu))) {
+               run->exit_reason = KVM_EXIT_FAIL_ENTRY;
+               run->fail_entry.hardware_entry_failure_reason = KVM_EXIT_FAIL_ENTRY_CPU_UNSUPPORTED;
+               run->fail_entry.cpu = smp_processor_id();
+               *ret = 0;
+               return true;
+       }
        return kvm_request_pending(vcpu) ||
 -                      need_new_vmid_gen(&vcpu->arch.hw_mmu->vmid) ||
                        xfer_to_guest_mode_work_pending();
  }