Re: [PATCH v4 05/21] KVM: x86/pmu: Use pmc_exists in PMC lookup helpers
From: Yosry Ahmed
Date: Sat Nov 14 2026 - 13:54:12 EST
On Thu, Nov 12, 2026 at 01:32:11PM -0700, Zide Chen wrote:
> pmu->nr_arch_{gp,fixed}_counters cannot represent non-contiguous GP or
> fixed counters.
>
> Introduce kvm_is_{gp,fixed}_pmc_supported() to validate counter indices
> via pmu->pmc_exists, and switch the PMC lookup helpers to use them in
> preparation for dropping nr_arch_{gp,fixed}_counters.
>
> No functional change intended.
>
> Co-developed-by: Dapeng Mi <dapeng1.mi@xxxxxxxxxxxxxxx>
> Signed-off-by: Dapeng Mi <dapeng1.mi@xxxxxxxxxxxxxxx>
> Signed-off-by: Zide Chen <zide.chen@xxxxxxxxx>
Reviewed-by: Yosry Ahmed <yosry@xxxxxxxxxx>