On Thu, Aug 01, 2024, Mingwei Zhang wrote: > Plumb through pass-through PMU setting from kvm->arch into kvm_pmu on each > vcpu created. Note that enabling PMU is decided by VMM when it sets the > CPUID bits exposed to guest VM. So plumb through the enabling for each pmu > in intel_pmu_refresh(). Why? As with the per-VM snapshot, I see zero reason for this to exist, it's simply: kvm->arch.enable_pmu && enable_mediated_pmu && pmu->version; And in literally every correct usage of pmu->passthrough, kvm->arch.enable_pmu and pmu->version have been checked (though implicitly), i.e. KVM can check enable_mediated_pmu and nothing else.