Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a52fb43a authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'x86-cache-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 cache control updates from Borislav Petkov:

 - The generalization of the RDT code to accommodate the addition of
   AMD's very similar implementation of the cache monitoring feature.

   This entails a subsystem move into a separate and generic
   arch/x86/kernel/cpu/resctrl/ directory along with adding
   vendor-specific initialization and feature detection helpers.

   Ontop of that is the unification of user-visible strings, both in the
   resctrl filesystem error handling and Kconfig.

   Provided by Babu Moger and Sherry Hurwitz.

 - Code simplifications and error handling improvements by Reinette
   Chatre.

* 'x86-cache-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/resctrl: Fix rdt_find_domain() return value and checks
  x86/resctrl: Remove unnecessary check for cbm_validate()
  x86/resctrl: Use rdt_last_cmd_puts() where possible
  MAINTAINERS: Update resctrl filename patterns
  Documentation: Rename and update intel_rdt_ui.txt to resctrl_ui.txt
  x86/resctrl: Introduce AMD QOS feature
  x86/resctrl: Fixup the user-visible strings
  x86/resctrl: Add AMD's X86_FEATURE_MBA to the scattered CPUID features
  x86/resctrl: Rename the config option INTEL_RDT to RESCTRL
  x86/resctrl: Add vendor check for the MBA software controller
  x86/resctrl: Bring cbm_validate() into the resource structure
  x86/resctrl: Initialize the vendor-specific resource functions
  x86/resctrl: Move all the macros to resctrl/internal.h
  x86/resctrl: Re-arrange the RDT init code
  x86/resctrl: Rename the RDT functions and definitions
  x86/resctrl: Rename and move rdt files to a separate directory
parents 42b00f12 52eb7433
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
User Interface for Resource Allocation in Intel Resource Director Technology
User Interface for Resource Control feature

Intel refers to this feature as Intel Resource Director Technology(Intel(R) RDT).
AMD refers to this feature as AMD Platform Quality of Service(AMD QoS).

Copyright (C) 2016 Intel Corporation

@@ -6,8 +9,8 @@ Fenghua Yu <fenghua.yu@intel.com>
Tony Luck <tony.luck@intel.com>
Vikas Shivappa <vikas.shivappa@intel.com>

This feature is enabled by the CONFIG_INTEL_RDT Kconfig and the
X86 /proc/cpuinfo flag bits:
This feature is enabled by the CONFIG_RESCTRL and the X86 /proc/cpuinfo
flag bits:
RDT (Resource Director Technology) Allocation - "rdt_a"
CAT (Cache Allocation Technology) - "cat_l3", "cat_l2"
CDP (Code and Data Prioritization ) - "cdp_l3", "cdp_l2"
+3 −3
Original line number Diff line number Diff line
@@ -12717,9 +12717,9 @@ M: Fenghua Yu <fenghua.yu@intel.com>
M:	Reinette Chatre <reinette.chatre@intel.com>
L:	linux-kernel@vger.kernel.org
S:	Supported
F:	arch/x86/kernel/cpu/intel_rdt*
F:	arch/x86/include/asm/intel_rdt_sched.h
F:	Documentation/x86/intel_rdt*
F:	arch/x86/kernel/cpu/resctrl/
F:	arch/x86/include/asm/resctrl_sched.h
F:	Documentation/x86/resctrl*

READ-COPY UPDATE (RCU)
M:	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
+15 −7
Original line number Diff line number Diff line
@@ -444,15 +444,23 @@ config RETPOLINE
	  branches. Requires a compiler with -mindirect-branch=thunk-extern
	  support for full protection. The kernel may run slower.

config INTEL_RDT
	bool "Intel Resource Director Technology support"
	depends on X86 && CPU_SUP_INTEL
config RESCTRL
	bool "Resource Control support"
	depends on X86 && (CPU_SUP_INTEL || CPU_SUP_AMD)
	select KERNFS
	help
	  Select to enable resource allocation and monitoring which are
	  sub-features of Intel Resource Director Technology(RDT). More
	  information about RDT can be found in the Intel x86
	  Architecture Software Developer Manual.
	  Enable Resource Control support.

	  Provide support for the allocation and monitoring of system resources
	  usage by the CPU.

	  Intel calls this Intel Resource Director Technology
	  (Intel(R) RDT). More information about RDT can be found in the
	  Intel x86 Architecture Software Developer Manual.

	  AMD calls this AMD Platform Quality of Service (AMD QoS).
	  More information about AMD QoS can be found in the AMD64 Technology
	  Platform Quality of Service Extensions manual.

	  Say N if unsure.

