Message ID | 20240930-add-cpu-type-v4-4-104892b7ab5f@linux.intel.com (mailing list archive) |
---|---|
State | Handled Elsewhere, archived |
Headers | show |
Series | Add CPU-type to topology | expand |
Hi Pawan, On 2024-09-30 10:47 a.m., Pawan Gupta wrote: > get_this_hybrid_cpu_type() misses a case when cpu-type is populated > regardless of X86_FEATURE_HYBRID_CPU. This is particularly true for hybrid > variants that have P or E cores fused off. > > Instead use topology_hw_cpu_type() as it does not rely on hybrid feature to > enumerate cpu-type. This can also help avoid the model-specific fixup > get_hybrid_cpu_type(). > > Suggested-by: Dave Hansen <dave.hansen@linux.intel.com> > Signed-off-by: Pawan Gupta <pawan.kumar.gupta@linux.intel.com> > --- > arch/x86/events/intel/core.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c > index d879478db3f5..80a2a307e678 100644 > --- a/arch/x86/events/intel/core.c > +++ b/arch/x86/events/intel/core.c > @@ -4906,7 +4906,8 @@ static void intel_pmu_check_hybrid_pmus(struct x86_hybrid_pmu *pmu) > > static struct x86_hybrid_pmu *find_hybrid_pmu_for_cpu(void) > { > - u8 cpu_type = get_this_hybrid_cpu_type(); > + struct cpuinfo_x86 *c = &cpu_data(smp_processor_id()); > + u8 cpu_type = topology_hw_cpu_type(c); > int i; > > /* > Dapeng's patch to utilize the native model ID in perf has been merged. Please replace the get_this_hybrid_cpu_native_id() as well when you spin a new version. https://lore.kernel.org/all/20240820073853.1974746-4-dapeng1.mi@linux.intel.com/ Thanks, Kan
On Mon, Oct 21, 2024 at 09:54:57AM -0400, Liang, Kan wrote: > Hi Pawan, > > On 2024-09-30 10:47 a.m., Pawan Gupta wrote: > > get_this_hybrid_cpu_type() misses a case when cpu-type is populated > > regardless of X86_FEATURE_HYBRID_CPU. This is particularly true for hybrid > > variants that have P or E cores fused off. > > > > Instead use topology_hw_cpu_type() as it does not rely on hybrid feature to > > enumerate cpu-type. This can also help avoid the model-specific fixup > > get_hybrid_cpu_type(). > > > > Suggested-by: Dave Hansen <dave.hansen@linux.intel.com> > > Signed-off-by: Pawan Gupta <pawan.kumar.gupta@linux.intel.com> > > --- > > arch/x86/events/intel/core.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c > > index d879478db3f5..80a2a307e678 100644 > > --- a/arch/x86/events/intel/core.c > > +++ b/arch/x86/events/intel/core.c > > @@ -4906,7 +4906,8 @@ static void intel_pmu_check_hybrid_pmus(struct x86_hybrid_pmu *pmu) > > > > static struct x86_hybrid_pmu *find_hybrid_pmu_for_cpu(void) > > { > > - u8 cpu_type = get_this_hybrid_cpu_type(); > > + struct cpuinfo_x86 *c = &cpu_data(smp_processor_id()); > > + u8 cpu_type = topology_hw_cpu_type(c); > > int i; > > > > /* > > > > Dapeng's patch to utilize the native model ID in perf has been merged. > Please replace the get_this_hybrid_cpu_native_id() as well when you spin > a new version. Will do. Thanks for letting me know.
diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c index d879478db3f5..80a2a307e678 100644 --- a/arch/x86/events/intel/core.c +++ b/arch/x86/events/intel/core.c @@ -4906,7 +4906,8 @@ static void intel_pmu_check_hybrid_pmus(struct x86_hybrid_pmu *pmu) static struct x86_hybrid_pmu *find_hybrid_pmu_for_cpu(void) { - u8 cpu_type = get_this_hybrid_cpu_type(); + struct cpuinfo_x86 *c = &cpu_data(smp_processor_id()); + u8 cpu_type = topology_hw_cpu_type(c); int i; /*
get_this_hybrid_cpu_type() misses a case when cpu-type is populated regardless of X86_FEATURE_HYBRID_CPU. This is particularly true for hybrid variants that have P or E cores fused off. Instead use topology_hw_cpu_type() as it does not rely on hybrid feature to enumerate cpu-type. This can also help avoid the model-specific fixup get_hybrid_cpu_type(). Suggested-by: Dave Hansen <dave.hansen@linux.intel.com> Signed-off-by: Pawan Gupta <pawan.kumar.gupta@linux.intel.com> --- arch/x86/events/intel/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)