Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'intel-sst' of https://github.com/spandruvada/linux-kernel into for-next

+47 -4
+7 -1
tools/power/x86/intel-speed-select/Makefile
··· 13 13 # Do not use make's built-in rules 14 14 # (this improves performance and avoids hard-to-debug behaviour); 15 15 MAKEFLAGS += -r 16 - override CFLAGS += -O2 -Wall -g -D_GNU_SOURCE -I$(OUTPUT)include -I$(shell $(CC) -print-sysroot)/usr/include/libnl3 16 + 17 + NL3_CFLAGS = $(shell pkg-config --cflags libnl-3.0 2>/dev/null) 18 + ifeq ($(NL3_CFLAGS),) 19 + NL3_CFLAGS = -I/usr/include/libnl3 20 + endif 21 + 22 + override CFLAGS += -O2 -Wall -g -D_GNU_SOURCE -I$(OUTPUT)include $(NL3_CFLAGS) 17 23 override LDFLAGS += -lnl-genl-3 -lnl-3 18 24 19 25 ALL_TARGETS := intel-speed-select
+40 -3
tools/power/x86/intel-speed-select/isst-config.c
··· 16 16 int arg; 17 17 }; 18 18 19 - static const char *version_str = "v1.24"; 19 + static const char *version_str = "v1.25"; 20 20 21 21 static const int supported_api_ver = 3; 22 22 static struct isst_if_platform_info isst_platform_info; ··· 79 79 short pkg_id; 80 80 short die_id; 81 81 }; 82 + 83 + static int read_only; 84 + 85 + static void check_privilege(void) 86 + { 87 + if (!read_only) 88 + return; 89 + 90 + isst_display_error_info_message(1, "Insufficient privileges", 0, 0); 91 + isst_ctdp_display_information_end(outf); 92 + exit(1); 93 + } 82 94 83 95 FILE *get_output_file(void) 84 96 { ··· 962 950 ret = write(fd, "member", strlen("member")); 963 951 if (ret == -1) { 964 952 printf("Can't update to member\n"); 953 + close(fd); 965 954 return ret; 966 955 } 967 956 957 + close(fd); 968 958 return 0; 969 959 } 970 960 ··· 1592 1578 1593 1579 static void set_tdp_level(int arg) 1594 1580 { 1581 + check_privilege(); 1582 + 1595 1583 if (cmd_help) { 1596 1584 fprintf(stderr, "Set Config TDP level\n"); 1597 1585 fprintf(stderr, ··· 2062 2046 { 2063 2047 int enable = arg; 2064 2048 2049 + check_privilege(); 2050 + 2065 2051 if (cmd_help) { 2066 2052 if (enable) { 2067 2053 fprintf(stderr, ··· 2230 2212 int i, ret, enable = arg; 2231 2213 struct isst_id id; 2232 2214 2215 + check_privilege(); 2216 + 2233 2217 if (cmd_help) { 2234 2218 if (enable) { 2235 2219 fprintf(stderr, ··· 2381 2361 { 2382 2362 int enable = arg; 2383 2363 2364 + check_privilege(); 2365 + 2384 2366 if (cmd_help) { 2385 2367 if (enable) { 2386 2368 fprintf(stderr, ··· 2513 2491 2514 2492 static void set_clos_config(int arg) 2515 2493 { 2494 + check_privilege(); 2495 + 2516 2496 if (cmd_help) { 2517 2497 fprintf(stderr, 2518 2498 "Set core-power configuration for one of the four clos ids\n"); ··· 2580 2556 2581 2557 static void set_clos_assoc(int arg) 2582 2558 { 2559 + check_privilege(); 2560 + 2583 2561 if (cmd_help) { 2584 2562 fprintf(stderr, "Associate a clos id to a CPU\n"); 2585 2563 fprintf(stderr, ··· 2663 2637 int i, disable = arg; 2664 2638 struct isst_id id; 2665 2639 2640 + check_privilege(); 2641 + 2666 2642 if (cmd_help) { 2667 2643 if (disable) 2668 2644 fprintf(stderr, "Set turbo mode disable\n"); ··· 2710 2682 } 2711 2683 2712 2684 if (set) { 2685 + check_privilege(); 2713 2686 ret = isst_set_trl(id, fact_trl); 2714 2687 isst_display_result(id, outf, "turbo-mode", "set-trl", ret); 2715 2688 return; ··· 3233 3204 }; 3234 3205 3235 3206 if (geteuid() != 0) { 3236 - fprintf(stderr, "Must run as root\n"); 3237 - exit(0); 3207 + int fd; 3208 + 3209 + fd = open(pathname, O_RDWR); 3210 + if (fd < 0) { 3211 + fprintf(stderr, "Must run as root\n"); 3212 + exit(0); 3213 + } 3214 + fprintf(stderr, "\nNot running as root, Only read only operations are supported\n"); 3215 + close(fd); 3216 + read_only = 1; 3238 3217 } 3239 3218 3240 3219 ret = update_cpu_model();