Skip to content

Commit a52fb43

Browse files
committed
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
2 parents 42b00f1 + 52eb743 commit a52fb43

File tree

17 files changed

+385
-173
lines changed

17 files changed

+385
-173
lines changed

Documentation/x86/intel_rdt_ui.txt renamed to Documentation/x86/resctrl_ui.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
User Interface for Resource Allocation in Intel Resource Director Technology
1+
User Interface for Resource Control feature
2+
3+
Intel refers to this feature as Intel Resource Director Technology(Intel(R) RDT).
4+
AMD refers to this feature as AMD Platform Quality of Service(AMD QoS).
25

36
Copyright (C) 2016 Intel Corporation
47

58
Fenghua Yu <fenghua.yu@intel.com>
69
Tony Luck <tony.luck@intel.com>
710
Vikas Shivappa <vikas.shivappa@intel.com>
811

9-
This feature is enabled by the CONFIG_INTEL_RDT Kconfig and the
10-
X86 /proc/cpuinfo flag bits:
12+
This feature is enabled by the CONFIG_RESCTRL and the X86 /proc/cpuinfo
13+
flag bits:
1114
RDT (Resource Director Technology) Allocation - "rdt_a"
1215
CAT (Cache Allocation Technology) - "cat_l3", "cat_l2"
1316
CDP (Code and Data Prioritization ) - "cdp_l3", "cdp_l2"

MAINTAINERS

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12717,9 +12717,9 @@ M: Fenghua Yu <fenghua.yu@intel.com>
1271712717
M: Reinette Chatre <reinette.chatre@intel.com>
1271812718
L: linux-kernel@vger.kernel.org
1271912719
S: Supported
12720-
F: arch/x86/kernel/cpu/intel_rdt*
12721-
F: arch/x86/include/asm/intel_rdt_sched.h
12722-
F: Documentation/x86/intel_rdt*
12720+
F: arch/x86/kernel/cpu/resctrl/
12721+
F: arch/x86/include/asm/resctrl_sched.h
12722+
F: Documentation/x86/resctrl*
1272312723

1272412724
READ-COPY UPDATE (RCU)
1272512725
M: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>

arch/x86/Kconfig

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -444,15 +444,23 @@ config RETPOLINE
444444
branches. Requires a compiler with -mindirect-branch=thunk-extern
445445
support for full protection. The kernel may run slower.
446446

447-
config INTEL_RDT
448-
bool "Intel Resource Director Technology support"
449-
depends on X86 && CPU_SUP_INTEL
447+
config RESCTRL
448+
bool "Resource Control support"
449+
depends on X86 && (CPU_SUP_INTEL || CPU_SUP_AMD)
450450
select KERNFS
451451
help
452-
Select to enable resource allocation and monitoring which are
453-
sub-features of Intel Resource Director Technology(RDT). More
454-
information about RDT can be found in the Intel x86
455-
Architecture Software Developer Manual.
452+
Enable Resource Control support.
453+
454+
Provide support for the allocation and monitoring of system resources
455+
usage by the CPU.
456+
457+
Intel calls this Intel Resource Director Technology
458+
(Intel(R) RDT). More information about RDT can be found in the
459+
Intel x86 Architecture Software Developer Manual.
460+
461+
AMD calls this AMD Platform Quality of Service (AMD QoS).
462+
More information about AMD QoS can be found in the AMD64 Technology
463+
Platform Quality of Service Extensions manual.
456464

457465
Say N if unsure.
458466

arch/x86/include/asm/intel_rdt_sched.h renamed to arch/x86/include/asm/resctrl_sched.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
/* SPDX-License-Identifier: GPL-2.0 */
2-
#ifndef _ASM_X86_INTEL_RDT_SCHED_H
3-
#define _ASM_X86_INTEL_RDT_SCHED_H
2+
#ifndef _ASM_X86_RESCTRL_SCHED_H
3+
#define _ASM_X86_RESCTRL_SCHED_H
44

5-
#ifdef CONFIG_INTEL_RDT
5+
#ifdef CONFIG_RESCTRL
66

77
#include <linux/sched.h>
88
#include <linux/jump_label.h>
99

1010
#define IA32_PQR_ASSOC 0x0c8f
1111

1212
/**
13-
* struct intel_pqr_state - State cache for the PQR MSR
13+
* struct resctrl_pqr_state - State cache for the PQR MSR
1414
* @cur_rmid: The cached Resource Monitoring ID
1515
* @cur_closid: The cached Class Of Service ID
1616
* @default_rmid: The user assigned Resource Monitoring ID
@@ -24,21 +24,21 @@
2424
* The cache also helps to avoid pointless updates if the value does
2525
* not change.
2626
*/
27-
struct intel_pqr_state {
27+
struct resctrl_pqr_state {
2828
u32 cur_rmid;
2929
u32 cur_closid;
3030
u32 default_rmid;
3131
u32 default_closid;
3232
};
3333

34-
DECLARE_PER_CPU(struct intel_pqr_state, pqr_state);
34+
DECLARE_PER_CPU(struct resctrl_pqr_state, pqr_state);
3535

3636
DECLARE_STATIC_KEY_FALSE(rdt_enable_key);
3737
DECLARE_STATIC_KEY_FALSE(rdt_alloc_enable_key);
3838
DECLARE_STATIC_KEY_FALSE(rdt_mon_enable_key);
3939

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

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

81-
static inline void intel_rdt_sched_in(void)
81+
static inline void resctrl_sched_in(void)
8282
{
8383
if (static_branch_likely(&rdt_enable_key))
84-
__intel_rdt_sched_in();
84+
__resctrl_sched_in();
8585
}
8686

8787
#else
8888

89-
static inline void intel_rdt_sched_in(void) {}
89+
static inline void resctrl_sched_in(void) {}
9090

91-
#endif /* CONFIG_INTEL_RDT */
91+
#endif /* CONFIG_RESCTRL */
9292

93-
#endif /* _ASM_X86_INTEL_RDT_SCHED_H */
93+
#endif /* _ASM_X86_RESCTRL_SCHED_H */

arch/x86/kernel/cpu/Makefile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,10 @@ obj-$(CONFIG_CPU_SUP_CENTAUR) += centaur.o
3636
obj-$(CONFIG_CPU_SUP_TRANSMETA_32) += transmeta.o
3737
obj-$(CONFIG_CPU_SUP_UMC_32) += umc.o
3838

39-
obj-$(CONFIG_INTEL_RDT) += intel_rdt.o intel_rdt_rdtgroup.o intel_rdt_monitor.o
40-
obj-$(CONFIG_INTEL_RDT) += intel_rdt_ctrlmondata.o intel_rdt_pseudo_lock.o
41-
CFLAGS_intel_rdt_pseudo_lock.o = -I$(src)
42-
4339
obj-$(CONFIG_X86_MCE) += mcheck/
4440
obj-$(CONFIG_MTRR) += mtrr/
4541
obj-$(CONFIG_MICROCODE) += microcode/
42+
obj-$(CONFIG_RESCTRL) += resctrl/
4643

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

arch/x86/kernel/cpu/resctrl/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
obj-$(CONFIG_RESCTRL) += core.o rdtgroup.o monitor.o
3+
obj-$(CONFIG_RESCTRL) += ctrlmondata.o pseudo_lock.o
4+
CFLAGS_pseudo_lock.o = -I$(src)

0 commit comments

Comments
 (0)