linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT PULL] x86/cache updates for 4.21
@ 2018-12-23 12:48 Borislav Petkov
  2018-12-26 20:26 ` Linus Torvalds
  2018-12-26 21:10 ` [GIT PULL] x86/cache updates for 4.21 pr-tracker-bot
  0 siblings, 2 replies; 10+ messages in thread
From: Borislav Petkov @ 2018-12-23 12:48 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: x86-ml, lkml

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 <bp@suse.de>
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
    
    Signed-off-by: Borislav Petkov <bp@suse.de>

diff --cc arch/x86/Kconfig
index 642353a65649,2d0577e805d2..62adf94c8dfa
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@@ -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.
  
diff --cc arch/x86/kernel/cpu/resctrl/internal.h
index d5ec5643e7ab,822b7db634ee..e49b77283924
--- a/arch/x86/kernel/cpu/resctrl/internal.h
+++ b/arch/x86/kernel/cpu/resctrl/internal.h
@@@ -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
diff --cc arch/x86/kernel/cpu/resctrl/rdtgroup.c
index 37c0ccb50823,8388adf241b2..93cb6f994681
--- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c
+++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
@@@ -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)
diff --cc arch/x86/kernel/process_32.c
index d3e593eb189f,dc4d92764d1a..9d08f0510620
--- a/arch/x86/kernel/process_32.c
+++ b/arch/x86/kernel/process_32.c
@@@ -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)

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [GIT PULL] x86/cache updates for 4.21
  2018-12-23 12:48 [GIT PULL] x86/cache updates for 4.21 Borislav Petkov
@ 2018-12-26 20:26 ` Linus Torvalds
  2018-12-26 20:56   ` Borislav Petkov
  2018-12-26 21:10 ` [GIT PULL] x86/cache updates for 4.21 pr-tracker-bot
  1 sibling, 1 reply; 10+ messages in thread
From: Linus Torvalds @ 2018-12-26 20:26 UTC (permalink / raw)
  To: Borislav Petkov; +Cc: x86-ml, lkml

On Sun, Dec 23, 2018 at 4:49 AM Borislav Petkov <bp@suse.de> wrote:
>
>  - 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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [GIT PULL] x86/cache updates for 4.21
  2018-12-26 20:26 ` Linus Torvalds
@ 2018-12-26 20:56   ` Borislav Petkov
  2018-12-26 21:01     ` Linus Torvalds
  2018-12-28 12:49     ` Ingo Molnar
  0 siblings, 2 replies; 10+ messages in thread
From: Borislav Petkov @ 2018-12-26 20:56 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: x86-ml, lkml, James Morse

On Wed, Dec 26, 2018 at 12:26:12PM -0800, Linus Torvalds wrote:
> 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...

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

... 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/20180824104519.11203-1-james.morse@arm.com/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?

-- 
Regards/Gruss,
    Boris.

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [GIT PULL] x86/cache updates for 4.21
  2018-12-26 20:56   ` Borislav Petkov
@ 2018-12-26 21:01     ` Linus Torvalds
  2018-12-28 12:49     ` Ingo Molnar
  1 sibling, 0 replies; 10+ messages in thread
From: Linus Torvalds @ 2018-12-26 21:01 UTC (permalink / raw)
  To: Borislav Petkov; +Cc: x86-ml, lkml, James Morse

On Wed, Dec 26, 2018 at 12:56 PM Borislav Petkov <bp@suse.de> wrote:
>
> 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?

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [GIT PULL] x86/cache updates for 4.21
  2018-12-23 12:48 [GIT PULL] x86/cache updates for 4.21 Borislav Petkov
  2018-12-26 20:26 ` Linus Torvalds
@ 2018-12-26 21:10 ` pr-tracker-bot
  1 sibling, 0 replies; 10+ messages in thread
From: pr-tracker-bot @ 2018-12-26 21:10 UTC (permalink / raw)
  To: Borislav Petkov; +Cc: Linus Torvalds, x86-ml, lkml

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

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

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [GIT PULL] x86/cache updates for 4.21
  2018-12-26 20:56   ` Borislav Petkov
  2018-12-26 21:01     ` Linus Torvalds
