From patchwork Mon Sep 30 14:47:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pawan Gupta X-Patchwork-Id: 13816563 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C5B0A1922E3; Mon, 30 Sep 2024 14:47:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727707661; cv=none; b=Pd8wqZSeEVsGeJk5xz94fBP4mLYIZtOCQXo4k5N0qXR1mLyq7Z3zsSuPJSr1xlO5ApFR+p8MLlmzM82h4RpUmehzJUwzean8iFLgMiewsG0LKhwcKp3NyZxNeedlbWPDLfwCSobzE019iMBNC4iAqy9FPc6yz2M7FbZUr/AVdvs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727707661; c=relaxed/simple; bh=3H0Pv2AbKSkzILLHKezcebKGMxIoddDIM8V1OM1U4F4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=qNOAXNlFH06jxLF59cm73mtTIcpHBle8PzIgQdiGkhRJGUPjK1u3sqGJko/jickJFlXIlGBngJJXSfVNClaRlFizQYPCLz8pbaHRpqZsyj5n69hX7llEa/HKJIrf3Q/2VZvAm4gqje6hU/LdkV4XROnZ2ASfdAA1f8CpyqetVCk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=cssxK2ZV; arc=none smtp.client-ip=198.175.65.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="cssxK2ZV" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1727707659; x=1759243659; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=3H0Pv2AbKSkzILLHKezcebKGMxIoddDIM8V1OM1U4F4=; b=cssxK2ZVR2X1bSJ6LCI+1eSU5IdxnUdsR2ojrK+UfXm96O6t3QuC9Jl3 P0z7l7p/diEl7gDsDmeGgGZliHDqw8Ubju8fgB5otqmweoy05XC0u4Xj9 351YwVVqUayA8S3g0lZEoaiTx9zPDrhUQ+jBD3PT8oA5UjH93LH0owLfB 5A77zmdWpBjryGOnggLZhP15cxxSIU6jWid1rPzOa0Et9qzLIOu6xkunO rQebdWufbd5nr8nO5W2Xn4J5Z6CpKN6m6kFVwliZMis7q1uNqveBA4xNa iRuHVOABEhGGHa60RRtY0n8Iw/eN6MzRs15TdXoV80JEKkesqeWx8gpeV A==; X-CSE-ConnectionGUID: XM1ZMwmvTRufpPiF0OjYUA== X-CSE-MsgGUID: SDCGXDPsQSebhrcg1Z9V2Q== X-IronPort-AV: E=McAfee;i="6700,10204,11211"; a="38187341" X-IronPort-AV: E=Sophos;i="6.11,165,1725346800"; d="scan'208";a="38187341" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Sep 2024 07:47:39 -0700 X-CSE-ConnectionGUID: y+ir90N3RSCEp1HS206bSA== X-CSE-MsgGUID: t3XfTM1JRXO+aoviowi8/w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,165,1725346800"; d="scan'208";a="72996083" Received: from smkirkla-mobl.amr.corp.intel.com (HELO desk) ([10.125.147.240]) by fmviesa007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Sep 2024 07:47:38 -0700 Date: Mon, 30 Sep 2024 07:47:37 -0700 From: Pawan Gupta To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org Cc: daniel.sneddon@linux.intel.com, tony.luck@intel.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-perf-users@vger.kernel.org, Josh Poimboeuf , Srinivas Pandruvada , "Rafael J. Wysocki" , Ricardo Neri , "Liang, Kan" , Andrew Cooper , Brice Goglin , Mario Limonciello , Perry Yuan , Dapeng Mi Subject: [PATCH v4 04/10] perf/x86/intel: Use topology_hw_cpu_type() Message-ID: <20240930-add-cpu-type-v4-4-104892b7ab5f@linux.intel.com> X-Mailer: b4 0.14.1 References: <20240930-add-cpu-type-v4-0-104892b7ab5f@linux.intel.com> Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240930-add-cpu-type-v4-0-104892b7ab5f@linux.intel.com> 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 Signed-off-by: Pawan Gupta --- 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; /*