Commit 3e04af4e authored by Wang ShaoBo's avatar Wang ShaoBo Committed by Zheng Zengkai
Browse files

arm64/mpam: Add helper for getting mpam sysprops



hulk inclusion
category: feature
feature: ARM MPAM support
bugzilla: 48265
CVE: NA

--------------------------------

Now mpam sysprops have been probed, maximum support of partid
and pmg should be exported to resctrl.

For MPAM, Processing elements (PEs) issue memory-system requests,
PEs must implement the MPAMn_ELx registers and their behaviors to
generate the PARTID and PMG fields of memory-system requests.

For resctrl, partid and pmg should be used to combined into a unique
rmid for labeling each group, and partid for determining the maximum
number of ctrl groups.

Signed-off-by: default avatarWang ShaoBo <bobo.shaobowang@huawei.com>
Reviewed-by: default avatarXiongfeng Wang <wangxiongfeng2@huawei.com>
Reviewed-by: default avatarCheng Jian <cj.chengjian@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 2cf7960c
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -666,3 +666,15 @@ void __init mpam_discovery_failed(void)
	}
	mutex_unlock(&mpam_devices_lock);
}

u16 mpam_sysprops_num_partid(void)
{
	/* At least one partid for system width */
	return mpam_sysprops.max_partid + 1;
}

u16 mpam_sysprops_num_pmg(void)
{
	/* At least one pmg for system width */
	return mpam_sysprops.max_pmg + 1;
}
+3 −0
Original line number Diff line number Diff line
@@ -48,4 +48,7 @@ static inline void mpam_clear_feature(enum mpam_device_features feat,

#define MPAM_ARCHITECTURE_V1    0x10

u16 mpam_sysprops_num_partid(void);
u16 mpam_sysprops_num_pmg(void);

#endif