mirror-linux/arch/x86/kernel/cpu/resctrl
Peter Newman a547a5880c x86/resctrl: Fix arch_mbm_* array overrun on SNC
When using resctrl on systems with Sub-NUMA Clustering enabled, monitoring
groups may be allocated RMID values which would overrun the
arch_mbm_{local,total} arrays.

This is due to inconsistencies in whether the SNC-adjusted num_rmid value or
the unadjusted value in resctrl_arch_system_num_rmid_idx() is used. The
num_rmid value for the L3 resource is currently:

  resctrl_arch_system_num_rmid_idx() / snc_nodes_per_l3_cache

As a simple fix, make resctrl_arch_system_num_rmid_idx() return the
SNC-adjusted, L3 num_rmid value on x86.

Fixes: e13db55b5a ("x86/resctrl: Introduce snc_nodes_per_l3_cache")
Signed-off-by: Peter Newman <peternewman@google.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>
Link: https://lore.kernel.org/r/20240822190212.1848788-1-peternewman@google.com
2024-08-28 11:13:08 +02:00
..
Makefile x86/resctrl: Avoid confusion over the new X86_RESCTRL config 2019-02-02 10:34:52 +01:00
core.c x86/resctrl: Fix arch_mbm_* array overrun on SNC 2024-08-28 11:13:08 +02:00
ctrlmondata.c x86/resctrl: Fill out rmid_read structure for smp_call*() to read a counter 2024-07-02 19:57:19 +02:00
internal.h x86/resctrl: Enable shared RMID mode on Sub-NUMA Cluster (SNC) systems 2024-07-02 19:57:51 +02:00
monitor.c - Enable Sub-NUMA clustering to work with resource control on Intel by 2024-07-16 10:53:54 -07:00
pseudo_lock.c x86/resctrl: Prepare for new Sub-NUMA Cluster (SNC) monitor files 2024-07-02 19:49:54 +02:00
rdtgroup.c x86/resctrl: Fill out rmid_read structure for smp_call*() to read a counter 2024-07-02 19:57:19 +02:00
trace.h x86/resctrl: Add tracepoint for llc_occupancy tracking 2024-04-24 14:24:48 +02:00