@ 2018-12-28 12:49     ` Ingo Molnar
  2019-01-08 17:14       ` [PATCH] x86/cache: Rename config option to CONFIG_X86_RESCTRL Borislav Petkov
  1 sibling, 1 reply; 10+ messages in thread
From: Ingo Molnar @ 2018-12-28 12:49 UTC (permalink / raw)
  To: Borislav Petkov; +Cc: Linus Torvalds, x86-ml, lkml, James Morse


* Borislav Petkov <bp@suse.de> wrote:

> On Wed, Dec 26, 2018 at 12:26:12PM -0800, Linus Torvalds wrote:
> > 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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH] x86/cache: Rename config option to CONFIG_X86_RESCTRL
  2018-12-28 12:49     ` Ingo Molnar
@ 2019-01-08 17:14       ` Borislav Petkov
  2019-01-08 17:34         ` Linus Torvalds
                           ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Borislav Petkov @ 2019-01-08 17:14 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Linus Torvalds, x86-ml, lkml, James Morse, Babu Moger,
	Fenghua Yu, Reinette Chatre, Tony Luck

Will queue to x86/urgent if no issues.

---
From: Borislav Petkov <bp@suse.de>

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.

Signed-off-by: Borislav Petkov <bp@suse.de>
Suggested-by: Ingo Molnar <mingo@kernel.org>
Requested-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Babu Moger <babu.moger@amd.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: James Morse <james.morse@arm.com>
Cc: Reinette Chatre <reinette.chatre@intel.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: x86@kernel.org
---
 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(-)

diff --git a/Documentation/x86/resctrl_ui.txt b/Documentation/x86/resctrl_ui.txt
index d9aed8303984..e8e8d14d3c4e 100644
--- a/Documentation/x86/resctrl_ui.txt
+++ b/Documentation/x86/resctrl_ui.txt
@@ -9,7 +9,7 @@ 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_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"
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 6185d4f33296..15af091611e2 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -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
diff --git a/arch/x86/include/asm/resctrl_sched.h b/arch/x86/include/asm/resctrl_sched.h
index 54990fe2a3ae..40ebddde6ac2 100644
--- a/arch/x86/include/asm/resctrl_sched.h
+++ b/arch/x86/include/asm/resctrl_sched.h
@@ -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 */
diff --git a/arch/x86/kernel/cpu/Makefile b/arch/x86/kernel/cpu/Makefile
index ac78f90aea56..b6fa0869f7aa 100644
--- a/arch/x86/kernel/cpu/Makefile
+++ b/arch/x86/kernel/cpu/Makefile
@@ -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
 
diff --git a/arch/x86/kernel/cpu/resctrl/Makefile b/arch/x86/kernel/cpu/resctrl/Makefile
index 6895049ceef7..1cabe6fd8e11 100644
--- a/arch/x86/kernel/cpu/resctrl/Makefile
+++ b/arch/x86/kernel/cpu/resctrl/Makefile
@@ -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)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 89541d248893..224666226e87 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -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)

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] x86/cache: Rename config option to CONFIG_X86_RESCTRL
  2019-01-08 17:14       ` [PATCH] x86/cache: Rename config option to CONFIG_X86_RESCTRL Borislav Petkov
