Skip to content

Commit 3d95a49

Browse files
James Morsebp3tk0v
authored andcommitted
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
1 parent bff7040 commit 3d95a49

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

arch/x86/kernel/cpu/resctrl/internal.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
#define CQM_LIMBOCHECK_INTERVAL 1000
1717

1818
#define MBM_CNTR_WIDTH_BASE 24
19-
#define MBM_OVERFLOW_INTERVAL 1000
20-
#define MAX_MBA_BW 100u
2119
#define MBA_IS_LINEAR 0x4
2220
#define MBM_CNTR_WIDTH_OFFSET_AMD 20
2321

@@ -396,13 +394,6 @@ extern struct rdtgroup rdtgroup_default;
396394
extern struct dentry *debugfs_resctrl;
397395
extern enum resctrl_event_id mba_mbps_default_event;
398396

399-
static inline bool resctrl_arch_get_cdp_enabled(enum resctrl_res_level l)
400-
{
401-
return rdt_resources_all[l].cdp_enabled;
402-
}
403-
404-
int resctrl_arch_set_cdp_enabled(enum resctrl_res_level l, bool enable);
405-
406397
void arch_mon_domain_online(struct rdt_resource *r, struct rdt_mon_domain *d);
407398

408399
/* CPUID.(EAX=10H, ECX=ResID=1).EAX */

arch/x86/kernel/cpu/resctrl/rdtgroup.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2541,6 +2541,11 @@ int resctrl_arch_set_cdp_enabled(enum resctrl_res_level l, bool enable)
25412541
return 0;
25422542
}
25432543

2544+
bool resctrl_arch_get_cdp_enabled(enum resctrl_res_level l)
2545+
{
2546+
return rdt_resources_all[l].cdp_enabled;
2547+
}
2548+
25442549
/*
25452550
* We don't allow rdtgroup directories to be created anywhere
25462551
* except the root directory. Thus when looking for the rdtgroup

include/linux/resctrl.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,9 @@ static inline u32 resctrl_get_config_index(u32 closid,
403403
}
404404
}
405405

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+
406409
/*
407410
* Update the ctrl_val and apply this config right now.
408411
* Must be called on one of the domain's CPUs.

include/linux/resctrl_types.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
#ifndef __LINUX_RESCTRL_TYPES_H
88
#define __LINUX_RESCTRL_TYPES_H
99

10+
#define MAX_MBA_BW 100u
11+
#define MBM_OVERFLOW_INTERVAL 1000
12+
1013
/* Reads to Local DRAM Memory */
1114
#define READS_TO_LOCAL_MEM BIT(0)
1215

0 commit comments

Comments
 (0)