Lines Matching +full:assoc +full:- +full:select

1 // SPDX-License-Identifier: GPL-2.0
3 * Intel Speed Select -- Enumerate and control features
51 static int current_clos = -1;
52 static int clos_epp = -1;
53 static int clos_prop_prio = -1;
54 static int clos_min = -1;
55 static int clos_max = -1;
56 static int clos_desired = -1;
121 /* only three CascadeLake-N models are supported */ in update_cpu_model()
130 err(-1, "cannot open /proc/cpuinfo\n"); in update_cpu_model()
175 return -1; in parse_int_file()
211 return -1; in get_stored_topology_info()
219 ret = -1; in get_stored_topology_info()
261 cpu_top.core_id = -1; in store_cpu_topology()
266 cpu_top.pkg_id = -1; in store_cpu_topology()
271 cpu_top.die_id = -1; in store_cpu_topology()
366 err(-1, "%s open failed", buffer); in set_cpu_online_offline()
374 if (ret == -1) in set_cpu_online_offline()
603 err(-1, "%s open failed", pathname); in create_cpu_map()
614 if (ioctl(fd, ISST_IF_GET_PHY_ID, &map) == -1) { in create_cpu_map()
649 return -EINVAL; in find_logical_cpu()
690 return -EINVAL; in find_phy_core_num()
705 err(-1, "%s open failed", pathname); in isst_send_mmio_command()
718 if (ioctl(fd, cmd, &io_regs) == -1) { in isst_send_mmio_command()
802 err(-1, "%s open failed", pathname); in isst_send_mbox_command()
807 if (ioctl(fd, ISST_IF_MBOX_COMMAND, &mbox_cmds) == -1) { in isst_send_mbox_command()
816 --retry; in isst_send_mbox_command()
830 return -1; in isst_send_mbox_command()
845 err(-1, "%s open failed", pathname); in isst_send_msr_command()
854 if (ioctl(fd, ISST_IF_MSR_COMMAND, &msr_cmds) == -1) { in isst_send_msr_command()
879 err(-1, "%s open failed", pathname); in isst_fill_platform_info()
881 if (ioctl(fd, ISST_IF_GET_PLATFORM_INFO, &isst_platform_info) == -1) { in isst_fill_platform_info()
884 return -1; in isst_fill_platform_info()
891 return -1; in isst_fill_platform_info()
924 fprintf(outf, "Intel(R) SST-PP (feature perf-profile) is supported\n"); in isst_print_extended_platform_info()
926 fprintf(outf, "Intel(R) SST-PP (feature perf-profile) is not supported\n"); in isst_print_extended_platform_info()
948 fprintf(outf, "Intel(R) SST-TF (feature turbo-freq) is supported\n"); in isst_print_extended_platform_info()
950 fprintf(outf, "Intel(R) SST-TF (feature turbo-freq) is not supported\n"); in isst_print_extended_platform_info()
953 fprintf(outf, "Intel(R) SST-BF (feature base-freq) is supported\n"); in isst_print_extended_platform_info()
955 fprintf(outf, "Intel(R) SST-BF (feature base-freq) is not supported\n"); in isst_print_extended_platform_info()
959 fprintf(outf, "Intel(R) SST-CP (feature core-power) is supported\n"); in isst_print_extended_platform_info()
961 fprintf(outf, "Intel(R) SST-CP (feature core-power) is not supported\n"); in isst_print_extended_platform_info()
977 err(-1, "%s open failed", pathname); in isst_print_platform_information()
979 if (ioctl(fd, ISST_IF_GET_PLATFORM_INFO, &platform_info) == -1) { in isst_print_platform_information()
1041 _get_tdp_level("get-config-levels", levels, levels, "Max TDP level", NULL, NULL);
1042 _get_tdp_level("get-config-version", levels, version, "TDP version", NULL, NULL);
1043 _get_tdp_level("get-config-enabled", levels, enabled, "perf-profile enable status", "disabled", "en…
1044 _get_tdp_level("get-config-current_level", levels, current_level,
1046 _get_tdp_level("get-lock-status", levels, locked, "TDP lock status", "unlocked", "locked");
1060 err(-1, "cannot open /proc/cpuinfo\n"); in clx_n_get_base_ratio()
1064 /* this is true for CascadeLake-N */ in clx_n_get_base_ratio()
1067 strncpy(number, begin, end - begin); in clx_n_get_base_ratio()
1086 pbf_info = &ctdp_level->pbf_info; in clx_n_config()
1087 ctdp_level->core_cpumask_size = in clx_n_config()
1088 alloc_cpu_set(&ctdp_level->core_cpumask); in clx_n_config()
1091 ctdp_level->tdp_ratio = clx_n_get_base_ratio(); in clx_n_config()
1092 if (ctdp_level->tdp_ratio == 0) { in clx_n_config()
1094 ret = -1; in clx_n_config()
1099 pbf_info->p1_high = 0; in clx_n_config()
1100 pbf_info->p1_low = ~0; in clx_n_config()
1113 CPU_SET_S(i, ctdp_level->core_cpumask_size, in clx_n_config()
1114 ctdp_level->core_cpumask); in clx_n_config()
1119 if (cpu_bf > pbf_info->p1_high) in clx_n_config()
1120 pbf_info->p1_high = cpu_bf; in clx_n_config()
1121 if (cpu_bf < pbf_info->p1_low) in clx_n_config()
1122 pbf_info->p1_low = cpu_bf; in clx_n_config()
1125 if (pbf_info->p1_high == ~0UL) { in clx_n_config()
1127 ret = -1; in clx_n_config()
1131 if (pbf_info->p1_low == 0) { in clx_n_config()
1133 ret = -1; in clx_n_config()
1138 pbf_info->p1_high = pbf_info->p1_high / 100000; in clx_n_config()
1139 pbf_info->p1_low = pbf_info->p1_low / 100000; in clx_n_config()
1142 pbf_info->core_cpumask_size = alloc_cpu_set(&pbf_info->core_cpumask); in clx_n_config()
1155 if (cpu_bf == pbf_info->p1_high) in clx_n_config()
1156 CPU_SET_S(i, pbf_info->core_cpumask_size, in clx_n_config()
1157 pbf_info->core_cpumask); in clx_n_config()
1161 ctdp_level->processed = 1; in clx_n_config()
1162 ctdp_level->pbf_support = 1; /* PBF is always supported and enabled */ in clx_n_config()
1163 ctdp_level->pbf_enabled = 1; in clx_n_config()
1164 ctdp_level->fact_support = 0; /* FACT is never supported */ in clx_n_config()
1165 ctdp_level->fact_enabled = 0; in clx_n_config()
1170 free_cpu_set(ctdp_level->core_cpumask); in clx_n_config()
1192 pbf_info = &ctdp_level->pbf_info; in dump_clx_n_config_for_cpu()
1195 free_cpu_set(ctdp_level->core_cpumask); in dump_clx_n_config_for_cpu()
1196 free_cpu_set(pbf_info->core_cpumask); in dump_clx_n_config_for_cpu()
1209 isst_display_error_info_message(1, "Failed to get perf-profile info on cpu", 1, cpu); in dump_isst_config_for_cpu()
1224 "Print Intel(R) Speed Select Technology Performance profile configuration\n"); in dump_isst_config()
1227 fprintf(stderr, "Optional: -l|--level : Specify tdp level\n"); in dump_isst_config()
1259 isst_display_result(cpu, outf, "perf-profile", "set_tdp_level", in set_tdp_level_for_cpu()
1297 "\t Arguments: -l|--level : Specify tdp level\n"); in set_tdp_level()
1299 "\t Optional Arguments: -o | online : online/offline for the tdp level\n"); in set_tdp_level()
1332 pbf_info = &ctdp_level->pbf_info; in clx_n_dump_pbf_config_for_cpu()
1334 free_cpu_set(ctdp_level->core_cpumask); in clx_n_dump_pbf_config_for_cpu()
1335 free_cpu_set(pbf_info->core_cpumask); in clx_n_dump_pbf_config_for_cpu()
1347 isst_display_error_info_message(1, "Failed to get base-freq info at this level", 1, tdp_level); in dump_pbf_config_for_cpu()
1362 "Print Intel(R) Speed Select Technology base frequency configuration for a TDP level\n"); in dump_pbf_config()
1364 "\tArguments: -l|--level : Specify tdp level\n"); in dump_pbf_config()
1430 if (ret == -1) { in set_cpufreq_scaling_min_max()
1453 pbf_info = &ctdp_level->pbf_info; in set_clx_pbf_cpufreq_scaling_min_max()
1454 freq_high = pbf_info->p1_high * 100000; in set_clx_pbf_cpufreq_scaling_min_max()
1455 freq_low = pbf_info->p1_low * 100000; in set_clx_pbf_cpufreq_scaling_min_max()
1464 if (CPU_ISSET_S(i, pbf_info->core_cpumask_size, in set_clx_pbf_cpufreq_scaling_min_max()
1465 pbf_info->core_cpumask)) in set_clx_pbf_cpufreq_scaling_min_max()
1483 return -1; in set_cpufreq_scaling_min_max_from_cpuinfo()
1515 if (ret == -1) { in set_cpufreq_scaling_min_max_from_cpuinfo()
1576 return -1; in set_core_priority_and_min()
1690 …isst_display_error_info_message(1, "base-freq feature is not present at this level", 1, pkg_dev.cu… in set_pbf_for_cpu()
1691 ret = -1; in set_pbf_for_cpu()
1720 isst_display_result(cpu, outf, "base-freq", "enable", in set_pbf_for_cpu()
1723 isst_display_result(cpu, outf, "base-freq", "disable", in set_pbf_for_cpu()
1734 "Enable Intel Speed Select Technology base frequency feature\n"); in set_pbf_enable()
1744 "\tOptional Arguments: -a|--auto : Use priority of cores to set core-power associations\n"); in set_pbf_enable()
1755 "Disable Intel Speed Select Technology base frequency feature\n"); in set_pbf_enable()
1757 "\tOptional Arguments: -a|--auto : Also disable core-power associations\n"); in set_pbf_enable()
1780 isst_display_error_info_message(1, "Failed to get turbo-freq info at this level", 1, tdp_level); in dump_fact_config_for_cpu()
1793 …"Print complete Intel Speed Select Technology turbo frequency configuration for a TDP level. Other… in dump_fact_config()
1795 "\tArguments: -l|--level : Specify tdp level\n"); in dump_fact_config()
1797 "\tArguments: -b|--bucket : Bucket index to dump\n"); in dump_fact_config()
1799 "\tArguments: -r|--trl-type : Specify trl type: sse|avx2|avx512\n"); in dump_fact_config()
1839 …isst_display_error_info_message(1, "turbo-freq feature is not present at this level", 1, pkg_dev.c… in set_fact_for_cpu()
1840 ret = -1; in set_fact_for_cpu()
1875 isst_display_result(cpu, outf, "turbo-freq", "enable", ret); in set_fact_for_cpu()
1881 isst_display_result(cpu, outf, "turbo-freq", "disable", ret); in set_fact_for_cpu()
1892 "Enable Intel Speed Select Technology Turbo frequency feature\n"); in set_fact_enable()
1894 "Optional: -t|--trl : Specify turbo ratio limit\n"); in set_fact_enable()
1896 "\tOptional Arguments: -a|--auto : Designate specified target CPUs with"); in set_fact_enable()
1898 "-C|--cpu option as as high priority using core-power feature\n"); in set_fact_enable()
1901 "Disable Intel Speed Select Technology turbo frequency feature\n"); in set_fact_enable()
1903 "Optional: -t|--trl : Specify turbo ratio limit\n"); in set_fact_enable()
1905 "\tOptional Arguments: -a|--auto : Also disable core-power associations\n"); in set_fact_enable()
1987 isst_display_result(-1, outf, "turbo-freq --auto", "enable", 0); in set_fact_enable()
1993 isst_display_result(i, outf, "turbo-freq --auto", "enable", ret); in set_fact_enable()
2011 isst_display_result(cpu, outf, "core-power", "enable", in enable_clos_qos_config()
2014 isst_display_result(cpu, outf, "core-power", "disable", in enable_clos_qos_config()
2025 "Enable core-power for a package/die\n"); in set_clos_enable()
2028 "\tClos Enable: Specify priority type with [--priority|-p]\n"); in set_clos_enable()
2033 "Disable core-power: [No command arguments are required]\n"); in set_clos_enable()
2040 "cpufreq subsystem and core-power enable will interfere with each other!\n"); in set_clos_enable()
2071 "Print Intel Speed Select Technology core power configuration\n"); in dump_clos_config()
2073 "\tArguments: [-c | --clos]: Specify clos id\n"); in dump_clos_config()
2113 "Print Intel Speed Select Technology core power information\n"); in dump_clos_info()
2114 fprintf(stderr, "\t Optionally specify targeted cpu id with [--cpu|-c]\n"); in dump_clos_info()
2147 isst_display_result(cpu, outf, "core-power", "config", ret); in set_clos_config_for_cpu()
2154 "Set core-power configuration for one of the four clos ids\n"); in set_clos_config()
2156 "\tSpecify targeted clos id with [--clos|-c]\n"); in set_clos_config()
2158 fprintf(stderr, "\tSpecify clos EPP with [--epp|-e]\n"); in set_clos_config()
2160 "\tSpecify clos Proportional Priority [--weight|-w]\n"); in set_clos_config()
2162 fprintf(stderr, "\tSpecify clos min in MHz with [--min|-n]\n"); in set_clos_config()
2163 fprintf(stderr, "\tSpecify clos max in MHz with [--max|-m]\n"); in set_clos_config()
2212 isst_display_result(cpu, outf, "core-power", "assoc", ret); in set_clos_assoc_for_cpu()
2220 "\tSpecify targeted clos id with [--clos|-c]\n"); in set_clos_assoc()
2224 "\tintel-speed-select --cpu 0 core-power assoc --clos 1\n"); in set_clos_assoc()
2236 isst_display_error_info_message(1, "Invalid target cpu. Specify with [-c|--cpu]", 0, 0); in set_clos_assoc()
2256 fprintf(stderr, "\tSpecify targeted cpu id with [--cpu|-c]\n"); in get_clos_assoc()
2261 isst_display_error_info_message(1, "Invalid target cpu. Specify with [-c|--cpu]", 0, 0); in get_clos_assoc()
2272 { "perf-profile", "info", dump_isst_config, 0 },
2273 { "base-freq", "info", dump_pbf_config, 0 },
2274 { "base-freq", "enable", set_pbf_enable, 1 },
2275 { "base-freq", "disable", set_pbf_enable, 0 },
2280 { "perf-profile", "get-lock-status", get_tdp_locked, 0 },
2281 { "perf-profile", "get-config-levels", get_tdp_levels, 0 },
2282 { "perf-profile", "get-config-version", get_tdp_version, 0 },
2283 { "perf-profile", "get-config-enabled", get_tdp_enabled, 0 },
2284 { "perf-profile", "get-config-current-level", get_tdp_current_level,
2286 { "perf-profile", "set-config-level", set_tdp_level, 0 },
2287 { "perf-profile", "info", dump_isst_config, 0 },
2288 { "base-freq", "info", dump_pbf_config, 0 },
2289 { "base-freq", "enable", set_pbf_enable, 1 },
2290 { "base-freq", "disable", set_pbf_enable, 0 },
2291 { "turbo-freq", "info", dump_fact_config, 0 },
2292 { "turbo-freq", "enable", set_fact_enable, 1 },
2293 { "turbo-freq", "disable", set_fact_enable, 0 },
2294 { "core-power", "info", dump_clos_info, 0 },
2295 { "core-power", "enable", set_clos_enable, 1 },
2296 { "core-power", "disable", set_clos_enable, 0 },
2297 { "core-power", "config", set_clos_config, 0 },
2298 { "core-power", "get-config", dump_clos_config, 0 },
2299 { "core-power", "assoc", set_clos_assoc, 0 },
2300 { "core-power", "get-assoc", get_clos_assoc, 0 },
2306 * 1,2,4..6,8-10 and set bits in cpu_subset
2316 if (*next == '-') /* no negative cpu numbers */ in parse_cpu_command()
2332 if (*next == '-') { in parse_cpu_command()
2368 fprintf(stderr, "\"--cpu %s\" malformed\n", optarg); in parse_cpu_command()
2369 exit(-1); in parse_cpu_command()
2381 { "trl-type", required_argument, 0, 'r' }, in parse_cmd_args()
2399 long_options, &option_index)) != -1) { in parse_cmd_args()
2479 printf("perf-profile:\tAn architectural mechanism that allows multiple optimized \n\ in isst_help()
2483 printf("\nCommands : For feature=perf-profile\n"); in isst_help()
2487 printf("\tget-lock-status\n"); in isst_help()
2488 printf("\tget-config-levels\n"); in isst_help()
2489 printf("\tget-config-version\n"); in isst_help()
2490 printf("\tget-config-enabled\n"); in isst_help()
2491 printf("\tget-config-current-level\n"); in isst_help()
2492 printf("\tset-config-level\n"); in isst_help()
2498 printf("base-freq:\tEnables users to increase guaranteed base frequency\n\ in pbf_help()
2508 printf("turbo-freq:\tEnables the ability to set different turbo ratio\n\ in fact_help()
2510 printf("\nCommand: For feature=turbo-freq\n"); in fact_help()
2518 printf("core-power:\tInterface that allows user to define per core/tile\n\ in core_power_help()
2520 printf("\nCommands : For feature=core-power\n"); in core_power_help()
2525 printf("\tget-config\n"); in core_power_help()
2527 printf("\tget-assoc\n"); in core_power_help()
2536 { "perf-profile", isst_help },
2537 { "base-freq", pbf_help },
2538 { "turbo-freq", fact_help },
2539 { "core-power", core_power_help },
2544 { "perf-profile", isst_help },
2545 { "base-freq", pbf_help },
2561 if (!strcmp(cmd, "-h") || !strcmp(cmd, "--help")) { in process_command()
2593 fprintf(stderr, "\nThere is limited support of Intel Speed Select features on this platform.\n"); in usage()
2594 …fprintf(stderr, "Everything is pre-configured using BIOS options, this tool can't enable any featu… in usage()
2598 printf("intel-speed-select [OPTIONS] FEATURE COMMAND COMMAND_ARGUMENTS\n"); in usage()
2599 printf("\nUse this tool to enumerate and control the Intel Speed Select Technology features:\n"); in usage()
2601 printf("\nFEATURE : [perf-profile|base-freq]\n"); in usage()
2603 printf("\nFEATURE : [perf-profile|base-freq|turbo-freq|core-power]\n"); in usage()
2604 printf("\nFor help on each feature, use -h|--help\n"); in usage()
2605 printf("\tFor example: intel-speed-select perf-profile -h\n"); in usage()
2607 printf("\nFor additional help on each command for a feature, use --h|--help\n"); in usage()
2608 printf("\tFor example: intel-speed-select perf-profile get-lock-status -h\n"); in usage()
2609 …printf("\t\t This will print help for the command \"get-lock-status\" for the feature \"perf-profi… in usage()
2612 printf("\t[-c|--cpu] : logical cpu number\n"); in usage()
2615 printf("\t[-d|--debug] : Debug mode\n"); in usage()
2616 printf("\t[-f|--format] : output format [json|text]. Default: text\n"); in usage()
2617 printf("\t[-h|--help] : Print help\n"); in usage()
2618 printf("\t[-i|--info] : Print platform information\n"); in usage()
2619 printf("\t[-o|--out] : Output file\n"); in usage()
2621 printf("\t[-p|--pause] : Delay between two mail box commands in milliseconds\n"); in usage()
2622 printf("\t[-r|--retry] : Retry count for mail box commands on failure, default 3\n"); in usage()
2623 printf("\t[-v|--version] : Print version\n"); in usage()
2632 printf("\t\tintel-speed-select --info\n"); in usage()
2633 printf("\tTo get full perf-profile information dump:\n"); in usage()
2634 printf("\t\tintel-speed-select perf-profile info\n"); in usage()
2635 printf("\tTo get full base-freq information dump:\n"); in usage()
2636 printf("\t\tintel-speed-select base-freq info -l 0\n"); in usage()
2638 printf("\tTo get full turbo-freq information dump:\n"); in usage()
2639 printf("\t\tintel-speed-select turbo-freq info -l 0\n"); in usage()
2680 err(-1, "Invalid CPU model (%d)\n", cpu_model); in cmdline()
2681 printf("Intel(R) Speed Select Technology\n"); in cmdline()
2687 fprintf(stderr, "Intel speed select drivers are not loaded on this system.\n"); in cmdline()
2697 &option_index)) != -1) { in cmdline()
2743 if (optind > (argc - 2)) { in cmdline()