Lines Matching +full:turbo +full:- +full:mode
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;
137 /* only three CascadeLake-N models are supported */ in update_cpu_model()
146 err(-1, "cannot open /proc/cpuinfo\n"); in update_cpu_model()
165 static FILE *fopen_or_exit(const char *path, const char *mode) in fopen_or_exit() argument
167 FILE *filep = fopen(path, mode); in fopen_or_exit()
191 return -1; in parse_int_file()
227 return -1; in get_stored_topology_info()
235 ret = -1; in get_stored_topology_info()
277 cpu_top.core_id = -1; in store_cpu_topology()
282 cpu_top.pkg_id = -1; in store_cpu_topology()
287 cpu_top.die_id = -1; in store_cpu_topology()
386 err(-1, "%s open failed", buffer); in set_cpu_online_offline()
394 if (ret == -1) in set_cpu_online_offline()
635 err(-1, "%s open failed", pathname); in create_cpu_map()
646 if (ioctl(fd, ISST_IF_GET_PHY_ID, &map) == -1) { in create_cpu_map()
681 return -EINVAL; in find_logical_cpu()
722 return -EINVAL; in find_phy_core_num()
737 err(-1, "%s open failed", pathname); in isst_send_mmio_command()
750 if (ioctl(fd, cmd, &io_regs) == -1) { in isst_send_mmio_command()
834 err(-1, "%s open failed", pathname); in isst_send_mbox_command()
839 if (ioctl(fd, ISST_IF_MBOX_COMMAND, &mbox_cmds) == -1) { in isst_send_mbox_command()
848 --retry; in isst_send_mbox_command()
862 return -1; in isst_send_mbox_command()
877 err(-1, "%s open failed", pathname); in isst_send_msr_command()
886 if (ioctl(fd, ISST_IF_MSR_COMMAND, &msr_cmds) == -1) { in isst_send_msr_command()
911 err(-1, "%s open failed", pathname); in isst_fill_platform_info()
913 if (ioctl(fd, ISST_IF_GET_PLATFORM_INFO, &isst_platform_info) == -1) { in isst_fill_platform_info()
916 return -1; in isst_fill_platform_info()
923 return -1; in isst_fill_platform_info()
956 fprintf(outf, "Intel(R) SST-PP (feature perf-profile) is supported\n"); in isst_print_extended_platform_info()
958 fprintf(outf, "Intel(R) SST-PP (feature perf-profile) is not supported\n"); in isst_print_extended_platform_info()
980 fprintf(outf, "Intel(R) SST-TF (feature turbo-freq) is supported\n"); in isst_print_extended_platform_info()
982 fprintf(outf, "Intel(R) SST-TF (feature turbo-freq) is not supported\n"); in isst_print_extended_platform_info()
985 fprintf(outf, "Intel(R) SST-BF (feature base-freq) is supported\n"); in isst_print_extended_platform_info()
987 fprintf(outf, "Intel(R) SST-BF (feature base-freq) is not supported\n"); in isst_print_extended_platform_info()
991 fprintf(outf, "Intel(R) SST-CP (feature core-power) status is unknown\n"); in isst_print_extended_platform_info()
995 fprintf(outf, "Intel(R) SST-CP (feature core-power) is supported\n"); in isst_print_extended_platform_info()
997 fprintf(outf, "Intel(R) SST-CP (feature core-power) is not supported\n"); in isst_print_extended_platform_info()
1013 err(-1, "%s open failed", pathname); in isst_print_platform_information()
1015 if (ioctl(fd, ISST_IF_GET_PLATFORM_INFO, &platform_info) == -1) { in isst_print_platform_information()
1077 _get_tdp_level("get-config-levels", levels, levels, "Max TDP level", NULL, NULL);
1078 _get_tdp_level("get-config-version", levels, version, "TDP version", NULL, NULL);
1079 _get_tdp_level("get-config-enabled", levels, enabled, "perf-profile enable status", "disabled", "en…
1080 _get_tdp_level("get-config-current_level", levels, current_level,
1082 _get_tdp_level("get-lock-status", levels, locked, "TDP lock status", "unlocked", "locked");
1096 err(-1, "cannot open /proc/cpuinfo\n"); in clx_n_get_base_ratio()
1100 /* this is true for CascadeLake-N */ in clx_n_get_base_ratio()
1103 strncpy(number, begin, end - begin); in clx_n_get_base_ratio()
1122 pbf_info = &ctdp_level->pbf_info; in clx_n_config()
1123 ctdp_level->core_cpumask_size = in clx_n_config()
1124 alloc_cpu_set(&ctdp_level->core_cpumask); in clx_n_config()
1127 ctdp_level->tdp_ratio = clx_n_get_base_ratio(); in clx_n_config()
1128 if (ctdp_level->tdp_ratio == 0) { in clx_n_config()
1130 ret = -1; in clx_n_config()
1135 pbf_info->p1_high = 0; in clx_n_config()
1136 pbf_info->p1_low = ~0; in clx_n_config()
1149 CPU_SET_S(i, ctdp_level->core_cpumask_size, in clx_n_config()
1150 ctdp_level->core_cpumask); in clx_n_config()
1155 if (cpu_bf > pbf_info->p1_high) in clx_n_config()
1156 pbf_info->p1_high = cpu_bf; in clx_n_config()
1157 if (cpu_bf < pbf_info->p1_low) in clx_n_config()
1158 pbf_info->p1_low = cpu_bf; in clx_n_config()
1161 if (pbf_info->p1_high == ~0UL) { in clx_n_config()
1163 ret = -1; in clx_n_config()
1167 if (pbf_info->p1_low == 0) { in clx_n_config()
1169 ret = -1; in clx_n_config()
1174 pbf_info->p1_high = pbf_info->p1_high / 100000; in clx_n_config()
1175 pbf_info->p1_low = pbf_info->p1_low / 100000; in clx_n_config()
1178 pbf_info->core_cpumask_size = alloc_cpu_set(&pbf_info->core_cpumask); in clx_n_config()
1191 if (cpu_bf == pbf_info->p1_high) in clx_n_config()
1192 CPU_SET_S(i, pbf_info->core_cpumask_size, in clx_n_config()
1193 pbf_info->core_cpumask); in clx_n_config()
1197 ctdp_level->processed = 1; in clx_n_config()
1198 ctdp_level->pbf_support = 1; /* PBF is always supported and enabled */ in clx_n_config()
1199 ctdp_level->pbf_enabled = 1; in clx_n_config()
1200 ctdp_level->fact_support = 0; /* FACT is never supported */ in clx_n_config()
1201 ctdp_level->fact_enabled = 0; in clx_n_config()
1206 free_cpu_set(ctdp_level->core_cpumask); in clx_n_config()
1228 pbf_info = &ctdp_level->pbf_info; in dump_clx_n_config_for_cpu()
1231 free_cpu_set(ctdp_level->core_cpumask); in dump_clx_n_config_for_cpu()
1232 free_cpu_set(pbf_info->core_cpumask); in dump_clx_n_config_for_cpu()
1245 isst_display_error_info_message(1, "Failed to get perf-profile info on cpu", 1, cpu); in dump_isst_config_for_cpu()
1262 "including base frequency and turbo frequency configurations\n"); in dump_isst_config()
1263 fprintf(stderr, "Optional: -l|--level : Specify tdp level\n"); in dump_isst_config()
1297 isst_display_result(cpu, outf, "perf-profile", "set_tdp_level", in set_tdp_level_for_cpu()
1339 "\t Arguments: -l|--level : Specify tdp level\n"); in set_tdp_level()
1341 "\t Optional Arguments: -o | online : online/offline for the tdp level\n"); in set_tdp_level()
1374 pbf_info = &ctdp_level->pbf_info; in clx_n_dump_pbf_config_for_cpu()
1376 free_cpu_set(ctdp_level->core_cpumask); in clx_n_dump_pbf_config_for_cpu()
1377 free_cpu_set(pbf_info->core_cpumask); in clx_n_dump_pbf_config_for_cpu()
1389 isst_display_error_info_message(1, "Failed to get base-freq info at this level", 1, tdp_level); in dump_pbf_config_for_cpu()
1406 "\tArguments: -l|--level : Specify tdp level\n"); in dump_pbf_config()
1472 if (ret == -1) { in set_cpufreq_scaling_min_max()
1520 pbf_info = &ctdp_level->pbf_info; in set_clx_pbf_cpufreq_scaling_min_max()
1521 freq_high = pbf_info->p1_high * 100000; in set_clx_pbf_cpufreq_scaling_min_max()
1522 freq_low = pbf_info->p1_low * 100000; in set_clx_pbf_cpufreq_scaling_min_max()
1531 if (CPU_ISSET_S(i, pbf_info->core_cpumask_size, in set_clx_pbf_cpufreq_scaling_min_max()
1532 pbf_info->core_cpumask)) in set_clx_pbf_cpufreq_scaling_min_max()
1550 return -1; in set_cpufreq_scaling_min_max_from_cpuinfo()
1582 if (ret == -1) { in set_cpufreq_scaling_min_max_from_cpuinfo()
1644 return -1; in set_core_priority_and_min()
1758 …isst_display_error_info_message(1, "base-freq feature is not present at this level", 1, pkg_dev.cu… in set_pbf_for_cpu()
1759 ret = -1; in set_pbf_for_cpu()
1788 isst_display_result(cpu, outf, "base-freq", "enable", in set_pbf_for_cpu()
1791 isst_display_result(cpu, outf, "base-freq", "disable", in set_pbf_for_cpu()
1812 "\tOptional Arguments: -a|--auto : Use priority of cores to set core-power associations\n"); in set_pbf_enable()
1825 "\tOptional Arguments: -a|--auto : Also disable core-power associations\n"); in set_pbf_enable()
1848 isst_display_error_info_message(1, "Failed to get turbo-freq info at this level", 1, tdp_level); in dump_fact_config_for_cpu()
1861 …"Print complete Intel Speed Select Technology turbo frequency configuration for a TDP level. Other… in dump_fact_config()
1863 "\tArguments: -l|--level : Specify tdp level\n"); in dump_fact_config()
1865 "\tArguments: -b|--bucket : Bucket index to dump\n"); in dump_fact_config()
1867 "\tArguments: -r|--trl-type : Specify trl type: sse|avx2|avx512\n"); in dump_fact_config()
1907 …isst_display_error_info_message(1, "turbo-freq feature is not present at this level", 1, pkg_dev.c… in set_fact_for_cpu()
1908 ret = -1; in set_fact_for_cpu()
1943 isst_display_result(cpu, outf, "turbo-freq", "enable", ret); in set_fact_for_cpu()
1949 isst_display_result(cpu, outf, "turbo-freq", "disable", ret); in set_fact_for_cpu()
1960 "Enable Intel Speed Select Technology Turbo frequency feature\n"); in set_fact_enable()
1962 "Optional: -t|--trl : Specify turbo ratio limit\n"); in set_fact_enable()
1964 "\tOptional Arguments: -a|--auto : Designate specified target CPUs with"); in set_fact_enable()
1966 "-C|--cpu option as as high priority using core-power feature\n"); in set_fact_enable()
1969 "Disable Intel Speed Select Technology turbo frequency feature\n"); in set_fact_enable()
1971 "Optional: -t|--trl : Specify turbo ratio limit\n"); in set_fact_enable()
1973 "\tOptional Arguments: -a|--auto : Also disable core-power associations\n"); in set_fact_enable()
2055 isst_display_result(-1, outf, "turbo-freq --auto", "enable", 0); in set_fact_enable()
2061 isst_display_result(i, outf, "turbo-freq --auto", "enable", ret); in set_fact_enable()
2079 isst_display_result(cpu, outf, "core-power", "enable", in enable_clos_qos_config()
2082 isst_display_result(cpu, outf, "core-power", "disable", in enable_clos_qos_config()
2093 "Enable core-power for a package/die\n"); in set_clos_enable()
2096 "\tClos Enable: Specify priority type with [--priority|-p]\n"); in set_clos_enable()
2101 "Disable core-power: [No command arguments are required]\n"); in set_clos_enable()
2108 "cpufreq subsystem and core-power enable will interfere with each other!\n"); in set_clos_enable()
2141 "\tArguments: [-c | --clos]: Specify clos id\n"); in dump_clos_config()
2182 fprintf(stderr, "\t Optionally specify targeted cpu id with [--cpu|-c]\n"); in dump_clos_info()
2215 isst_display_result(cpu, outf, "core-power", "config", ret); in set_clos_config_for_cpu()
2222 "Set core-power configuration for one of the four clos ids\n"); in set_clos_config()
2224 "\tSpecify targeted clos id with [--clos|-c]\n"); in set_clos_config()
2226 fprintf(stderr, "\tSpecify clos EPP with [--epp|-e]\n"); in set_clos_config()
2228 "\tSpecify clos Proportional Priority [--weight|-w]\n"); in set_clos_config()
2230 fprintf(stderr, "\tSpecify clos min in MHz with [--min|-n]\n"); in set_clos_config()
2231 fprintf(stderr, "\tSpecify clos max in MHz with [--max|-m]\n"); in set_clos_config()
2280 isst_display_result(cpu, outf, "core-power", "assoc", ret); in set_clos_assoc_for_cpu()
2288 "\tSpecify targeted clos id with [--clos|-c]\n"); in set_clos_assoc()
2292 "\tintel-speed-select --cpu 0 core-power assoc --clos 1\n"); in set_clos_assoc()
2304 isst_display_error_info_message(1, "Invalid target cpu. Specify with [-c|--cpu]", 0, 0); in set_clos_assoc()
2324 fprintf(stderr, "\tSpecify targeted cpu id with [--cpu|-c]\n"); in get_clos_assoc()
2329 isst_display_error_info_message(1, "Invalid target cpu. Specify with [-c|--cpu]", 0, 0); in get_clos_assoc()
2351 isst_display_result(cpu, outf, "turbo-mode", "enable", 0); in set_turbo_mode_for_cpu()
2353 isst_display_result(cpu, outf, "turbo-mode", "disable", 0); in set_turbo_mode_for_cpu()
2363 fprintf(stderr, "Set turbo mode enable\n"); in set_turbo_mode()
2365 fprintf(stderr, "Set turbo mode disable\n"); in set_turbo_mode()
2396 isst_display_error_info_message(1, "Invalid TRL. Specify with [-t|--trl]", 0, 0); in get_set_trl()
2402 isst_display_result(cpu, outf, "turbo-mode", "set-trl", ret); in get_set_trl()
2408 isst_display_result(cpu, outf, "turbo-mode", "get-trl", ret); in get_set_trl()
2417 fprintf(stderr, "Set TRL (turbo ratio limits)\n"); in process_trl()
2418 fprintf(stderr, "\t t|--trl: Specify turbo ratio limit for setting TRL\n"); in process_trl()
2420 fprintf(stderr, "Get TRL (turbo ratio limits)\n"); in process_trl()
2436 { "perf-profile", "info", dump_isst_config, 0 },
2437 { "base-freq", "info", dump_pbf_config, 0 },
2438 { "base-freq", "enable", set_pbf_enable, 1 },
2439 { "base-freq", "disable", set_pbf_enable, 0 },
2444 { "perf-profile", "get-lock-status", get_tdp_locked, 0 },
2445 { "perf-profile", "get-config-levels", get_tdp_levels, 0 },
2446 { "perf-profile", "get-config-version", get_tdp_version, 0 },
2447 { "perf-profile", "get-config-enabled", get_tdp_enabled, 0 },
2448 { "perf-profile", "get-config-current-level", get_tdp_current_level,
2450 { "perf-profile", "set-config-level", set_tdp_level, 0 },
2451 { "perf-profile", "info", dump_isst_config, 0 },
2452 { "base-freq", "info", dump_pbf_config, 0 },
2453 { "base-freq", "enable", set_pbf_enable, 1 },
2454 { "base-freq", "disable", set_pbf_enable, 0 },
2455 { "turbo-freq", "info", dump_fact_config, 0 },
2456 { "turbo-freq", "enable", set_fact_enable, 1 },
2457 { "turbo-freq", "disable", set_fact_enable, 0 },
2458 { "core-power", "info", dump_clos_info, 0 },
2459 { "core-power", "enable", set_clos_enable, 1 },
2460 { "core-power", "disable", set_clos_enable, 0 },
2461 { "core-power", "config", set_clos_config, 0 },
2462 { "core-power", "get-config", dump_clos_config, 0 },
2463 { "core-power", "assoc", set_clos_assoc, 0 },
2464 { "core-power", "get-assoc", get_clos_assoc, 0 },
2465 { "turbo-mode", "enable", set_turbo_mode, 0 },
2466 { "turbo-mode", "disable", set_turbo_mode, 1 },
2467 { "turbo-mode", "get-trl", process_trl, 0 },
2468 { "turbo-mode", "set-trl", process_trl, 1 },
2474 * 1,2,4..6,8-10 and set bits in cpu_subset
2484 if (*next == '-') /* no negative cpu numbers */ in parse_cpu_command()
2500 if (*next == '-') { in parse_cpu_command()
2536 fprintf(stderr, "\"--cpu %s\" malformed\n", optarg); in parse_cpu_command()
2537 exit(-1); in parse_cpu_command()
2549 { "trl-type", required_argument, 0, 'r' }, in parse_cmd_args()
2567 long_options, &option_index)) != -1) { in parse_cmd_args()
2647 printf("perf-profile:\tAn architectural mechanism that allows multiple optimized \n\ in isst_help()
2651 printf("\nCommands : For feature=perf-profile\n"); in isst_help()
2655 printf("\tget-lock-status\n"); in isst_help()
2656 printf("\tget-config-levels\n"); in isst_help()
2657 printf("\tget-config-version\n"); in isst_help()
2658 printf("\tget-config-enabled\n"); in isst_help()
2659 printf("\tget-config-current-level\n"); in isst_help()
2660 printf("\tset-config-level\n"); in isst_help()
2666 printf("base-freq:\tEnables users to increase guaranteed base frequency\n\ in pbf_help()
2676 printf("turbo-freq:\tEnables the ability to set different turbo ratio\n\ in fact_help()
2678 printf("\nCommand: For feature=turbo-freq\n"); in fact_help()
2686 …printf("turbo-mode:\tEnables users to enable/disable turbo mode by adjusting frequency settings. A… in turbo_mode_help()
2689 printf("\tcommand : get-trl\n"); in turbo_mode_help()
2690 printf("\tcommand : set-trl\n"); in turbo_mode_help()
2696 printf("core-power:\tInterface that allows user to define per core/tile\n\ in core_power_help()
2698 printf("\nCommands : For feature=core-power\n"); in core_power_help()
2703 printf("\tget-config\n"); in core_power_help()
2705 printf("\tget-assoc\n"); in core_power_help()
2714 { "perf-profile", isst_help },
2715 { "base-freq", pbf_help },
2716 { "turbo-freq", fact_help },
2717 { "core-power", core_power_help },
2718 { "turbo-mode", turbo_mode_help },
2723 { "perf-profile", isst_help },
2724 { "base-freq", pbf_help },
2740 if (!strcmp(cmd, "-h") || !strcmp(cmd, "--help")) { in process_command()
2773 …fprintf(stderr, "Everything is pre-configured using BIOS options, this tool can't enable any featu… in usage()
2777 printf("intel-speed-select [OPTIONS] FEATURE COMMAND COMMAND_ARGUMENTS\n"); in usage()
2780 printf("\nFEATURE : [perf-profile|base-freq]\n"); in usage()
2782 printf("\nFEATURE : [perf-profile|base-freq|turbo-freq|core-power|turbo-mode]\n"); in usage()
2783 printf("\nFor help on each feature, use -h|--help\n"); in usage()
2784 printf("\tFor example: intel-speed-select perf-profile -h\n"); in usage()
2786 printf("\nFor additional help on each command for a feature, use --h|--help\n"); in usage()
2787 printf("\tFor example: intel-speed-select perf-profile get-lock-status -h\n"); in usage()
2788 …printf("\t\t This will print help for the command \"get-lock-status\" for the feature \"perf-profi… in usage()
2791 printf("\t[-c|--cpu] : logical cpu number\n"); in usage()
2794 printf("\t[-d|--debug] : Debug mode\n"); in usage()
2795 printf("\t[-f|--format] : output format [json|text]. Default: text\n"); in usage()
2796 printf("\t[-h|--help] : Print help\n"); in usage()
2797 printf("\t[-i|--info] : Print platform information\n"); in usage()
2798 printf("\t[-a|--all-cpus-online] : Force online every CPU in the system\n"); in usage()
2799 printf("\t[-o|--out] : Output file\n"); in usage()
2801 printf("\t[-p|--pause] : Delay between two mail box commands in milliseconds\n"); in usage()
2802 printf("\t[-r|--retry] : Retry count for mail box commands on failure, default 3\n"); in usage()
2803 printf("\t[-v|--version] : Print version\n"); in usage()
2812 printf("\t\tintel-speed-select --info\n"); in usage()
2813 printf("\tTo get full perf-profile information dump:\n"); in usage()
2814 printf("\t\tintel-speed-select perf-profile info\n"); in usage()
2815 printf("\tTo get full base-freq information dump:\n"); in usage()
2816 printf("\t\tintel-speed-select base-freq info -l 0\n"); in usage()
2818 printf("\tTo get full turbo-freq information dump:\n"); in usage()
2819 printf("\t\tintel-speed-select turbo-freq info -l 0\n"); in usage()
2840 { "all-cpus-online", no_argument, 0, 'a' }, in cmdline()
2860 err(-1, "Invalid CPU model (%d)\n", cpu_model); in cmdline()
2877 &option_index)) != -1) { in cmdline()
2887 printf("Debug Mode ON\n"); in cmdline()
2926 if (optind > (argc - 2)) { in cmdline()