Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86/resctrl: Move the filesystem bits to headers visible to fs/resctrl

Once the filesystem parts of resctrl move to fs/resctrl, it cannot rely
on definitions in x86's internal.h.

Move definitions in internal.h that need to be shared between the
filesystem and architecture code to header files that fs/resctrl can
include.

Doing this separately means the filesystem code only moves between files
of the same name, instead of having these changes mixed in too.

Co-developed-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: James Morse <james.morse@arm.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com>
Reviewed-by: Tony Luck <tony.luck@intel.com>
Reviewed-by: Fenghua Yu <fenghuay@nvidia.com>
Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>
Tested-by: Fenghua Yu <fenghuay@nvidia.com>
Tested-by: Carl Worth <carl@os.amperecomputing.com> # arm64
Tested-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com>
Tested-by: Peter Newman <peternewman@google.com>
Tested-by: Amit Singh Tomar <amitsinght@marvell.com> # arm64
Tested-by: Shanker Donthineni <sdonthineni@nvidia.com> # arm64
Tested-by: Babu Moger <babu.moger@amd.com>
Tested-by: Tony Luck <tony.luck@intel.com>
Link: https://lore.kernel.org/20250515165855.31452-17-james.morse@arm.com

authored by

James Morse and committed by
Borislav Petkov (AMD)
3d95a49b bff70402

+11 -9
-9
arch/x86/kernel/cpu/resctrl/internal.h
··· 16 16 #define CQM_LIMBOCHECK_INTERVAL 1000 17 17 18 18 #define MBM_CNTR_WIDTH_BASE 24 19 - #define MBM_OVERFLOW_INTERVAL 1000 20 - #define MAX_MBA_BW 100u 21 19 #define MBA_IS_LINEAR 0x4 22 20 #define MBM_CNTR_WIDTH_OFFSET_AMD 20 23 21 ··· 393 395 extern struct rdtgroup rdtgroup_default; 394 396 extern struct dentry *debugfs_resctrl; 395 397 extern enum resctrl_event_id mba_mbps_default_event; 396 - 397 - static inline bool resctrl_arch_get_cdp_enabled(enum resctrl_res_level l) 398 - { 399 - return rdt_resources_all[l].cdp_enabled; 400 - } 401 - 402 - int resctrl_arch_set_cdp_enabled(enum resctrl_res_level l, bool enable); 403 398 404 399 void arch_mon_domain_online(struct rdt_resource *r, struct rdt_mon_domain *d); 405 400
+5
arch/x86/kernel/cpu/resctrl/rdtgroup.c
··· 2541 2541 return 0; 2542 2542 } 2543 2543 2544 + bool resctrl_arch_get_cdp_enabled(enum resctrl_res_level l) 2545 + { 2546 + return rdt_resources_all[l].cdp_enabled; 2547 + } 2548 + 2544 2549 /* 2545 2550 * We don't allow rdtgroup directories to be created anywhere 2546 2551 * except the root directory. Thus when looking for the rdtgroup
+3
include/linux/resctrl.h
··· 403 403 } 404 404 } 405 405 406 + bool resctrl_arch_get_cdp_enabled(enum resctrl_res_level l); 407 + int resctrl_arch_set_cdp_enabled(enum resctrl_res_level l, bool enable); 408 + 406 409 /* 407 410 * Update the ctrl_val and apply this config right now. 408 411 * Must be called on one of the domain's CPUs.
+3
include/linux/resctrl_types.h
··· 7 7 #ifndef __LINUX_RESCTRL_TYPES_H 8 8 #define __LINUX_RESCTRL_TYPES_H 9 9 10 + #define MAX_MBA_BW 100u 11 + #define MBM_OVERFLOW_INTERVAL 1000 12 + 10 13 /* Reads to Local DRAM Memory */ 11 14 #define READS_TO_LOCAL_MEM BIT(0) 12 15