Skip to contentSkip to conversation

x86/cache updates for 4.21

GIT PULL In review Borislav Petkov 6 participants 10 messages Dec 23, 2018 – Jan 9, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

Hi Linus,

please pull the latest x86-cache-for-linus tree from:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86-cache-for-linus

This update contains:

- 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.

And just because we're not having enough fun, this pull request conflicts with the fs context changes in the vfs tree. Find the merge conflict resolution (git show -M) at the end of this mail. For reference, the merge resolution is also available at:

git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp.git vfs-x86-cache

Thanks,
Boris.

------------------>

The following changes since commit 9ff01193a20d391e8dbce4403dd5ef87c7eaaca6:

Linux 4.20-rc3 (2018-11-18 13:33:44 -0800)

are available in the Git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86-cache-for-linus

for you to fetch changes up to 52eb74339a6233c69f4e3794b69ea7c98eeeae1b:

x86/resctrl: Fix rdt_find_domain() return value and checks (2018-12-11 22:09:28 +0100)

----------------------------------------------------------------
Babu Moger (13):
x86/resctrl: Rename and move rdt files to a separate directory x86/resctrl: Rename the RDT functions and definitions x86/resctrl: Re-arrange the RDT init code
x86/resctrl: Move all the macros to resctrl/internal.h x86/resctrl: Initialize the vendor-specific resource functions x86/resctrl: Bring cbm_validate() into the resource structure x86/resctrl: Add vendor check for the MBA software controller x86/resctrl: Rename the config option INTEL_RDT to RESCTRL x86/resctrl: Fixup the user-visible strings x86/resctrl: Introduce AMD QOS feature
Documentation: Rename and update intel_rdt_ui.txt to resctrl_ui.txt
MAINTAINERS: Update resctrl filename patterns x86/resctrl: Remove unnecessary check for cbm_validate()

Reinette Chatre (2):
x86/resctrl: Use rdt_last_cmd_puts() where possible x86/resctrl: Fix rdt_find_domain() return value and checks

Sherry Hurwitz (1):
x86/resctrl: Add AMD's X86_FEATURE_MBA to the scattered CPUID features

 Documentation/x86/{intel_rdt_ui.txt => resctrl_ui.txt}                             |   9 ++-
 MAINTAINERS                                                                        |   6 +-
 arch/x86/Kconfig                                                                   |  22 ++++---
 arch/x86/include/asm/{intel_rdt_sched.h => resctrl_sched.h}                        |  28 ++++-----
 arch/x86/kernel/cpu/Makefile                                                       |   5 +-
 arch/x86/kernel/cpu/resctrl/Makefile                                               |   4 ++
 arch/x86/kernel/cpu/{intel_rdt.c => resctrl/core.c}                                | 186 +++++++++++++++++++++++++++++++++++++++++++++++-------------
 arch/x86/kernel/cpu/{intel_rdt_ctrlmondata.c => resctrl/ctrlmondata.c}             | 107 ++++++++++++++++++++++++++++------
 arch/x86/kernel/cpu/{intel_rdt.h => resctrl/internal.h}                            |  55 +++++++++++-------
 arch/x86/kernel/cpu/{intel_rdt_monitor.c => resctrl/monitor.c}                     |  16 +++---
 arch/x86/kernel/cpu/{intel_rdt_pseudo_lock.c => resctrl/pseudo_lock.c}             |  40 ++++++-------
 arch/x86/kernel/cpu/{intel_rdt_pseudo_lock_event.h => resctrl/pseudo_lock_event.h} |   2 +-
 arch/x86/kernel/cpu/{intel_rdt_rdtgroup.c => resctrl/rdtgroup.c}                   |  61 ++++++++++----------
 arch/x86/kernel/cpu/scattered.c                                                    |   7 ++-
 arch/x86/kernel/process_32.c                                                       |   4 +-
 arch/x86/kernel/process_64.c                                                       |   4 +-
 include/linux/sched.h                                                              |   2 +-
 17 files changed, 385 insertions(+), 173 deletions(-)
 rename Documentation/x86/{intel_rdt_ui.txt => resctrl_ui.txt} (99%)
 rename arch/x86/include/asm/{intel_rdt_sched.h => resctrl_sched.h} (77%)
 create mode 100644 arch/x86/kernel/cpu/resctrl/Makefile
 rename arch/x86/kernel/cpu/{intel_rdt.c => resctrl/core.c} (83%)
 rename arch/x86/kernel/cpu/{intel_rdt_ctrlmondata.c => resctrl/ctrlmondata.c} (81%)
 rename arch/x86/kernel/cpu/{intel_rdt.h => resctrl/internal.h} (91%)
 rename arch/x86/kernel/cpu/{intel_rdt_monitor.c => resctrl/monitor.c} (98%)
 rename arch/x86/kernel/cpu/{intel_rdt_pseudo_lock.c => resctrl/pseudo_lock.c} (97%)
 rename arch/x86/kernel/cpu/{intel_rdt_pseudo_lock_event.h => resctrl/pseudo_lock_event.h} (95%)
 rename arch/x86/kernel/cpu/{intel_rdt_rdtgroup.c => resctrl/rdtgroup.c} (98%)

