Skip to content

Commit 2809ab7

Browse files
author
CKI KWF Bot
committed
Merge: Update intel-speed-select to upstream 6.17
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/7576 JIRA: https://issues.redhat.com/browse/RHEL-125240 This tool needs to be updated on a regular basis (once per release). Signed-off-by: David Arcari <darcari@redhat.com> Approved-by: Steve Best <sbest@redhat.com> Approved-by: Tony Camuso <tcamuso@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: CKI GitLab Kmaint Pipeline Bot <26919896-cki-kmaint-pipeline-bot@users.noreply.gitlab.com>
2 parents 52d3709 + e9a1a13 commit 2809ab7

File tree

5 files changed

+72
-11
lines changed

5 files changed

+72
-11
lines changed

tools/power/x86/intel-speed-select/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ endif
1313
# Do not use make's built-in rules
1414
# (this improves performance and avoids hard-to-debug behaviour);
1515
MAKEFLAGS += -r
16-
override CFLAGS += -O2 -Wall -g -D_GNU_SOURCE -I$(OUTPUT)include -I/usr/include/libnl3
16+
override CFLAGS += -O2 -Wall -g -D_GNU_SOURCE -I$(OUTPUT)include -I$(shell $(CC) -print-sysroot)/usr/include/libnl3
1717
override LDFLAGS += -lnl-genl-3 -lnl-3
1818

1919
ALL_TARGETS := intel-speed-select

tools/power/x86/intel-speed-select/isst-config.c

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ struct process_cmd_struct {
1616
int arg;
1717
};
1818

19-
static const char *version_str = "v1.21";
19+
static const char *version_str = "v1.23";
2020

2121
static const int supported_api_ver = 3;
2222
static struct isst_if_platform_info isst_platform_info;
@@ -26,6 +26,7 @@ static FILE *outf;
2626

2727
static int cpu_model;
2828
static int cpu_stepping;
29+
static int extended_family;
2930

3031
#define MAX_CPUS_IN_ONE_REQ 512
3132
static short max_target_cpus;
@@ -46,8 +47,9 @@ static int force_online_offline;
4647
static int auto_mode;
4748
static int fact_enable_fail;
4849
static int cgroupv2;
50+
static int max_pkg_id;
4951
static int max_die_id;
50-
static int max_punit_id;
52+
static int max_die_id_package_0;
5153

5254
/* clos related */
5355
static int current_clos = -1;
@@ -142,13 +144,22 @@ int is_icx_platform(void)
142144
return 0;
143145
}
144146

