mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-25 23:02:51 -04:00
Merge branch 'intel-sst' of https://github.com/spandruvada/linux-kernel into review-ilpo-next
This commit is contained in:
@@ -16,7 +16,7 @@ struct process_cmd_struct {
|
||||
int arg;
|
||||
};
|
||||
|
||||
static const char *version_str = "v1.25";
|
||||
static const char *version_str = "v1.26";
|
||||
|
||||
static const int supported_api_ver = 3;
|
||||
static struct isst_if_platform_info isst_platform_info;
|
||||
@@ -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;
|
||||
@@ -82,6 +82,11 @@ struct cpu_topology {
|
||||
|
||||
static int read_only;
|
||||
|
||||
static void print_version(void)
|
||||
{
|
||||
fprintf(outf, "Version %s\n", version_str);
|
||||
}
|
||||
|
||||
static void check_privilege(void)
|
||||
{
|
||||
if (!read_only)
|
||||
@@ -158,7 +163,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 +172,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;
|
||||
@@ -1137,8 +1143,9 @@ static int isst_fill_platform_info(void)
|
||||
close(fd);
|
||||
|
||||
if (isst_platform_info.api_version > supported_api_ver) {
|
||||
print_version();
|
||||
printf("Incompatible API versions; Upgrade of tool is required\n");
|
||||
return -1;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
set_platform_ops:
|
||||
@@ -1744,6 +1751,9 @@ static int no_turbo(void)
|
||||
return parse_int_file(0, "/sys/devices/system/cpu/intel_pstate/no_turbo");
|
||||
}
|
||||
|
||||
#define U32_MAX ((unsigned int)~0U)
|
||||
#define S32_MAX ((int)(U32_MAX >> 1))
|
||||
|
||||
static void adjust_scaling_max_from_base_freq(int cpu)
|
||||
{
|
||||
int base_freq, scaling_max_freq;
|
||||
@@ -1751,7 +1761,7 @@ static void adjust_scaling_max_from_base_freq(int cpu)
|
||||
scaling_max_freq = parse_int_file(0, "/sys/devices/system/cpu/cpu%d/cpufreq/scaling_max_freq", cpu);
|
||||
base_freq = get_cpufreq_base_freq(cpu);
|
||||
if (scaling_max_freq < base_freq || no_turbo())
|
||||
set_cpufreq_scaling_min_max(cpu, 1, base_freq);
|
||||
set_cpufreq_scaling_min_max(cpu, 1, S32_MAX);
|
||||
}
|
||||
|
||||
static void adjust_scaling_min_from_base_freq(int cpu)
|
||||
@@ -3191,12 +3201,6 @@ static void usage(void)
|
||||
printf("\tTo get full turbo-freq information dump:\n");
|
||||
printf("\t\tintel-speed-select turbo-freq info -l 0\n");
|
||||
}
|
||||
exit(1);
|
||||
}
|
||||
|
||||
static void print_version(void)
|
||||
{
|
||||
fprintf(outf, "Version %s\n", version_str);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
@@ -3246,8 +3250,10 @@ static void cmdline(int argc, char **argv)
|
||||
}
|
||||
|
||||
ret = update_cpu_model();
|
||||
if (ret)
|
||||
err(-1, "Invalid CPU model (%d)\n", cpu_model);
|
||||
if (ret) {
|
||||
fprintf(stderr, "Invalid CPU model (%d)\n", cpu_model);
|
||||
exit(1);
|
||||
}
|
||||
printf("Intel(R) Speed Select Technology\n");
|
||||
printf("Executing on CPU model:%d[0x%x]\n", cpu_model, cpu_model);
|
||||
|
||||
@@ -3311,6 +3317,7 @@ static void cmdline(int argc, char **argv)
|
||||
break;
|
||||
case 'v':
|
||||
print_version();
|
||||
exit(0);
|
||||
break;
|
||||
case 'b':
|
||||
oob_mode = 1;
|
||||
|
||||
Reference in New Issue
Block a user