The following commit has been merged into the x86/cache branch of tip: Commit-ID: 37bae1756734b065f5e5cddc54ad121ff0c8db51 Gitweb: https://git.kernel.org/tip/37bae1756734b065f5e5cddc54ad121ff0c8db51 Author: James Morse <james.morse@xxxxxxx> AuthorDate: Tue, 11 Mar 2025 18:37:06 Committer: Borislav Petkov (AMD) <bp@xxxxxxxxx> CommitterDate: Wed, 12 Mar 2025 12:23:52 +01:00 x86/resctrl: Move mba_mbps_default_event init to filesystem code mba_mbps_default_event is initialised based on whether mbm_local or mbm_total is supported. In the case of both, it is initialised to mbm_local. mba_mbps_default_event is initialised in core.c's get_rdt_mon_resources(), while all the readers are in rdtgroup.c. After this code is split into architecture-specific and filesystem code, get_rdt_mon_resources() remains part of the architecture code, which would mean mba_mbps_default_event has to be exposed by the filesystem code. Move the initialisation to the filesystem's resctrl_mon_resource_init(). Signed-off-by: James Morse <james.morse@xxxxxxx> Signed-off-by: Borislav Petkov (AMD) <bp@xxxxxxxxx> Reviewed-by: Reinette Chatre <reinette.chatre@xxxxxxxxx> Reviewed-by: Fenghua Yu <fenghuay@xxxxxxxxxx> Reviewed-by: Babu Moger <babu.moger@xxxxxxx> Reviewed-by: Shaopeng Tan <tan.shaopeng@xxxxxxxxxxxxxx> Tested-by: Peter Newman <peternewman@xxxxxxxxxx> Tested-by: Shaopeng Tan <tan.shaopeng@xxxxxxxxxxxxxx> Tested-by: Amit Singh Tomar <amitsinght@xxxxxxxxxxx> # arm64 Tested-by: Shanker Donthineni <sdonthineni@xxxxxxxxxx> # arm64 Tested-by: Babu Moger <babu.moger@xxxxxxx> Link: https://lore.kernel.org/r/20250311183715.16445-22-james.morse@xxxxxxx --- arch/x86/kernel/cpu/resctrl/core.c | 5 ----- arch/x86/kernel/cpu/resctrl/monitor.c | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c index 6f0d1bb..b9b74f5 100644 --- a/arch/x86/kernel/cpu/resctrl/core.c +++ b/arch/x86/kernel/cpu/resctrl/core.c @@ -923,11 +923,6 @@ static __init bool get_rdt_mon_resources(void) if (!rdt_mon_features) return false; - if (resctrl_arch_is_mbm_local_enabled()) - mba_mbps_default_event = QOS_L3_MBM_LOCAL_EVENT_ID; - else if (resctrl_arch_is_mbm_total_enabled()) - mba_mbps_default_event = QOS_L3_MBM_TOTAL_EVENT_ID; - return !rdt_get_mon_l3_config(r); } diff --git a/arch/x86/kernel/cpu/resctrl/monitor.c b/arch/x86/kernel/cpu/resctrl/monitor.c index 27d9831..306b06b 100644 --- a/arch/x86/kernel/cpu/resctrl/monitor.c +++ b/arch/x86/kernel/cpu/resctrl/monitor.c @@ -1213,6 +1213,11 @@ int __init resctrl_mon_resource_init(void) RFTYPE_MON_INFO | RFTYPE_RES_CACHE); } + if (resctrl_arch_is_mbm_local_enabled()) + mba_mbps_default_event = QOS_L3_MBM_LOCAL_EVENT_ID; + else if (resctrl_arch_is_mbm_total_enabled()) + mba_mbps_default_event = QOS_L3_MBM_TOTAL_EVENT_ID; + return 0; }
![]() |