Re: [PATCH 1/2] perf/x86/rapl: Add support for Intel Meteor Lake

From: Zhang, Rui
Date: Thu Jan 05 2023 - 01:54:42 EST


On Wed, 2023-01-04 at 08:55 -0800, Dave Hansen wrote:
> On 1/4/23 06:58, Zhang Rui wrote:
> > @@ -807,6 +807,8 @@ static const struct x86_cpu_id
> > rapl_model_match[] __initconst = {
> > X86_MATCH_INTEL_FAM6_MODEL(RAPTORLAKE, &model_skl)
> > ,
> > X86_MATCH_INTEL_FAM6_MODEL(RAPTORLAKE_P, &model_skl),
> > X86_MATCH_INTEL_FAM6_MODEL(RAPTORLAKE_S, &model_skl),
> > + X86_MATCH_INTEL_FAM6_MODEL(METEORLAKE, &model_skl)
> > ,
> > + X86_MATCH_INTEL_FAM6_MODEL(METEORLAKE_L, &model_skl),
> > {},
> > };
>
> Any chance this will ever get architectural enumeration?

We will get rid of the non-architechtural MSR interface on future
server platforms. But for client, we still have to live with it so far.

> Or, are we
> doomed to grow this model list until the end of time?

I thought of this before and got some ideas related.
Say, instead of maintaining the model list in a series of drivers, can
we have something similar to "cpu_feature" instead? The feature flags
can be set in a central place, when adding the new CPU ID. Then all
these drivers can just probe based on the feature flag.
There are a list of drivers that could benefit from this, say,
intel_rapl, RAPL PMU, turbostat, thermal tcc cooling, PMC, etc.
currently, all these drivers have their own model lists.

thanks,
rui