Commit 9581e24c authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

Merge tag 'linux-cpupower-5.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux

Pull cpupower utility updates for v5.5 from Shuah Khan:

"This cpupower update for Linux 5.5-rc1 consists of bug fixes and
 improvements to make it more accurate by removing the userspace
 to kernel transition and read_msr initiated IPI delays."

* tag 'linux-cpupower-5.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux:
  cpupower: ToDo: Update ToDo with ideas for per_cpu_schedule handling
  cpupower: mperf_monitor: Update cpupower to use the RDPRU instruction
  cpupower: mperf_monitor: Introduce per_cpu_schedule flag
  cpupower: Move needs_root variable into a sub-struct
  cpupower : Handle set and info subcommands correctly
  tools/power/cpupower: Fix initializer override in hsw_ext_cstates
parents fef4ac87 4611a4fb
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -8,3 +8,17 @@ ToDos sorted by priority:
- Add another c1e debug idle monitor
  -> Is by design racy with BIOS, but could be added
     with a --force option and some "be careful" messages
- Add cpu_start()/cpu_stop() callbacks for monitor
  -> This is to move the per_cpu logic from inside the
     monitor to outside it. This can be given higher
     priority in fork_it.
- Fork as many processes as there are CPUs in case the
  per_cpu_schedule flag is set.
  -> Bind forked process to each cpu.
  -> Execute start measures via the forked processes on
     each cpu.
  -> Run test executable in a forked process.
  -> Execute stop measures via the forked processes on
     each cpu.
  This would be ideal as it will not introduce noise in the
  tested executable.
+9 −0
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@
#include <errno.h>
#include <string.h>
#include <getopt.h>
#include <sys/utsname.h>

#include "helpers/helpers.h"
#include "helpers/sysfs.h"
@@ -30,6 +31,7 @@ int cmd_info(int argc, char **argv)
	extern char *optarg;
	extern int optind, opterr, optopt;
	unsigned int cpu;
	struct utsname uts;

	union {
		struct {
@@ -39,6 +41,13 @@ int cmd_info(int argc, char **argv)
	} params = {};
	int ret = 0;

	ret = uname(&uts);
	if (!ret && (!strcmp(uts.machine, "ppc64le") ||
		     !strcmp(uts.machine, "ppc64"))) {
		fprintf(stderr, _("Subcommand not supported on POWER.\n"));
		return ret;
	}

	setlocale(LC_ALL, "");
	textdomain(PACKAGE);

+9 −0
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@
#include <errno.h>
#include <string.h>
#include <getopt.h>
#include <sys/utsname.h>

#include "helpers/helpers.h"
#include "helpers/sysfs.h"
@@ -31,6 +32,7 @@ int cmd_set(int argc, char **argv)
	extern char *optarg;
	extern int optind, opterr, optopt;
	unsigned int cpu;
	struct utsname uts;

	union {
		struct {
@@ -41,6 +43,13 @@ int cmd_set(int argc, char **argv)
	int perf_bias = 0;
	int ret = 0;

	ret = uname(&uts);
	if (!ret && (!strcmp(uts.machine, "ppc64le") ||
		     !strcmp(uts.machine, "ppc64"))) {
		fprintf(stderr, _("Subcommand not supported on POWER.\n"));
		return ret;
	}

	setlocale(LC_ALL, "");
	textdomain(PACKAGE);

+4 −0
Original line number Diff line number Diff line
@@ -131,6 +131,10 @@ out:
		if (ext_cpuid_level >= 0x80000007 &&
		    (cpuid_edx(0x80000007) & (1 << 9)))
			cpu_info->caps |= CPUPOWER_CAP_AMD_CBP;

		if (ext_cpuid_level >= 0x80000008 &&
		    cpuid_ebx(0x80000008) & (1 << 4))
			cpu_info->caps |= CPUPOWER_CAP_AMD_RDPRU;
	}

	if (cpu_info->vendor == X86_VENDOR_INTEL) {
+1 −0
Original line number Diff line number Diff line
@@ -69,6 +69,7 @@ enum cpupower_cpu_vendor {X86_VENDOR_UNKNOWN = 0, X86_VENDOR_INTEL,
#define CPUPOWER_CAP_HAS_TURBO_RATIO	0x00000010
#define CPUPOWER_CAP_IS_SNB		0x00000020
#define CPUPOWER_CAP_INTEL_IDA		0x00000040
#define CPUPOWER_CAP_AMD_RDPRU		0x00000080

#define CPUPOWER_AMD_CPBDIS		0x02000000

Loading