---
commit ba13cfacc0883dbe485d123f5087963701572098
Merge: 0a6185274b63 52eb74339a62
Author: Borislav Petkov <[email protected]>
Date: Thu Dec 20 19:59:36 2018 +0100

Merge branch 'x86-cache-for-linus' into vfs-x86-cache

Conflicts:
arch/x86/Kconfig arch/x86/kernel/cpu/resctrl/rdtgroup.c

arch/x86/Kconfig +0 -0
diff --cc arch/x86/Kconfig
index 642353a65649,2d0577e805d2..62adf94c8dfa
@@@ -443,15 -444,27 +443,23 @@@ config RETPOLIN
  	  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
 -	  Without compiler support, at least indirect branches in assembler
 -	  code are eliminated. Since this includes the syscall entry path,
 -	  it is not entirely pointless.
 -
+ 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.
  
arch/x86/kernel/cpu/resctrl/internal.h +0 -0
diff --cc arch/x86/kernel/cpu/resctrl/internal.h
index d5ec5643e7ab,822b7db634ee..e49b77283924
@@@ -4,18 -4,21 +4,22 @@@
  
  #include <linux/sched.h>
  #include <linux/kernfs.h>
 +#include <linux/fs_context.h>
  #include <linux/jump_label.h>
  
- #define IA32_L3_QOS_CFG		0xc81
- #define IA32_L2_QOS_CFG		0xc82
- #define IA32_L3_CBM_BASE	0xc90
- #define IA32_L2_CBM_BASE	0xd10
- #define IA32_MBA_THRTL_BASE	0xd50
+ #define MSR_IA32_L3_QOS_CFG		0xc81
+ #define MSR_IA32_L2_QOS_CFG		0xc82
+ #define MSR_IA32_L3_CBM_BASE		0xc90
+ #define MSR_IA32_L2_CBM_BASE		0xd10
+ #define MSR_IA32_MBA_THRTL_BASE		0xd50
+ #define MSR_IA32_MBA_BW_BASE		0xc0000200
  
- #define L3_QOS_CDP_ENABLE	0x01ULL
+ #define MSR_IA32_QM_CTR			0x0c8e
+ #define MSR_IA32_QM_EVTSEL		0x0c8d
  