+14 −14
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _ASM_X86_INTEL_RDT_SCHED_H
#define _ASM_X86_INTEL_RDT_SCHED_H
#ifndef _ASM_X86_RESCTRL_SCHED_H
#define _ASM_X86_RESCTRL_SCHED_H

#ifdef CONFIG_INTEL_RDT
#ifdef CONFIG_RESCTRL

#include <linux/sched.h>
#include <linux/jump_label.h>
@@ -10,7 +10,7 @@
#define IA32_PQR_ASSOC	0x0c8f

/**
 * struct intel_pqr_state - State cache for the PQR MSR
 * struct resctrl_pqr_state - State cache for the PQR MSR
 * @cur_rmid:		The cached Resource Monitoring ID
 * @cur_closid:	The cached Class Of Service ID
 * @default_rmid:	The user assigned Resource Monitoring ID
@@ -24,21 +24,21 @@
 * The cache also helps to avoid pointless updates if the value does
 * not change.
 */
struct intel_pqr_state {
struct resctrl_pqr_state {
	u32			cur_rmid;
	u32			cur_closid;
	u32			default_rmid;
	u32			default_closid;
};

DECLARE_PER_CPU(struct intel_pqr_state, pqr_state);
DECLARE_PER_CPU(struct resctrl_pqr_state, pqr_state);

DECLARE_STATIC_KEY_FALSE(rdt_enable_key);
DECLARE_STATIC_KEY_FALSE(rdt_alloc_enable_key);
DECLARE_STATIC_KEY_FALSE(rdt_mon_enable_key);

/*
 * __intel_rdt_sched_in() - Writes the task's CLOSid/RMID to IA32_PQR_MSR
 * __resctrl_sched_in() - Writes the task's CLOSid/RMID to IA32_PQR_MSR
 *
 * Following considerations are made so that this has minimal impact
 * on scheduler hot path:
@@ -51,9 +51,9 @@ DECLARE_STATIC_KEY_FALSE(rdt_mon_enable_key);
 *   simple as possible.
 * Must be called with preemption disabled.
 */
static void __intel_rdt_sched_in(void)
static void __resctrl_sched_in(void)
{
	struct intel_pqr_state *state = this_cpu_ptr(&pqr_state);
	struct resctrl_pqr_state *state = this_cpu_ptr(&pqr_state);
	u32 closid = state->default_closid;
	u32 rmid = state->default_rmid;

@@ -78,16 +78,16 @@ static void __intel_rdt_sched_in(void)
	}
}

static inline void intel_rdt_sched_in(void)
static inline void resctrl_sched_in(void)
{
	if (static_branch_likely(&rdt_enable_key))
		__intel_rdt_sched_in();
		__resctrl_sched_in();
}

#else

static inline void intel_rdt_sched_in(void) {}
static inline void resctrl_sched_in(void) {}

#endif /* CONFIG_INTEL_RDT */
#endif /* CONFIG_RESCTRL */

#endif /* _ASM_X86_INTEL_RDT_SCHED_H */
#endif /* _ASM_X86_RESCTRL_SCHED_H */
+1 −4
Original line number Diff line number Diff line
@@ -36,13 +36,10 @@ obj-$(CONFIG_CPU_SUP_CENTAUR) += centaur.o
obj-$(CONFIG_CPU_SUP_TRANSMETA_32)	+= transmeta.o
obj-$(CONFIG_CPU_SUP_UMC_32)		+= umc.o

obj-$(CONFIG_INTEL_RDT)	+= intel_rdt.o intel_rdt_rdtgroup.o intel_rdt_monitor.o
obj-$(CONFIG_INTEL_RDT)	+= intel_rdt_ctrlmondata.o intel_rdt_pseudo_lock.o
CFLAGS_intel_rdt_pseudo_lock.o = -I$(src)

obj-$(CONFIG_X86_MCE)			+= mcheck/
obj-$(CONFIG_MTRR)			+= mtrr/
obj-$(CONFIG_MICROCODE)			+= microcode/
obj-$(CONFIG_RESCTRL)			+= resctrl/

obj-$(CONFIG_X86_LOCAL_APIC)		+= perfctr-watchdog.o

Loading