mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH][RFC] platform/x86: intel_speed_select: Use static_cpu_has for HWP check
@ 2026-02-28  3:51 lirongqing
  2026-02-28  6:57 ` 答复: " Li,Rongqing(ACG CCN)
  2026-02-28  7:01 ` srinivas pandruvada
  0 siblings, 2 replies; 5+ messages in thread
From: lirongqing @ 2026-02-28  3:51 UTC (permalink / raw)
  To: Srinivas Pandruvada, Hans de Goede, Ilpo Järvinen,
	platform-driver-x86, linux-kernel
  Cc: Li RongQing

From: Li RongQing <lirongqing@baidu.com>

The current implementation of disable_dynamic_sst_features() reads
MSR_PM_ENABLE to check if HWP is enabled. This can be optimized by
using static_cpu_has(X86_FEATURE_HWP), which is the standard way
in the kernel to check for HWP support without the overhead of
an MSR read.

Replace the MSR read with static_cpu_has().

Signed-off-by: Li RongQing <lirongqing@baidu.com>
---
 drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c b/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c
index b8cdaa2..416620b 100644
--- a/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c
+++ b/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c
@@ -556,10 +556,7 @@ static struct tpmi_per_power_domain_info *get_instance(int pkg_id, int power_dom
 
 static bool disable_dynamic_sst_features(void)
 {
-	u64 value;
-
-	rdmsrq(MSR_PM_ENABLE, value);
-	return !(value & 0x1);
+	return !static_cpu_has(X86_FEATURE_HWP);
 }
 
 #define _read_cp_info(name_str, name, offset, start, width, mult_factor)\
-- 
2.9.4


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-02-28  7:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-28  3:51 [PATCH][RFC] platform/x86: intel_speed_select: Use static_cpu_has for HWP check lirongqing
2026-02-28  6:57 ` 答复: " Li,Rongqing(ACG CCN)
2026-02-28  7:02   ` srinivas pandruvada
2026-02-28  7:01 ` srinivas pandruvada
2026-02-28  7:22   ` 答复: [外部邮件] " Li,Rongqing(ACG CCN)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®