- #define L2_QOS_CDP_ENABLE	0x01ULL
+ #define L3_QOS_CDP_ENABLE		0x01ULL
+ 
+ #define L2_QOS_CDP_ENABLE		0x01ULL
  
  /*
   * Event IDs are used to program IA32_QM_EVTSEL before reading event
arch/x86/kernel/cpu/resctrl/rdtgroup.c +0 -0
diff --cc arch/x86/kernel/cpu/resctrl/rdtgroup.c
index 37c0ccb50823,8388adf241b2..93cb6f994681
@@@ -2032,88 -2065,8 +2032,91 @@@ out
  	rdt_last_cmd_clear();
  	mutex_unlock(&rdtgroup_mutex);
  	cpus_read_unlock();
 +	return ret;
 +}
 +
 +enum rdt_param {
 +	Opt_cdp,
 +	Opt_cdpl2,
 +	Opt_mba_mpbs,
 +	nr__rdt_params
 +};
  
 -	return dentry;
 +static const struct fs_parameter_spec rdt_param_specs[nr__rdt_params] = {
 +	[Opt_cdp]	= { fs_param_is_flag },
 +	[Opt_cdpl2]	= { fs_param_is_flag },
 +	[Opt_mba_mpbs]	= { fs_param_is_flag },
 +};
 +
 +static const char *const rdt_param_keys[nr__rdt_params] = {
 +	[Opt_cdp]	= "cdp",
 +	[Opt_cdpl2]	= "cdpl2",
 +	[Opt_mba_mpbs]	= "mba_mbps",
 +};
 +
 +static const struct fs_parameter_description rdt_fs_parameters = {
 +	.name		= "rdt",
 +	.nr_params	= nr__rdt_params,
 +	.keys		= rdt_param_keys,
 +	.specs		= rdt_param_specs,
 +	.no_source	= true,
 +};
 +
 +static int rdt_parse_param(struct fs_context *fc, struct fs_parameter *param)
 +{
 +	struct rdt_fs_context *ctx = rdt_fc2context(fc);
 +	struct fs_parse_result result;
 +	int opt;
 +
 +	opt = fs_parse(fc, &rdt_fs_parameters, param, &result);
 +	if (opt < 0)
 +		return opt;
 +
 +	switch (opt) {
 +	case Opt_cdp:
 +		ctx->enable_cdpl3 = true;
 +		return 0;
 +	case Opt_cdpl2:
 +		ctx->enable_cdpl2 = true;
 +		return 0;
 +	case Opt_mba_mpbs:
- 		ctx->enable_mba_mbps = true;
- 		return 0;
++		if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) {
++			ctx->enable_mba_mbps = true;
++			return 0;
++		}
++		break;
 +	}
 +
 +	return -EINVAL;
 +}
 +
 +static void rdt_fs_context_free(struct fs_context *fc)
 +{
 +	struct rdt_fs_context *ctx = rdt_fc2context(fc);
 +
 +	kernfs_free_fs_context(fc);
 +	kfree(ctx);
 +}
 +
 +static const struct fs_context_operations rdt_fs_context_ops = {
 +	.free		= rdt_fs_context_free,
 +	.parse_param	= rdt_parse_param,
 +	.get_tree	= rdt_get_tree,
 +};
 +
 +static int rdt_init_fs_context(struct fs_context *fc, struct dentry *reference)
 +{
 +	struct rdt_fs_context *ctx;
 +
 +	ctx = kzalloc(sizeof(struct rdt_fs_context), GFP_KERNEL);
 +	if (!ctx)
 +		return -ENOMEM;
 +
 +	ctx->kfc.root = rdt_root;
 +	ctx->kfc.magic = RDTGROUP_SUPER_MAGIC;
 +	fc->fs_private = &ctx->kfc;
 +	fc->ops = &rdt_fs_context_ops;
 +	return 0;
  }
  
  static int reset_all_ctrls(struct rdt_resource *r)
arch/x86/kernel/process_32.c +0 -0
diff --cc arch/x86/kernel/process_32.c
index d3e593eb189f,dc4d92764d1a..9d08f0510620
@@@ -56,11 -56,9 +56,11 @@@
  #include <asm/debugreg.h>
  #include <asm/switch_to.h>
  #include <asm/vm86.h>
- #include <asm/intel_rdt_sched.h>
+ #include <asm/resctrl_sched.h>
  #include <asm/proto.h>
  
 +#include "process.h"
 +
  void __show_regs(struct pt_regs *regs, enum show_regs_mode mode)
  {
  	unsigned long cr0 = 0L, cr2 = 0L, cr3 = 0L, cr4 = 0L;
-- 

Regards/Gruss,
Boris.

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)

#1 lore raw
Quoted 3 lines · Borislav Petkov

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

I've pulled this, but I think the new config option name is bad.

I think it should probably have been called "X86_RESCTRL" instead of just "RESCTRL". That's way too generic a name for something that is (at least currently) very much an x86 feature.

It not only is x86-specific right now, it's specific to very few resources. It's not like this is some generic resource control, it's very much about low-level CPU resources. That should show in the name.

I've left it alone, and maybe it might even be cross-architecture some day (there's already a hack in the scheduler), but I think it's a bit misleading to have so a common name for such a specialized thing.

Even if it some day gets to be cross-architecture and isn't limited to x86, at that point it _still_ wouldn't be "RESCTRL", it would be "CPU_RESCTRL" or something.

No?

Linus

#2 lore raw
Quoted 5 lines · Linus Torvalds

I've pulled this, but I think the new config option name is bad.

I think it should probably have been called "X86_RESCTRL" instead of just "RESCTRL". That's way too generic a name for something that is (at least currently) very much an x86 feature.

Right you are...

Quoted 4 lines

It not only is x86-specific right now, it's specific to very few resources. It's not like this is some generic resource control, it's very much about low-level CPU resources. That should show in the name.

Quoted 8 lines

I've left it alone, and maybe it might even be cross-architecture some day (there's already a hack in the scheduler),
but I think it's a bit misleading to have so a common name for such a specialized thing.

Even if it some day gets to be cross-architecture and isn't limited to x86, at that point it _still_ wouldn't be "RESCTRL", it would be "CPU_RESCTRL" or something.

... and yap, that is already going in the cross-arch direction as apparently there's work to have a similar thing on the ARM64 side:

https://lore.kernel.org/lkml/[email protected]/T/#u

The intent is, AFAIU, to keep at least the user interface in the resctrl fs the same as on x86 so that there's no unnecessary user confusion. And from peeking at that patchset a bit, it looks like we'll need a generic

CONFIG_RESCTRL

which should enable the arch-agnostic piece in fs/ and then the arch-specific counterpart which we'll probably put behind CONFIG_X86_RESCTRL and CONFIG_ARM64_RESCTRL, respectively.

I guess I can send you a patch renaming the x86 config option to X86_RESCTRL and the ARM64 side will fall into place when ready. And it'll extract the generic bits into that separate generic config option.

Thoughts?

Signature · 4 lines
Regards/Gruss,
    Boris.

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
#3 lore raw
Quoted 11 lines · Borislav Petkov

The intent is, AFAIU, to keep at least the user interface in the resctrl fs the same as on x86 so that there's no unnecessary user confusion. And from peeking at that patchset a bit, it looks like we'll need a generic

CONFIG_RESCTRL

which should enable the arch-agnostic piece in fs/ and then the arch-specific counterpart which we'll probably put behind CONFIG_X86_RESCTRL and CONFIG_ARM64_RESCTRL, respectively.

Quoted 5 lines

I guess I can send you a patch renaming the x86 config option to X86_RESCTRL and the ARM64 side will fall into place when ready. And it'll extract the generic bits into that separate generic config option.

Thoughts?

That sounds mostly good to me. Except I still think that "CONFIG_RESCTRL" is too generic, because it's really not about resources in general, it's literally about specific CPU resources.

So I'd prefer to call the option for the generic code "CONFIG_CPU_RESCTRL", which is then selected by the arch option (ie CONFIG_{X86,ARM64}_RESCTRL).

Anyway, this is mostly bikeshedding, but naming is fairly important. But not time-critical at this point,

Linus

#4 lore raw
In reply to Borislav Petkov
Quoted 8 lines · Borislav Petkov
Quoted 5 lines · Linus Torvalds

I've pulled this, but I think the new config option name is bad.

I think it should probably have been called "X86_RESCTRL" instead of just "RESCTRL". That's way too generic a name for something that is (at least currently) very much an x86 feature.

Right you are...

... and it's almost as if someone complained about this already:

https://lkml.org/lkml/2018/11/23/389

"Also, the Kconfig space, when it gets extended with the AMD bits, should
probably follow the same nomenclature: CONFIG_X86_CPU_RESOURCE_CONTROL=yor such."

;-)

Anyway, I kind of dropped the ball after that first round of complaints, should have looked again.

Thanks,

Ingo

#5 lore raw

PATCH 1/1 x86/cache: Rename config option to CONFIG_X86_RESCTRL

Will queue to x86/urgent if no issues.

---
From: Borislav Petkov <[email protected]>

CONFIG_RESCTRL is too generic. The final goal is to have a generic option called like this which is selected by the arch-specific ones CONFIG_X86_RESCTRL and CONFIG_ARM64_RESCTRL. The generic one will cover the resctrl filesystem and other generic and shared bits of functionality.

---
 Documentation/x86/resctrl_ui.txt     | 2 +-
 arch/x86/Kconfig                     | 2 +-
 arch/x86/include/asm/resctrl_sched.h | 4 ++--
 arch/x86/kernel/cpu/Makefile         | 2 +-
 arch/x86/kernel/cpu/resctrl/Makefile | 4 ++--
 include/linux/sched.h                | 2 +-
 6 files changed, 8 insertions(+), 8 deletions(-)
Documentation/x86/resctrl_ui.txt +1 -1
index d9aed8303984..e8e8d14d3c4e 100644
@@ -9,7 +9,7 @@ Fenghua Yu <[email protected]>
 Tony Luck <[email protected]>
 Vikas Shivappa <[email protected]>
 
-This feature is enabled by the CONFIG_RESCTRL and the X86 /proc/cpuinfo
+This feature is enabled by the CONFIG_X86_RESCTRL and the x86 /proc/cpuinfo
 flag bits:
 RDT (Resource Director Technology) Allocation - "rdt_a"
 CAT (Cache Allocation Technology) - "cat_l3", "cat_l2"
arch/x86/Kconfig +1 -1
index 6185d4f33296..15af091611e2 100644
@@ -446,7 +446,7 @@ config RETPOLINE
 	  branches. Requires a compiler with -mindirect-branch=thunk-extern
 	  support for full protection. The kernel may run slower.
 
-config RESCTRL
+config X86_RESCTRL
 	bool "Resource Control support"
 	depends on X86 && (CPU_SUP_INTEL || CPU_SUP_AMD)
 	select KERNFS
arch/x86/include/asm/resctrl_sched.h +2 -2
index 54990fe2a3ae..40ebddde6ac2 100644
@@ -2,7 +2,7 @@
 #ifndef _ASM_X86_RESCTRL_SCHED_H
 #define _ASM_X86_RESCTRL_SCHED_H
 
-#ifdef CONFIG_RESCTRL
+#ifdef CONFIG_X86_RESCTRL
 
 #include <linux/sched.h>
 #include <linux/jump_label.h>
@@ -88,6 +88,6 @@ static inline void resctrl_sched_in(void)
 
 static inline void resctrl_sched_in(void) {}
 
-#endif /* CONFIG_RESCTRL */
+#endif /* CONFIG_X86_RESCTRL */
 
 #endif /* _ASM_X86_RESCTRL_SCHED_H */
