linux-bl808/arch/x86/kernel/cpu/resctrl
Peter Newman 2a81160d29 x86/resctrl: Fix event counts regression in reused RMIDs
When creating a new monitoring group, the RMID allocated for it may have
been used by a group which was previously removed. In this case, the
hardware counters will have non-zero values which should be deducted
from what is reported in the new group's counts.

resctrl_arch_reset_rmid() initializes the prev_msr value for counters to
0, causing the initial count to be charged to the new group. Resurrect
__rmid_read() and use it to initialize prev_msr correctly.

Unlike before, __rmid_read() checks for error bits in the MSR read so
that callers don't need to.

Fixes: 1d81d15db3 ("x86/resctrl: Move mbm_overflow_count() into resctrl_arch_rmid_read()")
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>
Tested-by: Babu Moger <babu.moger@amd.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20221220164132.443083-1-peternewman@google.com
2023-01-10 19:51:59 +01:00
..
core.c x86/resctrl: Move MSR defines into msr-index.h 2022-11-27 23:00:45 +01:00
ctrlmondata.c x86/resctrl: Remove arch_has_empty_bitmaps 2022-10-24 10:30:29 +02:00
internal.h x86/resctrl: Move MSR defines into msr-index.h 2022-11-27 23:00:45 +01:00
Makefile
monitor.c x86/resctrl: Fix event counts regression in reused RMIDs 2023-01-10 19:51:59 +01:00
pseudo_lock.c Driver Core changes for 6.2-rc1 2022-12-16 03:54:54 -08:00
pseudo_lock_event.h
rdtgroup.c x86/resctrl: Fix task CLOSID/RMID update race 2023-01-10 19:47:30 +01:00