OrangePi_CM5/arch/x86/kernel/cpu
Babu Moger f0736bed18 x86/resctrl: Fix default monitoring groups reporting
commit 064855a69003c24bd6b473b367d364e418c57625 upstream.

Creating a new sub monitoring group in the root /sys/fs/resctrl leads to
getting the "Unavailable" value for mbm_total_bytes and mbm_local_bytes
on the entire filesystem.

Steps to reproduce:

  1. mount -t resctrl resctrl /sys/fs/resctrl/

  2. cd /sys/fs/resctrl/

  3. cat mon_data/mon_L3_00/mbm_total_bytes
     23189832

  4. Create sub monitor group:
  mkdir mon_groups/test1

  5. cat mon_data/mon_L3_00/mbm_total_bytes
     Unavailable

When a new monitoring group is created, a new RMID is assigned to the
new group. But the RMID is not active yet. When the events are read on
the new RMID, it is expected to report the status as "Unavailable".

When the user reads the events on the default monitoring group with
multiple subgroups, the events on all subgroups are consolidated
together. Currently, if any of the RMID reads report as "Unavailable",
then everything will be reported as "Unavailable".

Fix the issue by discarding the "Unavailable" reads and reporting all
the successful RMID reads. This is not a problem on Intel systems as
Intel reports 0 on Inactive RMIDs.

Fixes: d89b737901 ("x86/intel_rdt/cqm: Add mon_data")
Reported-by: Paweł Szulik <pawel.szulik@intel.com>
Signed-off-by: Babu Moger <Babu.Moger@amd.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Acked-by: Reinette Chatre <reinette.chatre@intel.com>
Cc: stable@vger.kernel.org
Link: https://bugzilla.kernel.org/show_bug.cgi?id=213311
Link: https://lkml.kernel.org/r/162793309296.9224.15871659871696482080.stgit@bmoger-ubuntu
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-18 08:59:15 +02:00
..
mce x86/entry: Move nmi entry/exit into common code 2021-03-17 17:06:36 +01:00
microcode x86/microcode: Check for offline CPUs before requesting new microcode 2021-05-14 09:50:11 +02:00
mtrr x86/mtrr: Correct the range check before performing MTRR type lookups 2021-01-12 20:18:26 +01:00
resctrl x86/resctrl: Fix default monitoring groups reporting 2021-08-18 08:59:15 +02:00
.gitignore
…
Makefile kbuild: remove cc-option test of -fno-stack-protector 2020-07-07 11:13:10 +09:00
acrn.c x86/acrn: Remove redundant chars from ACRN signature 2020-08-07 01:32:00 +02:00
amd.c x86/cpu/amd: Set __max_die_per_package on AMD 2021-01-27 11:55:19 +01:00
aperfmperf.c
…
bugs.c x86/speculation: Fix prctl() when spectre_v2_user={seccomp,prctl},ibpb 2020-11-25 20:17:09 +01:00
cacheinfo.c x86/CPU/AMD: Save AMD NodeId as cpu_die_id 2020-12-30 11:54:29 +01:00
centaur.c x86/cpu/centaur: Add Centaur family >=7 CPUs initialization support 2020-09-11 10:53:19 +02:00
common.c x86/cpu: Initialize MSR_TSC_AUX if RDTSCP *or* RDPID is supported 2021-05-11 14:47:37 +02:00
cpu.h treewide: Convert macro and uses of __section(foo) to __section("foo") 2020-10-25 14:51:49 -07:00
cpuid-deps.c * Misc cleanups to the resctrl code in preparation for the ARM side, by 2020-10-12 10:53:32 -07:00
cyrix.c
…
feat_ctl.c
…
hygon.c x86/CPU/AMD: Save AMD NodeId as cpu_die_id 2020-12-30 11:54:29 +01:00
hypervisor.c
…
intel.c x86/split_lock: Enable the split lock feature on another Alder Lake CPU 2021-02-17 11:02:23 +01:00
intel_epb.c
…
intel_pconfig.c
…
match.c
…
mkcapflags.sh
…
mshyperv.c x86/hyperv: Fix kexec panic/hang issues 2021-01-27 11:54:57 +01:00
perfctr-watchdog.c x86/nmi_watchdog: Fix old-style NMI watchdog regression on old Intel CPUs 2021-06-16 12:01:46 +02:00
powerflags.c
…
proc.c
…
rdrand.c
…
scattered.c This feature enhances the current guest memory encryption support 2020-10-14 10:21:34 -07:00
topology.c x86/topology: Make __max_die_per_package available unconditionally 2021-01-27 11:55:13 +01:00
transmeta.c
…
tsx.c
…
umc.c
…
umwait.c
…
vmware.c x86/vmware: Add VMware-specific handling for VMMCALL under SEV-ES 2020-09-09 11:33:20 +02:00
zhaoxin.c
…