x86/resctrl: Fill out rmid_read structure for smp_call*() to read a counter
authorTony Luck <tony.luck@intel.com>
Fri, 28 Jun 2024 21:56:15 +0000 (14:56 -0700)
committerBorislav Petkov (AMD) <bp@alien8.de>
Tue, 2 Jul 2024 17:57:19 +0000 (19:57 +0200)
commitc8c7d3d904b76c45fe2b5dc982fb5090d12a63af
tree5c794fa423853bf3649c8d27ba8af150f45d4eb6
parent6b48b80b08e6f08eea8eaf7e44555ada191b6bee
x86/resctrl: Fill out rmid_read structure for smp_call*() to read a counter

mon_event_read() fills out most fields of the struct rmid_read that is passed
via an smp_call*() function to a CPU that is part of the correct domain to
read the monitor counters.

With Sub-NUMA Cluster (SNC) mode there are now two cases to handle:

1) Reading a file that returns a value for a single domain.
   + Choose the CPU to execute from the domain cpu_mask

2) Reading a file that must sum across domains sharing an L3 cache
   instance.
   + Indicate to called code that a sum is needed by passing a NULL
     rdt_mon_domain pointer.
   + Choose the CPU from the L3 shared_cpu_map.

Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>
Tested-by: Babu Moger <babu.moger@amd.com>
Link: https://lore.kernel.org/r/20240628215619.76401-16-tony.luck@intel.com
arch/x86/kernel/cpu/resctrl/ctrlmondata.c
arch/x86/kernel/cpu/resctrl/internal.h
arch/x86/kernel/cpu/resctrl/rdtgroup.c