summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhang Rui <rui.zhang@intel.com>2026-01-26 03:27:01 +0300
committerSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>2026-04-05 21:44:38 +0300
commitdf4a83543117c7fc27077fd7f4ffe870556b257b (patch)
treeb7bc2d9e6c3c40c0028464e8b5f53017a40f3c40
parentae67f582398611b9f67c06961e292e3a2612346d (diff)
downloadlinux-df4a83543117c7fc27077fd7f4ffe870556b257b.tar.xz
tools/power/x86/intel-speed-select: Fix cpu extended family ID decoding
When decode and use CPU extended family ID in intel-speed-select, there are several potential issues, 1. Mask with 0x0f to get CPU extended family ID is bogus because CPU extended family ID takes 8 bits (bit 27:20). 2. Use CPU extended family ID fields without checking CPU family ID is risky. Because Intel SDM says, "The Extended Family ID needs to be examined only when the Family ID is 0FH." 3. Saving cpu family ID and cpu extended family ID separately doesn't align with Linux kernel. And it may bring extra complexity when making family specific changes in the future. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
-rw-r--r--tools/power/x86/intel-speed-select/isst-config.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/tools/power/x86/intel-speed-select/isst-config.c b/tools/power/x86/intel-speed-select/isst-config.c
index 652ef1f567ad..3f2573ecca76 100644
--- a/tools/power/x86/intel-speed-select/isst-config.c
+++ b/tools/power/x86/intel-speed-select/isst-config.c
@@ -26,7 +26,7 @@ static FILE *outf;
static int cpu_model;
static int cpu_stepping;
-static int extended_family;
+static int cpu_family;
#define MAX_CPUS_IN_ONE_REQ 512
static short max_target_cpus;
@@ -158,7 +158,7 @@ int is_icx_platform(void)
static int is_dmr_plus_platform(void)
{
- if (extended_family == 0x04)
+ if (cpu_family == 19)
return 1;
return 0;
@@ -167,13 +167,14 @@ static int is_dmr_plus_platform(void)
static int update_cpu_model(void)
{
unsigned int ebx, ecx, edx;
- unsigned int fms, family;
+ unsigned int fms;
__cpuid(1, fms, ebx, ecx, edx);
- family = (fms >> 8) & 0xf;
- extended_family = (fms >> 20) & 0x0f;
+ cpu_family = (fms >> 8) & 0xf;
+ if (cpu_family == 0xf)
+ cpu_family += (fms >> 20) & 0xff;
cpu_model = (fms >> 4) & 0xf;
- if (family == 6 || family == 0xf)
+ if (cpu_family == 6 || cpu_family == 0xf)
cpu_model += ((fms >> 16) & 0xf) << 4;
cpu_stepping = fms & 0xf;