diff options
author | Peter Newman <peternewman@google.com> | 2022-12-20 19:41:31 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-01-18 13:58:22 +0300 |
commit | 07ac5db2d840e47428c871097809dc70e68f66c3 (patch) | |
tree | 15d300e93b702db49ccdde45b1add017647a7c03 /arch/x86/xen/smp_pv.c | |
parent | d01c6557478bfe10eeef280abae700def7de3ffd (diff) | |
download | linux-07ac5db2d840e47428c871097809dc70e68f66c3.tar.xz |
x86/resctrl: Fix event counts regression in reused RMIDs
commit 2a81160d29d65b5876ab3f824fda99ae0219f05e upstream.
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: 1d81d15db39c ("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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/x86/xen/smp_pv.c')
0 files changed, 0 insertions, 0 deletions