arm_mpam: [HACK] Define and use generic monitoring group applicator
A resctrl operation on a monitoring group must be applied across
all (PARTID, PMG) pairs that the MPAM driver maps to that group.
In practice, there are two such pairs if CDP is enabled and one
otherwise.
The ID mapping conversions are a bit fiddly and we may want to
change the way they work in future. In the interest of
maintainability therefore, it is preferable to keep them in one
place.
This patch defines a generic helper mpam_mongroup_apply() that
encapsulates the ID conversions and calls the appropriate action
function with the decomposed PARTID and PMG values.
The monitoring group manipulation hooks are updated to use the new
helper.
Signed-off-by:
Dave Martin <Dave.Martin@arm.com>
---
Non-bisectable patch -- breaks the MPAM driver.
These changes need to refactored before they can be merged.
---
This approach mostly aligns nicely with the needs of the various
resctrl hooks, but resctrl_arch_match_closid() is a special case and is
a bit awkward to handle. This does not fit under mpam_control_apply()
since the config type (CDP_DATA, CDP_CODE etc.) is not matched.
Instead, a clunky hack is used to ignore the RMID when matching in this
case. There may be better ways to do this.
Loading
Please register or sign in to comment