x86/resctrl: Expose the number of monitor groups that can be created

Resctrl exposes a single file called 'num_rmid' that reports how many
RMID the x86 hardware has. Users can read this to know how many
monitor or control groups they can create. RMIDs are an independent
number that is used to mark traffic, and then read the bandwidth or
cache occupancy of that traffic via MSRs. RMIDs are independent of
the CLOSID, which is the label used to control the cache or memory
bandwidth policy.

Arm's MPAM doesn't have anything equivalent to RMID. Instead, it
has performance monitoring groups (PMG), which are a small number
of bits that extend the (equivalent to) CLOSID. This means on an
MPAM system, each control group can have 'num_pmg' monitor groups,
but how many monitor or control groups can be created depends
heavily on how these are structured.

Because the num_rmid file has 'rmid' in the name, it should have
the same meaning as the Intel SDM gives it. MPAM doesn't have a
value it can use for 'num_rmid'.

Deprecate 'num_rmid', and replace it with two properties:
total_mon_groups and num_mon_groups_per_ctrl_group. The first
describes the maximum number of monitor groups that could be
created, with the warning that this depends on the group.
The second describes the number of monitor groups that can
be created within a control group.

For x86 systems, all three of the files report the same number.
On an MPAM system with 64 CLOSID and 1 bit of PMG:
num_rmid would report '1', as there is no equivalent number.
total_mon_groups would report '128', and
num_mon_groups_per_ctrl_group would report '2'.

Signed-off-by: James Morse <james.morse@arm.com>
----
Deprecating a file may be contentions. Can I suggest generating
a pr_warn_once() in 2027, and removing it completely in 2032?
2 files changed