147+
static int is_dmr_plus_platform(void)
148+
{
149+
if (extended_family == 0x04)
150+
return 1;
151+
152+
return 0;
153+
}
154+
145155
static int update_cpu_model(void)
146156
{
147157
unsigned int ebx, ecx, edx;
148158
unsigned int fms, family;
149159

150160
__cpuid(1, fms, ebx, ecx, edx);
151161
family = (fms >> 8) & 0xf;
162+
extended_family = (fms >> 20) & 0x0f;
152163
cpu_model = (fms >> 4) & 0xf;
153164
if (family == 6 || family == 0xf)
154165
cpu_model += ((fms >> 16) & 0xf) << 4;
@@ -557,18 +568,20 @@ void for_each_online_power_domain_in_set(void (*callback)(struct isst_id *, void
557568
if (id.pkg < 0 || id.die < 0 || id.punit < 0)
558569
continue;
559570

571+
id.die = id.die % (max_die_id_package_0 + 1);
572+
560573
valid_mask[id.pkg][id.die] = 1;
561574

562575
if (cpus[id.pkg][id.die][id.punit] == -1)
563576
cpus[id.pkg][id.die][id.punit] = i;
564577
}
565578

566579
for (i = 0; i < MAX_PACKAGE_COUNT; i++) {
567-
if (max_die_id == max_punit_id) {
580+
if (max_die_id > max_pkg_id) {
568581
for (k = 0; k < MAX_PUNIT_PER_DIE && k < MAX_DIE_PER_PACKAGE; k++) {
569582
id.cpu = cpus[i][k][k];
570583
id.pkg = i;
571-
id.die = k;
584+
id.die = get_physical_die_id(id.cpu);
572585
id.punit = k;
573586
if (isst_is_punit_valid(&id))
574587
callback(&id, arg1, arg2, arg3, arg4);
@@ -586,7 +599,10 @@ void for_each_online_power_domain_in_set(void (*callback)(struct isst_id *, void
586599
for (k = 0; k < MAX_PUNIT_PER_DIE; k++) {
587600
id.cpu = cpus[i][j][k];
588601
id.pkg = i;
589-
id.die = j;
602+
if (id.cpu >= 0)
603+
id.die = get_physical_die_id(id.cpu);
604+
else
605+
id.die = id.pkg;
590606
id.punit = k;
591607
if (isst_is_punit_valid(&id))
592608
callback(&id, arg1, arg2, arg3, arg4);
@@ -788,6 +804,8 @@ static void create_cpu_map(void)
788804
cpu_map[i].die_id = die_id;
789805
cpu_map[i].core_id = core_id;
790806

807+
if (max_pkg_id < pkg_id)
808+
max_pkg_id = pkg_id;
791809

792810
punit_id = 0;
793811

@@ -812,8 +830,8 @@ static void create_cpu_map(void)
812830
if (max_die_id < die_id)
813831
max_die_id = die_id;
814832

815-
if (max_punit_id < cpu_map[i].punit_id)
816-
max_punit_id = cpu_map[i].punit_id;
833+
if (!pkg_id && max_die_id_package_0 < die_id)
834+
max_die_id_package_0 = die_id;
817835

818836
debug_printf(
819837
"map logical_cpu:%d core: %d die:%d pkg:%d punit:%d punit_cpu:%d punit_core:%d\n",
@@ -1509,7 +1527,8 @@ static void set_tdp_level_for_cpu(struct isst_id *id, void *arg1, void *arg2, vo
15091527
usleep(2000);
15101528

15111529
/* Adjusting uncore freq */
1512-
isst_adjust_uncore_freq(id, tdp_level, &ctdp_level);
1530+
if (!is_dmr_plus_platform())
1531+
isst_adjust_uncore_freq(id, tdp_level, &ctdp_level);
15131532

15141533
fprintf(stderr, "Option is set to online/offline\n");
15151534
ctdp_level.core_cpumask_size =

tools/power/x86/intel-speed-select/isst-core-tpmi.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ static int tpmi_get_ctdp_control(struct isst_id *id, int config_index,
227227
static int tpmi_get_tdp_info(struct isst_id *id, int config_index,
228228
struct isst_pkg_ctdp_level_info *ctdp_level)
229229
{
230+
struct isst_perf_level_fabric_info fabric_info;
230231
struct isst_perf_level_data_info info;
231232
int ret;
232233

@@ -253,6 +254,17 @@ static int tpmi_get_tdp_info(struct isst_id *id, int config_index,
253254
ctdp_level->uncore_p1 = info.p1_fabric_freq_mhz;
254255
ctdp_level->uncore_pm = info.pm_fabric_freq_mhz;
255256

257+
fabric_info.socket_id = id->pkg;
258+
fabric_info.power_domain_id = id->punit;
259+
fabric_info.level = config_index;
260+
261+
ret = tpmi_process_ioctl(ISST_IF_GET_PERF_LEVEL_FABRIC_INFO, &fabric_info);
262+
if (ret != -1) {
263+
ctdp_level->uncore1_p0 = fabric_info.p0_fabric_freq_mhz[1];
264+
ctdp_level->uncore1_p1 = fabric_info.p1_fabric_freq_mhz[1];
265+
ctdp_level->uncore1_pm = fabric_info.pm_fabric_freq_mhz[1];
266+
}
267+
256268
debug_printf
257269
("cpu:%d ctdp:%d CONFIG_TDP_GET_TDP_INFO tdp_ratio:%d pkg_tdp:%d ctdp_level->t_proc_hot:%d\n",
258270
id->cpu, config_index, ctdp_level->tdp_ratio, ctdp_level->pkg_tdp,

tools/power/x86/intel-speed-select/isst-display.c

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,11 @@ static int print_package_info(struct isst_id *id, FILE *outf)
173173

174174
if (out_format_is_json()) {
175175
if (api_version() > 1) {
176-
if (id->cpu < 0)
176+
if (id->die < 0 && id->cpu < 0)
177+
snprintf(header, sizeof(header),
178+
"package-%d:die-IO:powerdomain-%d:cpu-None",
179+
id->pkg, id->punit);
180+
else if (id->cpu < 0)
177181
snprintf(header, sizeof(header),
178182
"package-%d:die-%d:powerdomain-%d:cpu-None",
179183
id->pkg, id->die, id->punit);
@@ -190,7 +194,10 @@ static int print_package_info(struct isst_id *id, FILE *outf)
190194
}
191195
snprintf(header, sizeof(header), "package-%d", id->pkg);
192196
format_and_print(outf, level++, header, NULL);
193-
snprintf(header, sizeof(header), "die-%d", id->die);
197+
if (id->die < 0)
198+
snprintf(header, sizeof(header), "die-IO");
199+
else
200+
snprintf(header, sizeof(header), "die-%d", id->die);
194201
format_and_print(outf, level++, header, NULL);
195202
if (api_version() > 1) {
196203
snprintf(header, sizeof(header), "powerdomain-%d", id->punit);
@@ -453,6 +460,26 @@ void isst_ctdp_display_information(struct isst_id *id, FILE *outf, int tdp_level
453460
format_and_print(outf, level + 2, header, value);
454461
}
455462

463+
if (ctdp_level->uncore1_p1) {
464+
snprintf(header, sizeof(header), "uncore-1-frequency-base(MHz)");
465+
snprintf(value, sizeof(value), "%d",
466+
ctdp_level->uncore1_p1 * isst_get_disp_freq_multiplier());
467+
format_and_print(outf, level + 2, header, value);
468+
}
469+
if (ctdp_level->uncore1_pm) {
470+
snprintf(header, sizeof(header), "uncore-1-frequency-min(MHz)");
471+
snprintf(value, sizeof(value), "%d",
472+
ctdp_level->uncore1_pm * isst_get_disp_freq_multiplier());
473+
format_and_print(outf, level + 2, header, value);
474+
}
475+
476+
if (ctdp_level->uncore1_p0) {
477+
snprintf(header, sizeof(header), "uncore-1-frequency-max(MHz)");
478+
snprintf(value, sizeof(value), "%d",
479+
ctdp_level->uncore1_p0 * isst_get_disp_freq_multiplier());
480+
format_and_print(outf, level + 2, header, value);
481+
}
482+
456483
if (ctdp_level->mem_freq) {
457484
snprintf(header, sizeof(header), "max-mem-frequency(MHz)");
458485
snprintf(value, sizeof(value), "%d",

tools/power/x86/intel-speed-select/isst.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,9 @@ struct isst_pkg_ctdp_level_info {
147147
int uncore_p0;
148148
int uncore_p1;
149149
int uncore_pm;
150+
int uncore1_p0;
151+
int uncore1_p1;
152+
int uncore1_pm;
150153
int sse_p1;
151154
int avx2_p1;
152155
int avx512_p1;

0 commit comments

Comments
 (0)