Commit bff70402 authored by James Morse's avatar James Morse Committed by Borislav Petkov (AMD)
Browse files

fs/resctrl: Add boiler plate for external resctrl code



Add Makefile and Kconfig for fs/resctrl. Add ARCH_HAS_CPU_RESCTRL
for the common parts of the resctrl interface and make X86_CPU_RESCTRL
select this.

Adding an include of asm/resctrl.h to linux/resctrl.h allows the
/fs/resctrl files to switch over to using this header instead.

Co-developed-by: default avatarDave Martin <Dave.Martin@arm.com>
Signed-off-by: default avatarDave Martin <Dave.Martin@arm.com>
Signed-off-by: default avatarJames Morse <james.morse@arm.com>
Signed-off-by: default avatarBorislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: default avatarShaopeng Tan <tan.shaopeng@jp.fujitsu.com>
Reviewed-by: default avatarTony Luck <tony.luck@intel.com>
Reviewed-by: default avatarFenghua Yu <fenghuay@nvidia.com>
Reviewed-by: default avatarReinette Chatre <reinette.chatre@intel.com>
Tested-by: default avatarFenghua Yu <fenghuay@nvidia.com>
Tested-by: Carl Worth <carl@os.amperecomputing.com> # arm64
Tested-by: default avatarShaopeng Tan <tan.shaopeng@jp.fujitsu.com>
Tested-by: default avatarPeter Newman <peternewman@google.com>
Tested-by: Amit Singh Tomar <amitsinght@marvell.com> # arm64
Tested-by: Shanker Donthineni <sdonthineni@nvidia.com> # arm64
Tested-by: default avatarBabu Moger <babu.moger@amd.com>
Tested-by: default avatarTony Luck <tony.luck@intel.com>
Link: https://lore.kernel.org/20250515165855.31452-16-james.morse@arm.com
parent 003e8607
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -20427,6 +20427,7 @@ S: Supported
F:	Documentation/arch/x86/resctrl*
F:	arch/x86/include/asm/resctrl.h
F:	arch/x86/kernel/cpu/resctrl/
F:	fs/resctrl/
F:	include/linux/resctrl*.h
F:	tools/testing/selftests/resctrl/
+8 −0
Original line number Diff line number Diff line
@@ -1518,6 +1518,14 @@ config STRICT_MODULE_RWX
config ARCH_HAS_PHYS_TO_DMA
	bool

config ARCH_HAS_CPU_RESCTRL
	bool
	help
	  An architecture selects this option to indicate that the necessary
	  hooks are provided to support the common memory system usage
	  monitoring and control interfaces provided by the 'resctrl'
	  filesystem (see RESCTRL_FS).

config HAVE_ARCH_COMPILER_H
	bool
	help
+3 −8
Original line number Diff line number Diff line
@@ -507,8 +507,9 @@ config X86_MPPARSE
config X86_CPU_RESCTRL
	bool "x86 CPU resource control support"
	depends on X86 && (CPU_SUP_INTEL || CPU_SUP_AMD)
	select KERNFS
	select PROC_CPU_RESCTRL		if PROC_FS
	depends on MISC_FILESYSTEMS
	select ARCH_HAS_CPU_RESCTRL
	select RESCTRL_FS
	select RESCTRL_FS_PSEUDO_LOCK
	help
	  Enable x86 CPU resource control support.
@@ -526,12 +527,6 @@ config X86_CPU_RESCTRL

	  Say N if unsure.

config RESCTRL_FS_PSEUDO_LOCK
	bool
	help
	  Software mechanism to pin data in a cache portion using
	  micro-architecture specific knowledge.

config X86_FRED
	bool "Flexible Return and Event Delivery"
	depends on X86_64
+0 −2
Original line number Diff line number Diff line
@@ -9,8 +9,6 @@
#include <linux/jump_label.h>
#include <linux/tick.h>

#include <asm/resctrl.h>

#define L3_QOS_CDP_ENABLE		0x01ULL

#define L2_QOS_CDP_ENABLE		0x01ULL
+1 −1
Original line number Diff line number Diff line
@@ -19,11 +19,11 @@

#include <linux/cpu.h>
#include <linux/module.h>
#include <linux/resctrl.h>
#include <linux/sizes.h>
#include <linux/slab.h>

#include <asm/cpu_device_id.h>
#include <asm/resctrl.h>

#include "internal.h"

Loading