lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250412103434.5321-1-xry111@xry111.site>
Date: Sat, 12 Apr 2025 18:34:34 +0800
From: Xi Ruoyao <xry111@...111.site>
To: Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>,
	"Rafael J. Wysocki" <rafael@...nel.org>,
	Pawan Gupta <pawan.kumar.gupta@...ux.intel.com>,
	Dave Hansen <dave.hansen@...ux.intel.com>
Cc: linux-pm@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	Xi Ruoyao <xry111@...111.site>
Subject: [PATCH] cpufreq: intel_pstate: Use raw_smp_processor_id() in hwp_get_cpu_scaling()

Use raw_smp_processor_id() instead of plain smp_processor_id() in
hwp_get_cpu_scaling(), otherwise we get some errors on a Lenovo Thinkpad
T14P Gen 2:

    BUG: using smp_processor_id() in preemptible [00000000] code: swapper/0/1
    caller is hwp_get_cpu_scaling+0x7f/0xc0

Fixes: b52aaeeadfac ("cpufreq: intel_pstate: Avoid SMP calls to get cpu-type")
Signed-off-by: Xi Ruoyao <xry111@...111.site>
---
 drivers/cpufreq/intel_pstate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index 4aad79d26c64..bfc20b978240 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -2209,7 +2209,7 @@ static int knl_get_turbo_pstate(int cpu)
 static int hwp_get_cpu_scaling(int cpu)
 {
 	if (hybrid_scaling_factor) {
-		struct cpuinfo_x86 *c = &cpu_data(smp_processor_id());
+		struct cpuinfo_x86 *c = &cpu_data(raw_smp_processor_id());
 		u8 cpu_type = c->topo.intel_type;
 
 		/*
-- 
2.49.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