arch/x86/kernel/cpu/Makefile +1 -1
index ac78f90aea56..b6fa0869f7aa 100644
@@ -39,7 +39,7 @@ obj-$(CONFIG_CPU_SUP_UMC_32)		+= umc.o
 obj-$(CONFIG_X86_MCE)			+= mce/
 obj-$(CONFIG_MTRR)			+= mtrr/
 obj-$(CONFIG_MICROCODE)			+= microcode/
-obj-$(CONFIG_RESCTRL)			+= resctrl/
+obj-$(CONFIG_X86_RESCTRL)		+= resctrl/
 
 obj-$(CONFIG_X86_LOCAL_APIC)		+= perfctr-watchdog.o
 
arch/x86/kernel/cpu/resctrl/Makefile +2 -2
index 6895049ceef7..1cabe6fd8e11 100644
@@ -1,4 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0
-obj-$(CONFIG_RESCTRL)	+= core.o rdtgroup.o monitor.o
-obj-$(CONFIG_RESCTRL)	+= ctrlmondata.o pseudo_lock.o
+obj-$(CONFIG_X86_RESCTRL)	+= core.o rdtgroup.o monitor.o
+obj-$(CONFIG_X86_RESCTRL)	+= ctrlmondata.o pseudo_lock.o
 CFLAGS_pseudo_lock.o = -I$(src)
