提交 42778d9f 编写于 作者: X Xie XiuQi

arm64/mpam: get num_partids from system regs instead of hard code

hulk inclusion
category: bugfix
bugzilla: 14212
CVE: NA

Previously hard coded for num of partids, now get them
through the system registers.
Signed-off-by: NXie XiuQi <xiexiuqi@huawei.com>
Reviewed-by: NHanjun Guo <guohanjun@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 f654d1f3
...@@ -322,9 +322,17 @@ static int closid_free_map; ...@@ -322,9 +322,17 @@ static int closid_free_map;
void closid_init(void) void closid_init(void)
{ {
int resctrl_min_closid = 32; struct resctrl_resource *r;
struct raw_resctrl_resource *rr;
int num_closid = INT_MAX;
closid_free_map = BIT_MASK(resctrl_min_closid) - 1; for_each_resctrl_resource(r) {
if (r->alloc_enabled) {
rr = r->res;
num_closid = min(num_closid, rr->num_partid);
}
}
closid_free_map = BIT_MASK(num_closid) - 1;
/* CLOSID 0 is always reserved for the default group */ /* CLOSID 0 is always reserved for the default group */
closid_free_map &= ~1; closid_free_map &= ~1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册