@ 2019-01-08 17:34         ` Linus Torvalds
  2019-01-09 10:03         ` [tip:x86/urgent] " tip-bot for Borislav Petkov
  2019-01-09 17:03         ` [PATCH] " Moger, Babu
  2 siblings, 0 replies; 10+ messages in thread
From: Linus Torvalds @ 2019-01-08 17:34 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: Ingo Molnar, x86-ml, lkml, James Morse, Babu Moger, Fenghua Yu,
	Reinette Chatre, Tony Luck

On Tue, Jan 8, 2019 at 9:14 AM Borislav Petkov <bp@suse.de> wrote:
>
> Will queue to x86/urgent if no issues.

Thanks,

                 Linus

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [tip:x86/urgent] x86/cache: Rename config option to CONFIG_X86_RESCTRL
  2019-01-08 17:14       ` [PATCH] x86/cache: Rename config option to CONFIG_X86_RESCTRL Borislav Petkov
  2019-01-08 17:34         ` Linus Torvalds
@ 2019-01-09 10:03         ` tip-bot for Borislav Petkov
  2019-01-09 17:03         ` [PATCH] " Moger, Babu
  2 siblings, 0 replies; 10+ messages in thread
From: tip-bot for Borislav Petkov @ 2019-01-09 10:03 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: mingo, tglx, linux-kernel, hpa, tony.luck, torvalds,
	reinette.chatre, james.morse, bp, babu.moger, fenghua.yu

Commit-ID:  90802938f7e88045ace123e105e22e8c3e7f9c7e
Gitweb:     https://git.kernel.org/tip/90802938f7e88045ace123e105e22e8c3e7f9c7e
Author:     Borislav Petkov <bp@suse.de>
AuthorDate: Tue, 8 Jan 2019 17:38:29 +0100
Committer:  Borislav Petkov <bp@suse.de>
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.

Signed-off-by: Borislav Petkov <bp@suse.de>
Suggested-by: Ingo Molnar <mingo@kernel.org>
Requested-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Babu Moger <babu.moger@amd.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: James Morse <james.morse@arm.com>
Cc: Reinette Chatre <reinette.chatre@intel.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: x86@kernel.org
Link: http://lkml.kernel.org/r/20190108171401.GC12235@zn.tnic
---
 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(-)

diff --git a/Documentation/x86/resctrl_ui.txt b/Documentation/x86/resctrl_ui.txt
index d9aed8303984..e8e8d14d3c4e 100644
--- a/Documentation/x86/resctrl_ui.txt
+++ b/Documentation/x86/resctrl_ui.txt
@@ -9,7 +9,7 @@ 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_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"
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 6185d4f33296..15af091611e2 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -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
diff --git a/arch/x86/include/asm/resctrl_sched.h b/arch/x86/include/asm/resctrl_sched.h
index 54990fe2a3ae..40ebddde6ac2 100644
--- a/arch/x86/include/asm/resctrl_sched.h
+++ b/arch/x86/include/asm/resctrl_sched.h
@@ -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 */
diff --git a/arch/x86/kernel/cpu/Makefile b/arch/x86/kernel/cpu/Makefile
index ac78f90aea56..b6fa0869f7aa 100644
--- a/arch/x86/kernel/cpu/Makefile
+++ b/arch/x86/kernel/cpu/Makefile
@@ -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
 
diff --git a/arch/x86/kernel/cpu/resctrl/Makefile b/arch/x86/kernel/cpu/resctrl/Makefile
index 6895049ceef7..1cabe6fd8e11 100644
--- a/arch/x86/kernel/cpu/resctrl/Makefile
+++ b/arch/x86/kernel/cpu/resctrl/Makefile
@@ -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)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 89541d248893..224666226e87 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -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

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* RE: [PATCH] x86/cache: Rename config option to CONFIG_X86_RESCTRL
  2019-01-08 17:14       ` [PATCH] x86/cache: Rename config option to CONFIG_X86_RESCTRL Borislav Petkov
  2019-01-08 17:34         ` Linus Torvalds
  2019-01-09 10:03         ` [tip:x86/urgent] " tip-bot for Borislav Petkov
