From: Wang ShaoBo <bobo.shaobowang(a)huawei.com>
commit 83d800c00cb54ab782813ada68f73bda14cc97cb openEuler-1.0
hulk inclusion
category: bugfix
bugzilla: 21073
CVE: NA
--------------------------------------------------------------------
MSMON_CFG_MON_SEL should be set when mpam driver attempt to write/read, fix the
problem by filling MSMON_CFG_MON_SEL with according mon ID.
Signed-off-by: Wang ShaoBo <bobo.shaobowang(a)huawei.com>
Reviewed-by: Xie XiuQi <xiexiuqi(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 | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/arm64/kernel/mpam.c b/arch/arm64/kernel/mpam.c
index b886282756c2..07a7dc65c42e 100644
--- a/arch/arm64/kernel/mpam.c
+++ b/arch/arm64/kernel/mpam.c
@@ -247,14 +247,14 @@ static int mbwu_write(struct rdt_domain *d, struct rdtgroup *g, bool
enable)
{
u32 mon, pmg, partid, flt, ctl = 0;
+ mon = g->mon.mon;
+ mpam_writel(mon, d->base + MSMON_CFG_MON_SEL);
if (enable) {
- mon = g->mon.mon;
pmg = g->mon.rmid;
partid = g->closid;
flt = MSMON_CFG_FLT_SET(pmg, partid);
ctl = MSMON_CFG_MBWU_CTL_SET(MSMON_MATCH_PMG|MSMON_MATCH_PARTID);
- mpam_writel(mon, d->base + MSMON_CFG_MON_SEL);
mpam_writel(flt, d->base + MSMON_CFG_MBWU_FLT);
}
@@ -267,14 +267,14 @@ static int csu_write(struct rdt_domain *d, struct rdtgroup *g, bool
enable)
{
u32 mon, pmg, partid, flt, ctl = 0;
+ mon = g->mon.mon;
+ mpam_writel(mon, d->base + MSMON_CFG_MON_SEL);
if (enable) {
- mon = g->mon.mon;
pmg = g->mon.rmid;
partid = g->closid;
flt = MSMON_CFG_FLT_SET(pmg, partid);
ctl = MSMON_CFG_CSU_CTL_SET(MSMON_MATCH_PMG|MSMON_MATCH_PARTID);
- mpam_writel(mon, d->base + MSMON_CFG_MON_SEL);
mpam_writel(flt, d->base + MSMON_CFG_CSU_FLT);
}
--
2.31.0