From: Xie XiuQi <xiexiuqi(a)huawei.com>
commit 0d60b9373518087aeb8415200506d0acee347c8e openEuler-1.0
hulk inclusion
category: bugfix
bugzilla: 14212
CVE: NA
Perious we hard code num of partids and pmgs, now
we get it from MPAMF_IDS regs. The id is start from 0,
so NUM = MAX + 1. Fix it.
Hi1620's new spec use NUM_MAX as the MAX id of partid/pmg.
Signed-off-by: Xie XiuQi <xiexiuqi(a)huawei.com>
Reviewed-by: Hanjun Guo <guohanjun(a)huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang(a)huawei.com>
Signed-off-by: Xin Hao <haoxing990(a)gmail.com>
---
arch/arm64/kernel/mpam.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/kernel/mpam.c b/arch/arm64/kernel/mpam.c
index 44ba7ea4fda3..96284aa925b0 100644
--- a/arch/arm64/kernel/mpam.c
+++ b/arch/arm64/kernel/mpam.c
@@ -1215,8 +1215,8 @@ static void mpam_domains_init(struct resctrl_resource *r)
rr->default_ctrl = n->default_ctrl;
val = mpam_readl(d->base + MPAMF_IDR);
- rr->num_partid = MPAMF_IDR_PARTID_MAX_GET(val);
- rr->num_pmg = MPAMF_IDR_PMG_MAX_GET(val);
+ rr->num_partid = MPAMF_IDR_PARTID_MAX_GET(val) + 1;
+ rr->num_pmg = MPAMF_IDR_PMG_MAX_GET(val) + 1;
r->mon_capable = MPAMF_IDR_HAS_MSMON(val);
r->mon_enabled = MPAMF_IDR_HAS_MSMON(val);
--
2.31.0