Commit 9c70f046 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'x86_misc_for_v5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull misc x86 updates from Borislav Petkov:
 "The main part of this branch is the ongoing fight against windmills in
  an attempt to have userspace tools not poke at naked MSRs.

  This round deals with MSR_IA32_ENERGY_PERF_BIAS and removes direct
  poking into it by our in-tree tools in favor of the proper
  "energy_perf_bias" sysfs interface which we already have.

  In addition, the msr.ko write filtering's error message points to a
  new summary page which contains the info we collected from helpful
  reporters about which userspace tools write MSRs:

      https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/about

  along with the current status of their conversion.

  The rest is the usual small fixes and improvements"

* tag 'x86_misc_for_v5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/msr: Add a pointer to an URL which contains further details
  x86/pci: Fix the function type for check_reserved_t
  selftests/x86: Add missing .note.GNU-stack sections
  selftests/x86/fsgsbase: Fix GS == 1, 2, and 3 tests
  x86/msr: Downgrade unrecognized MSR message
  x86/msr: Do not allow writes to MSR_IA32_ENERGY_PERF_BIAS
  tools/power/x86_energy_perf_policy: Read energy_perf_bias from sysfs
  tools/power/turbostat: Read energy_perf_bias from sysfs
  tools/power/cpupower: Read energy_perf_bias from sysfs
  MAINTAINERS: Cleanup SGI-related entries
parents ae1c1a8f f77f420d
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -15905,13 +15905,14 @@ F: include/linux/sfp.h
K:	phylink\.h|struct\s+phylink|\.phylink|>phylink_|phylink_(autoneg|clear|connect|create|destroy|disconnect|ethtool|helper|mac|mii|of|set|start|stop|test|validate)
SGI GRU DRIVER
M:	Dimitri Sivanich <sivanich@sgi.com>
M:	Dimitri Sivanich <dimitri.sivanich@hpe.com>
S:	Maintained
F:	drivers/misc/sgi-gru/
SGI XP/XPC/XPNET DRIVER
M:	Cliff Whickman <cpw@sgi.com>
M:	Robin Holt <robinmholt@gmail.com>
M:	Steve Wahl <steve.wahl@hpe.com>
R:	Mike Travis <mike.travis@hpe.com>
S:	Maintained
F:	drivers/misc/sgi-xp/
@@ -19166,6 +19167,7 @@ F: arch/x86/platform
X86 PLATFORM UV HPE SUPERDOME FLEX
M:	Steve Wahl <steve.wahl@hpe.com>
R:	Mike Travis <mike.travis@hpe.com>
R:	Dimitri Sivanich <dimitri.sivanich@hpe.com>
R:	Russ Anderson <russ.anderson@hpe.com>
S:	Supported
+3 −5
Original line number Diff line number Diff line
@@ -99,11 +99,9 @@ static int filter_write(u32 reg)
	if (!__ratelimit(&fw_rs))
		return 0;

	if (reg == MSR_IA32_ENERGY_PERF_BIAS)
		return 0;

	pr_err("Write to unrecognized MSR 0x%x by %s (pid: %d). Please report to x86@kernel.org.\n",
	pr_warn("Write to unrecognized MSR 0x%x by %s (pid: %d).\n",
	        reg, current->comm, current->pid);
	pr_warn("See https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/about for details.\n");

	return 0;
}
+2 −2
Original line number Diff line number Diff line
@@ -425,7 +425,7 @@ static acpi_status find_mboard_resource(acpi_handle handle, u32 lvl,
	return AE_OK;
}

static bool is_acpi_reserved(u64 start, u64 end, unsigned not_used)
static bool is_acpi_reserved(u64 start, u64 end, enum e820_type not_used)
{
	struct resource mcfg_res;

@@ -442,7 +442,7 @@ static bool is_acpi_reserved(u64 start, u64 end, unsigned not_used)
	return mcfg_res.flags;
}

typedef bool (*check_reserved_t)(u64 start, u64 end, unsigned type);
typedef bool (*check_reserved_t)(u64 start, u64 end, enum e820_type type);

static bool __ref is_mmconf_reserved(check_reserved_t is_reserved,
				     struct pci_mmcfg_region *cfg,
+22 −1
Original line number Diff line number Diff line
@@ -16,8 +16,8 @@

unsigned int cpupower_read_sysfs(const char *path, char *buf, size_t buflen)
{
	int fd;
	ssize_t numread;
	int fd;

	fd = open(path, O_RDONLY);
	if (fd == -1)
@@ -35,6 +35,27 @@ unsigned int cpupower_read_sysfs(const char *path, char *buf, size_t buflen)
	return (unsigned int) numread;
}

unsigned int cpupower_write_sysfs(const char *path, char *buf, size_t buflen)
{
	ssize_t numwritten;
	int fd;

	fd = open(path, O_WRONLY);
	if (fd == -1)
		return 0;

	numwritten = write(fd, buf, buflen - 1);
	if (numwritten < 1) {
		perror(path);
		close(fd);
		return -1;
	}

	close(fd);

	return (unsigned int) numwritten;
}

/*
 * Detect whether a CPU is online
 *
+5 −0
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 */
#define PATH_TO_CPU "/sys/devices/system/cpu/"

#ifndef MAX_LINE_LEN
#define MAX_LINE_LEN 4096
#endif

#define SYSFS_PATH_MAX 255

unsigned int cpupower_read_sysfs(const char *path, char *buf, size_t buflen);
unsigned int cpupower_write_sysfs(const char *path, char *buf, size_t buflen);
Loading