x86/resctrl: Move get_corrected_mbm_count() into resctrl_arch_rmid_read()
authorJames Morse <james.morse@arm.com>
Fri, 2 Sep 2022 15:48:26 +0000 (15:48 +0000)
committerBorislav Petkov <bp@suse.de>
Fri, 23 Sep 2022 12:22:53 +0000 (14:22 +0200)
commit38f72f50d6498ee60ac89deff3686e34ce0c2a32
tree0eed2574fcf51dae61de96485d23994d7661d2aa
parent1d81d15db39c2b517bc58f63008c6255dd08aafe
x86/resctrl: Move get_corrected_mbm_count() into resctrl_arch_rmid_read()

resctrl_arch_rmid_read() is intended as the function that an
architecture agnostic resctrl filesystem driver can use to
read a value in bytes from a counter. Currently the function returns
the MBM values in chunks directly from hardware. When reading a bandwidth
counter, get_corrected_mbm_count() must be used to correct the
value read.

get_corrected_mbm_count() is architecture specific, this work should be
done in resctrl_arch_rmid_read().

Move the function calls. This allows the resctrl filesystems's chunks
value to be removed in favour of the architecture private version.

Signed-off-by: James Morse <james.morse@arm.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Jamie Iles <quic_jiles@quicinc.com>
Reviewed-by: Shaopeng Tan <tan.shaopeng@fujitsu.com>
Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>
Tested-by: Xin Hao <xhao@linux.alibaba.com>
Tested-by: Shaopeng Tan <tan.shaopeng@fujitsu.com>
Tested-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20220902154829.30399-19-james.morse@arm.com
arch/x86/kernel/cpu/resctrl/internal.h
arch/x86/kernel/cpu/resctrl/monitor.c