Re: [PATCH v8 7/8] KVM: x86/pmu: Emulate RDPMC on performance metrics

From: Andi Kleen

Date: Tue Aug 18 2026 - 13:45:33 EST


On Mon, Aug 17, 2026 at 11:31:41AM -0700, Zide Chen wrote:
> If the host has the PERF_METRICS capability but it's not present on
> the guest, RDPMC interception must be enabled and KVM should inject
> an #GP when the guest attempts a PERF_METRICS RDPMC.
>
> If the guest has PERF_METRICS but RDPMC interception is enabled for
> other reasons, KVM needs to emulate RDPMC with type 0x2000.
>
> For simplicity, Metrics Clear Mode is not supported.

But is the bit cleared in PERF_CAPABILITIES? And would
the enable bit fault?

It would be better to just support it, metrics clear is actually useful.


-Andi