@ 2019-01-09 17:03         ` Moger, Babu
  2 siblings, 0 replies; 10+ messages in thread
From: Moger, Babu @ 2019-01-09 17:03 UTC (permalink / raw)
  To: Borislav Petkov, Ingo Molnar
  Cc: Linus Torvalds, x86-ml, lkml, James Morse, Fenghua Yu,
	Reinette Chatre, Tony Luck

Looks good to me. Sanity tested the patch.

> -----Original Message-----
> From: Borislav Petkov <bp@suse.de>
> Sent: Tuesday, January 8, 2019 11:14 AM
> To: Ingo Molnar <mingo@kernel.org>
> Cc: Linus Torvalds <torvalds@linux-foundation.org>; x86-ml
> <x86@kernel.org>; lkml <linux-kernel@vger.kernel.org>; James Morse
> <james.morse@arm.com>; Moger, Babu <Babu.Moger@amd.com>;
> Fenghua Yu <fenghua.yu@intel.com>; Reinette Chatre
> <reinette.chatre@intel.com>; Tony Luck <tony.luck@intel.com>
> Subject: [PATCH] x86/cache: Rename config option to CONFIG_X86_RESCTRL
> 
> Will queue to x86/urgent if no issues.
> 
> ---
> From: Borislav Petkov <bp@suse.de>
> 
> 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.
> 
> Signed-off-by: Borislav Petkov <bp@suse.de>
> Suggested-by: Ingo Molnar <mingo@kernel.org>
> Requested-by: Linus Torvalds <torvalds@linux-foundation.org>

Tested-by: Babu Moger <babu.moger@amd.com>

> Cc: Babu Moger <babu.moger@amd.com>
> Cc: Fenghua Yu <fenghua.yu@intel.com>
> Cc: James Morse <james.morse@arm.com>
> Cc: Reinette Chatre <reinette.chatre@intel.com>
> Cc: Tony Luck <tony.luck@intel.com>
> Cc: x86@kernel.org
> ---
>  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(-)
> 
> diff --git a/Documentation/x86/resctrl_ui.txt
> b/Documentation/x86/resctrl_ui.txt
> index d9aed8303984..e8e8d14d3c4e 100644
> --- a/Documentation/x86/resctrl_ui.txt
> +++ b/Documentation/x86/resctrl_ui.txt
> @@ -9,7 +9,7 @@ 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_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"
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index 6185d4f33296..15af091611e2 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -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
> diff --git a/arch/x86/include/asm/resctrl_sched.h
> b/arch/x86/include/asm/resctrl_sched.h
> index 54990fe2a3ae..40ebddde6ac2 100644
> --- a/arch/x86/include/asm/resctrl_sched.h
> +++ b/arch/x86/include/asm/resctrl_sched.h
> @@ -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 */
> diff --git a/arch/x86/kernel/cpu/Makefile b/arch/x86/kernel/cpu/Makefile
> index ac78f90aea56..b6fa0869f7aa 100644
> --- a/arch/x86/kernel/cpu/Makefile
> +++ b/arch/x86/kernel/cpu/Makefile
> @@ -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
> 
> diff --git a/arch/x86/kernel/cpu/resctrl/Makefile
> b/arch/x86/kernel/cpu/resctrl/Makefile
> index 6895049ceef7..1cabe6fd8e11 100644
> --- a/arch/x86/kernel/cpu/resctrl/Makefile
> +++ b/arch/x86/kernel/cpu/resctrl/Makefile
> @@ -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)
> diff --git a/include/linux/sched.h b/include/linux/sched.h
> index 89541d248893..224666226e87 100644
> --- a/include/linux/sched.h
> +++ b/include/linux/sched.h
> @@ -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)

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-01-09 17:04 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-23 12:48 [GIT PULL] x86/cache updates for 4.21 Borislav Petkov
2018-12-26 20:26 ` Linus Torvalds
2018-12-26 20:56   ` Borislav Petkov
2018-12-26 21:01     ` Linus Torvalds
2018-12-28 12:49     ` Ingo Molnar
2019-01-08 17:14       ` [PATCH] x86/cache: Rename config option to CONFIG_X86_RESCTRL Borislav Petkov
2019-01-08 17:34         ` Linus Torvalds
2019-01-09 10:03         ` [tip:x86/urgent] " tip-bot for Borislav Petkov
2019-01-09 17:03         ` [PATCH] " Moger, Babu
2018-12-26 21:10 ` [GIT PULL] x86/cache updates for 4.21 pr-tracker-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).