History

KVM: arm64: Refuse to run VCPU if the PMU doesn't match the physical CPU

Userspace can assign a PMU to a VCPU with the KVM_ARM_VCPU_PMU_V3_SET_PMU device ioctl. If the VCPU is scheduled on a physical CPU which has a different PMU, the perf events needed to emulate a guest PMU won't be scheduled in and the guest performance counters will stop counting. Treat it as an userspace error and refuse to run the VCPU in this situation.

Alexandru Elisei committed 4 years ago

Commit 583cda11 parent 6ee7fca5 files · +38 −1Browse files

Showing the changes to arch/arm64/include/uapi (1 of 5 files). Show all

Unified · Split

arch/arm64/include/uapi/asm/kvm.h+3−0
@@ -414,6 +414,9 @@ struct kvm_arm_copy_mte_tags { · 413 unmodified lines
414414 #define KVM_PSCI_RET_INVAL PSCI_RET_INVALID_PARAMS
415415 #define KVM_PSCI_RET_DENIED PSCI_RET_DENIED
416416
417+/* run->fail_entry.hardware_entry_failure_reason codes. */
418+#define KVM_EXIT_FAIL_ENTRY_CPU_UNSUPPORTED (1ULL << 0)
419+
417420 #endif
418421
419422 #endif /* __ARM_KVM_H__ */