From: Marc Zyngier Date: Tue, 8 Feb 2022 17:54:41 +0000 (+0000) Subject: Merge branch kvm-arm64/pmu-bl into kvmarm-master/next X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=00e6dae00e3dcb4dd54e1d62e295fd997a0cec28;p=linux.git Merge branch kvm-arm64/pmu-bl into kvmarm-master/next * 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 --- 00e6dae00e3dcb4dd54e1d62e295fd997a0cec28 diff --cc arch/arm64/kvm/arm.c index 418014998f18e,13c1318d8b9aa..fefd5774ab55d --- a/arch/arm64/kvm/arm.c +++ b/arch/arm64/kvm/arm.c @@@ -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(); }