Skip to content

Commit f895f24

Browse files
committed
Merge branch 'intel-sst' of https://github.com/spandruvada/linux-kernel into review-ilpo-next
2 parents 6ad1b2d + 7dd5563 commit f895f24

File tree

3 files changed

+25
-10
lines changed

3 files changed

+25
-10
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: 15 additions & 7 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.22";
2020

2121
static const int supported_api_ver = 3;
2222
static struct isst_if_platform_info isst_platform_info;
@@ -46,8 +46,9 @@ static int force_online_offline;
4646
static int auto_mode;
4747
static int fact_enable_fail;
4848
static int cgroupv2;
49+
static int max_pkg_id;
4950
static int max_die_id;
50-
static int max_punit_id;
51+
static int max_die_id_package_0;
5152

5253
/* clos related */
5354
static int current_clos = -1;
@@ -557,18 +558,20 @@ void for_each_online_power_domain_in_set(void (*callback)(struct isst_id *, void
557558
if (id.pkg < 0 || id.die < 0 || id.punit < 0)
558559
continue;
559560

561+
id.die = id.die % (max_die_id_package_0 + 1);
562+
560563
valid_mask[id.pkg][id.die] = 1;
561564

562565
if (cpus[id.pkg][id.die][id.punit] == -1)
563566
cpus[id.pkg][id.die][id.punit] = i;
564567
}
565568

566569
for (i = 0; i < MAX_PACKAGE_COUNT; i++) {
567-
if (max_die_id == max_punit_id) {
570+
if (max_die_id > max_pkg_id) {
568571
for (k = 0; k < MAX_PUNIT_PER_DIE && k < MAX_DIE_PER_PACKAGE; k++) {
569572
id.cpu = cpus[i][k][k];
570573
id.pkg = i;
571-
id.die = k;
574+
id.die = get_physical_die_id(id.cpu);
572575
id.punit = k;
573576
if (isst_is_punit_valid(&id))
574577
callback(&id, arg1, arg2, arg3, arg4);
@@ -586,7 +589,10 @@ void for_each_online_power_domain_in_set(void (*callback)(struct isst_id *, void
586589
for (k = 0; k < MAX_PUNIT_PER_DIE; k++) {
587590
id.cpu = cpus[i][j][k];
588591
id.pkg = i;
589-
id.die = j;
592+
if (id.cpu >= 0)
593+
id.die = get_physical_die_id(id.cpu);
594+
else
595+
id.die = id.pkg;
590596
id.punit = k;
591597
if (isst_is_punit_valid(&id))
592598
callback(&id, arg1, arg2, arg3, arg4);
@@ -788,6 +794,8 @@ static void create_cpu_map(void)
788794
cpu_map[i].die_id = die_id;
789795
cpu_map[i].core_id = core_id;
790796

797+
if (max_pkg_id < pkg_id)
798+
max_pkg_id = pkg_id;
791799

792800
punit_id = 0;
793801

@@ -812,8 +820,8 @@ static void create_cpu_map(void)
812820
if (max_die_id < die_id)
813821
max_die_id = die_id;
814822

815-
if (max_punit_id < cpu_map[i].punit_id)
816-
max_punit_id = cpu_map[i].punit_id;
823+
if (!pkg_id && max_die_id_package_0 < die_id)
824+
max_die_id_package_0 = die_id;
817825

818826
debug_printf(
819827
"map logical_cpu:%d core: %d die:%d pkg:%d punit:%d punit_cpu:%d punit_core:%d\n",

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

Lines changed: 9 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);

0 commit comments

Comments
 (0)