Re: [PATCH v3 07/10] target/i386/kvm: query kvm.enable_pmu parameter

2025-04-16 Thread Dongli Zhang
Hi Zhao, On 4/9/25 10:05 PM, Zhao Liu wrote: > Hi Dongli, > > The logic is fine for me :-) And thank you to take my previous > suggestion. When I revisit here after these few weeks, I have some > thoughts: > >> +if (pmu_cap) { >> +if ((pmu_cap & KVM_PMU_CAP_DISABLE) && >> +

Re: [PATCH v3 07/10] target/i386/kvm: query kvm.enable_pmu parameter

2025-04-10 Thread Dongli Zhang
Hi Zhao, On 4/9/25 10:05 PM, Zhao Liu wrote: > Hi Dongli, > > The logic is fine for me :-) And thank you to take my previous > suggestion. When I revisit here after these few weeks, I have some > thoughts: > >> +if (pmu_cap) { >> +if ((pmu_cap & KVM_PMU_CAP_DISABLE) && >> +

Re: [PATCH v3 07/10] target/i386/kvm: query kvm.enable_pmu parameter

2025-04-09 Thread Zhao Liu
Hi Dongli, The logic is fine for me :-) And thank you to take my previous suggestion. When I revisit here after these few weeks, I have some thoughts: > +if (pmu_cap) { > +if ((pmu_cap & KVM_PMU_CAP_DISABLE) && > +!X86_CPU(cpu)->enable_pmu) { > +

[PATCH v3 07/10] target/i386/kvm: query kvm.enable_pmu parameter

2025-04-05 Thread Dongli Zhang
There is no way to distinguish between the following scenarios: (1) KVM_CAP_PMU_CAPABILITY is not supported. (2) KVM_CAP_PMU_CAPABILITY is supported but disabled via the module parameter kvm.enable_pmu=N. In scenario (1), there is no way to fully disable AMD PMU virtualization. In scenario (2),