include/linux/sched.h +1 -1
index 89541d248893..224666226e87 100644
@@ -995,7 +995,7 @@ struct task_struct {
 	/* cg_list protected by css_set_lock and tsk->alloc_lock: */
 	struct list_head		cg_list;
 #endif
-#ifdef CONFIG_RESCTRL
+#ifdef CONFIG_X86_RESCTRL
 	u32				closid;
 	u32				rmid;
 #endif
Signature · 7 lines
2.19.1

-- 
Regards/Gruss,
    Boris.

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
#6 lore raw

Re: [PATCH] x86/cache: Rename config option to CONFIG_X86_RESCTRL

Quoted 2 lines · Borislav Petkov

Will queue to x86/urgent if no issues.

Thanks,

Linus

#7 lore raw

[tip:x86/urgent] x86/cache: Rename config option to CONFIG_X86_RESCTRL

In reply to Borislav Petkov
x86/cache: Rename config option to CONFIG_X86_RESCTRL
Commit-ID:  90802938f7e88045ace123e105e22e8c3e7f9c7e
Gitweb:     https://git.kernel.org/tip/90802938f7e88045ace123e105e22e8c3e7f9c7e
Author:     Borislav Petkov <[email protected]>
AuthorDate: Tue, 8 Jan 2019 17:38:29 +0100
Committer:  Borislav Petkov <[email protected]>
CommitDate: Wed, 9 Jan 2019 10:29:03 +0100

x86/cache: Rename config option to CONFIG_X86_RESCTRL

CONFIG_RESCTRL is too generic. The final goal is to have a generic option called like this which is selected by the arch-specific ones CONFIG_X86_RESCTRL and CONFIG_ARM64_RESCTRL. The generic one will cover the resctrl filesystem and other generic and shared bits of functionality.

---
 Documentation/x86/resctrl_ui.txt     | 2 +-
 arch/x86/Kconfig                     | 2 +-
 arch/x86/include/asm/resctrl_sched.h | 4 ++--
 arch/x86/kernel/cpu/Makefile         | 2 +-
 arch/x86/kernel/cpu/resctrl/Makefile | 4 ++--
 include/linux/sched.h                | 2 +-
 6 files changed, 8 insertions(+), 8 deletions(-)
Documentation/x86/resctrl_ui.txt +1 -1
index d9aed8303984..e8e8d14d3c4e 100644
@@ -9,7 +9,7 @@ Fenghua Yu <[email protected]>
 Tony Luck <[email protected]>
 Vikas Shivappa <[email protected]>
 
-This feature is enabled by the CONFIG_RESCTRL and the X86 /proc/cpuinfo
+This feature is enabled by the CONFIG_X86_RESCTRL and the x86 /proc/cpuinfo
 flag bits:
 RDT (Resource Director Technology) Allocation - "rdt_a"
 CAT (Cache Allocation Technology) - "cat_l3", "cat_l2"
arch/x86/Kconfig +1 -1
index 6185d4f33296..15af091611e2 100644
@@ -446,7 +446,7 @@ config RETPOLINE
 	  branches. Requires a compiler with -mindirect-branch=thunk-extern
 	  support for full protection. The kernel may run slower.
 
-config RESCTRL
+config X86_RESCTRL
 	bool "Resource Control support"
 	depends on X86 && (CPU_SUP_INTEL || CPU_SUP_AMD)
 	select KERNFS
arch/x86/include/asm/resctrl_sched.h +2 -2
index 54990fe2a3ae..40ebddde6ac2 100644
@@ -2,7 +2,7 @@
 #ifndef _ASM_X86_RESCTRL_SCHED_H
 #define _ASM_X86_RESCTRL_SCHED_H
 
-#ifdef CONFIG_RESCTRL
+#ifdef CONFIG_X86_RESCTRL
 
 #include <linux/sched.h>
 #include <linux/jump_label.h>
@@ -88,6 +88,6 @@ static inline void resctrl_sched_in(void)
 
 static inline void resctrl_sched_in(void) {}
 
-#endif /* CONFIG_RESCTRL */
+#endif /* CONFIG_X86_RESCTRL */
 
 #endif /* _ASM_X86_RESCTRL_SCHED_H */
arch/x86/kernel/cpu/Makefile +1 -1
index ac78f90aea56..b6fa0869f7aa 100644
@@ -39,7 +39,7 @@ obj-$(CONFIG_CPU_SUP_UMC_32)		+= umc.o
 obj-$(CONFIG_X86_MCE)			+= mce/
 obj-$(CONFIG_MTRR)			+= mtrr/
 obj-$(CONFIG_MICROCODE)			+= microcode/
-obj-$(CONFIG_RESCTRL)			+= resctrl/
+obj-$(CONFIG_X86_RESCTRL)		+= resctrl/
 
 obj-$(CONFIG_X86_LOCAL_APIC)		+= perfctr-watchdog.o
 
arch/x86/kernel/cpu/resctrl/Makefile +2 -2
index 6895049ceef7..1cabe6fd8e11 100644
@@ -1,4 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0
-obj-$(CONFIG_RESCTRL)	+= core.o rdtgroup.o monitor.o
-obj-$(CONFIG_RESCTRL)	+= ctrlmondata.o pseudo_lock.o
+obj-$(CONFIG_X86_RESCTRL)	+= core.o rdtgroup.o monitor.o
+obj-$(CONFIG_X86_RESCTRL)	+= ctrlmondata.o pseudo_lock.o
 CFLAGS_pseudo_lock.o = -I$(src)
include/linux/sched.h +1 -1
index 89541d248893..224666226e87 100644
@@ -995,7 +995,7 @@ struct task_struct {
 	/* cg_list protected by css_set_lock and tsk->alloc_lock: */
 	struct list_head		cg_list;
 #endif
-#ifdef CONFIG_RESCTRL
+#ifdef CONFIG_X86_RESCTRL
 	u32				closid;
 	u32				rmid;
 #endif
reviewer Tested-by on v1 1/1
#8 lore raw

RE: [PATCH] x86/cache: Rename config option to CONFIG_X86_RESCTRL

In reply to Borislav Petkov

Looks good to me. Sanity tested the patch.

Quoted 22 lines

-----Original Message-----
From: Borislav Petkov <[email protected]>
Sent: Tuesday, January 8, 2019 11:14 AM
To: Ingo Molnar <[email protected]>
Cc: Linus Torvalds <[email protected]>; x86-ml <[email protected]>; lkml <[email protected]>; James Morse <[email protected]>; Moger, Babu <[email protected]>; Fenghua Yu <[email protected]>; Reinette Chatre <[email protected]>; Tony Luck <[email protected]>
Subject: [PATCH] x86/cache: Rename config option to CONFIG_X86_RESCTRL

Will queue to x86/urgent if no issues.

---
From: Borislav Petkov <[email protected]>

CONFIG_RESCTRL is too generic. The final goal is to have a generic option called like this which is selected by the arch-specific ones CONFIG_X86_RESCTRL and CONFIG_ARM64_RESCTRL. The generic one will cover the resctrl filesystem and other generic and shared bits of functionality.

Quoted 3 lines
Quoted 113 lines
Cc Babu Moger <[email protected]>
Cc Fenghua Yu <[email protected]>
Cc James Morse <[email protected]>
Cc Reinette Chatre <[email protected]>
Cc Tony Luck <[email protected]>
---
 Documentation/x86/resctrl_ui.txt     | 2 +-
 arch/x86/Kconfig                     | 2 +-
 arch/x86/include/asm/resctrl_sched.h | 4 ++--
 arch/x86/kernel/cpu/Makefile         | 2 +-
 arch/x86/kernel/cpu/resctrl/Makefile | 4 ++--
 include/linux/sched.h                | 2 +-
 6 files changed, 8 insertions(+), 8 deletions(-)
Documentation/x86/resctrl_ui.txt +1 -1
index d9aed8303984..e8e8d14d3c4e 100644
@@ -9,7 +9,7 @@ Fenghua Yu <[email protected]>
 Tony Luck <[email protected]>
 Vikas Shivappa <[email protected]>
 
-This feature is enabled by the CONFIG_RESCTRL and the X86 /proc/cpuinfo
+This feature is enabled by the CONFIG_X86_RESCTRL and the x86

/proc/cpuinfo
flag bits:
RDT (Resource Director Technology) Allocation - "rdt_a" CAT (Cache Allocation Technology) - "cat_l3", "cat_l2"

arch/x86/Kconfig +1 -1
index 6185d4f33296..15af091611e2 100644
@@ -446,7 +446,7 @@ config RETPOLINE
 	  branches. Requires a compiler with -mindirect-branch=thunk-extern
 	  support for full protection. The kernel may run slower.
 
-config RESCTRL
+config X86_RESCTRL
 	bool "Resource Control support"
 	depends on X86 && (CPU_SUP_INTEL || CPU_SUP_AMD)
 	select KERNFS
arch/x86/include/asm/resctrl_sched.h +2 -2
index 54990fe2a3ae..40ebddde6ac2 100644
@@ -2,7 +2,7 @@
 #ifndef _ASM_X86_RESCTRL_SCHED_H
 #define _ASM_X86_RESCTRL_SCHED_H
 
-#ifdef CONFIG_RESCTRL
+#ifdef CONFIG_X86_RESCTRL
 
 #include <linux/sched.h>
 #include <linux/jump_label.h>
@@ -88,6 +88,6 @@ static inline void resctrl_sched_in(void)
 
 static inline void resctrl_sched_in(void) {}
 
-#endif /* CONFIG_RESCTRL */
+#endif /* CONFIG_X86_RESCTRL */
 
 #endif /* _ASM_X86_RESCTRL_SCHED_H */
arch/x86/kernel/cpu/Makefile +0 -0
index ac78f90aea56..b6fa0869f7aa 100644
@@ -39,7 +39,7 @@ obj-$(CONFIG_CPU_SUP_UMC_32)		+=

umc.o
obj-$(CONFIG_X86_MCE) += mce/
obj-$(CONFIG_MTRR) += mtrr/
obj-$(CONFIG_MICROCODE) += microcode/

arch/x86/kernel/cpu/Makefile +1 -1
-obj-$(CONFIG_RESCTRL)			+= resctrl/
+obj-$(CONFIG_X86_RESCTRL)		+= resctrl/
 
 obj-$(CONFIG_X86_LOCAL_APIC)		+= perfctr-watchdog.o
arch/x86/kernel/cpu/resctrl/Makefile +2 -2
index 6895049ceef7..1cabe6fd8e11 100644
@@ -1,4 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0
-obj-$(CONFIG_RESCTRL)	+= core.o rdtgroup.o monitor.o
-obj-$(CONFIG_RESCTRL)	+= ctrlmondata.o pseudo_lock.o
+obj-$(CONFIG_X86_RESCTRL)	+= core.o rdtgroup.o monitor.o
+obj-$(CONFIG_X86_RESCTRL)	+= ctrlmondata.o pseudo_lock.o
 CFLAGS_pseudo_lock.o = -I$(src)
include/linux/sched.h +1 -2
index 89541d248893..224666226e87 100644
@@ -995,7 +995,7 @@ struct task_struct {
 	/* cg_list protected by css_set_lock and tsk->alloc_lock: */
 	struct list_head		cg_list;
 #endif
-#ifdef CONFIG_RESCTRL
+#ifdef CONFIG_X86_RESCTRL
 	u32				closid;
 	u32				rmid;
 #endif
--

2.19.1

--
Regards/Gruss,
Boris.

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)

merge bot Merged
#9 lore raw
In reply to Borislav Petkov
The pull request you sent on Sun, 23 Dec 2018 13:48:59 +0100:

The pull request you sent on Sun, 23 Dec 2018 13:48:59 +0100:

Quoted 1 line

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86-cache-for-linus

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/a52fb43a5faa40507cb164a793a7fa08da863ac7

Thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.wiki.kernel.org/userdoc/prtracker