Re: [PATCH 14/15] KVM: x86/pmu: Advertise PerfMon version 5 on Intel hosts

From: Chen, Zide

Date: Fri Jul 24 2026 - 10:25:21 EST




On 7/23/2026 10:20 PM, Jim Mattson wrote:
> On Thu, Jul 23, 2026 at 4:25 PM Chen, Zide <zide.chen@xxxxxxxxx> wrote:
>>
>> Currently KVM always injects #GP when the AnyThread bit is set.
>>
>> kvm_pmu_refresh(): pmu->reserved_bits = 0xffffffff00200000ull;
>>
>> I understand the concern, but I'm not aware of a better solution for
>> PMUv3/4. Silently ignoring AnyThread would deviate from the
>> architectural behavior and, more importantly, may give the guest the
>> false impression that AnyThread is supported. Supporting AnyThread, on
>> the other hand, has cross-VM information leakage concerns.
>
> Don't support versions 3 or 4; they aren't virtualizable. Hosts with
> PMU versions 3 or 4 just get vPMU version 2.

Yes, that sounds reasonable.

PMUv3/v4 platforms (Nehalem, Westmere, Sandy Bridge, and Ivy Bridge) are
quite old. In addition, the impact of exposing PMUv2 instead of PMUv3/v4
should be minimal.