Unverified Commit 90959cd1 authored by Ilpo Järvinen's avatar Ilpo Järvinen
Browse files

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

parents 8ca7515d 6142b726
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -13,7 +13,13 @@ endif
# Do not use make's built-in rules
# (this improves performance and avoids hard-to-debug behaviour);
MAKEFLAGS += -r
override CFLAGS += -O2 -Wall -g -D_GNU_SOURCE -I$(OUTPUT)include -I$(shell $(CC) -print-sysroot)/usr/include/libnl3

NL3_CFLAGS = $(shell pkg-config --cflags libnl-3.0 2>/dev/null)
ifeq ($(NL3_CFLAGS),)
NL3_CFLAGS = -I/usr/include/libnl3
endif

override CFLAGS += -O2 -Wall -g -D_GNU_SOURCE -I$(OUTPUT)include $(NL3_CFLAGS)
override LDFLAGS += -lnl-genl-3 -lnl-3

ALL_TARGETS := intel-speed-select
+40 −3
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ struct process_cmd_struct {
	int arg;
};

static const char *version_str = "v1.24";
static const char *version_str = "v1.25";

static const int supported_api_ver = 3;
static struct isst_if_platform_info isst_platform_info;
@@ -80,6 +80,18 @@ struct cpu_topology {
	short die_id;
};

static int read_only;

static void check_privilege(void)
{
	if (!read_only)
		return;

	isst_display_error_info_message(1, "Insufficient privileges", 0, 0);
	isst_ctdp_display_information_end(outf);
	exit(1);
}

FILE *get_output_file(void)
{
	return outf;
@@ -950,9 +962,11 @@ int isolate_cpus(struct isst_id *id, int mask_size, cpu_set_t *cpu_mask, int lev
		ret = write(fd, "member", strlen("member"));
		if (ret == -1) {
			printf("Can't update to member\n");
			close(fd);
			return ret;
		}

		close(fd);
		return 0;
	}

@@ -1578,6 +1592,8 @@ static void set_tdp_level_for_cpu(struct isst_id *id, void *arg1, void *arg2, vo

static void set_tdp_level(int arg)
{
	check_privilege();

	if (cmd_help) {
		fprintf(stderr, "Set Config TDP level\n");
		fprintf(stderr,
@@ -2046,6 +2062,8 @@ static void set_pbf_enable(int arg)
{
	int enable = arg;

	check_privilege();

	if (cmd_help) {
		if (enable) {
			fprintf(stderr,
@@ -2212,6 +2230,8 @@ static void set_fact_enable(int arg)
	int i, ret, enable = arg;
	struct isst_id id;

	check_privilege();

	if (cmd_help) {
		if (enable) {
			fprintf(stderr,
@@ -2361,6 +2381,8 @@ static void set_clos_enable(int arg)
{
	int enable = arg;

	check_privilege();

	if (cmd_help) {
		if (enable) {
			fprintf(stderr,
@@ -2491,6 +2513,8 @@ static void set_clos_config_for_cpu(struct isst_id *id, void *arg1, void *arg2,

static void set_clos_config(int arg)
{
	check_privilege();

	if (cmd_help) {
		fprintf(stderr,
			"Set core-power configuration for one of the four clos ids\n");
@@ -2556,6 +2580,8 @@ static void set_clos_assoc_for_cpu(struct isst_id *id, void *arg1, void *arg2, v

static void set_clos_assoc(int arg)
{
	check_privilege();

	if (cmd_help) {
		fprintf(stderr, "Associate a clos id to a CPU\n");
		fprintf(stderr,
@@ -2637,6 +2663,8 @@ static void set_turbo_mode(int arg)
	int i, disable = arg;
	struct isst_id id;

	check_privilege();

	if (cmd_help) {
		if (disable)
			fprintf(stderr, "Set turbo mode disable\n");
@@ -2682,6 +2710,7 @@ static void get_set_trl(struct isst_id *id, void *arg1, void *arg2, void *arg3,
	}

	if (set) {
		check_privilege();
		ret = isst_set_trl(id, fact_trl);
		isst_display_result(id, outf, "turbo-mode", "set-trl", ret);
		return;
@@ -3204,9 +3233,17 @@ static void cmdline(int argc, char **argv)
	};

	if (geteuid() != 0) {
		int fd;

		fd = open(pathname, O_RDWR);
		if (fd < 0) {
			fprintf(stderr, "Must run as root\n");
			exit(0);
		}
		fprintf(stderr, "\nNot running as root, Only read only operations are supported\n");
		close(fd);
		read_only = 1;
	}

	ret = update_cpu_model();
	if (ret)