@@ -168,6 +168,21 @@ u32 resctrl_arch_get_num_closid(struct rdt_resource *ignored)
static u32 get_num_reqpartid(void)
{
+ struct mpam_resctrl_res *res;
+ struct rdt_resource *r_mba;
+ struct mpam_props *cprops;
+
+ r_mba = resctrl_arch_get_resource(RDT_RESOURCE_MBA);
+ res = container_of(r_mba, struct mpam_resctrl_res, resctrl_res);
+ cprops = &res->class->props;
+
+ /*
+ * If the MBA does not support Narrow-PARTID,
+ * then the feature should be disabled at the system level.
+ */
+ if (!mpam_has_feature(mpam_feat_partid_nrw, cprops))
+ return resctrl_arch_get_num_closid(NULL);
+
return mpam_partid_max + 1;
}
Because it needs to support mixed systems that include MSCs with and without Narrow-PARTID support, there are the following incompatible control issues. If an MSC does not support Narrow-PARTID and its control method is not of the "partition bitmap" type, then delivering the resctrl control group configuration across multiple PARTIDs will change the user's expected behavior. Currently, there is no way to solve this problem by programming different control values simply, so here decide to restrict the usage scenarios of this feature. When we find that the MATA MSC does not support the Narrow-PARTID feature, the driver will disable the feature, which means get_num_reqpartid() directly returns the number of intPARTIDs. Signed-off-by: Zeng Heng <zengheng4@huawei.com> --- drivers/platform/arm64/mpam/mpam_resctrl.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)