提交 94e9729e 编写于 作者: W Wang ShaoBo 提交者: Yang Yingliang

arm64/mpam: resctrl: Remove unnecessary CONFIG_ARM64

hulk inclusion
category: feature
bugzilla: 34278
CVE: NA

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

Code in resctrlfs.c is not shared with x86 RDT currently, but may be
updated to support both in the future, so remove unrelated CONFIG for
now to make code clearer.
Signed-off-by: NWang ShaoBo <bobo.shaobowang@huawei.com>
Reviewed-by: NXiongfeng Wang <wangxiongfeng2@huawei.com>
Reviewed-by: NCheng Jian <cj.chengjian@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NCheng Jian <cj.chengjian@huawei.com>
上级 ae4ab499
......@@ -183,9 +183,7 @@ static int resctrl_group_create_info_dir(struct kernfs_node *parent_kn)
unsigned long fflags;
char name[32];
int ret;
#ifdef CONFIG_ARM64
enum resctrl_resource_level level;
#endif
/* create the directory */
kn_info = kernfs_create_dir(parent_kn, "info", parent_kn->mode, NULL);
......@@ -197,14 +195,10 @@ static int resctrl_group_create_info_dir(struct kernfs_node *parent_kn)
if (ret)
goto out_destroy;
#ifdef CONFIG_ARM64
for (level = RDT_RESOURCE_SMMU; level < RDT_NUM_RESOURCES; level++) {
r = mpam_resctrl_get_resource(level);
if (!r)
continue;
#else
for_each_resctrl_resource(r) {
#endif
if (r->alloc_enabled) {
fflags = r->fflags | RF_CTRL_INFO;
ret = resctrl_group_mkdir_info_resdir(r, r->name, fflags);
......@@ -213,14 +207,10 @@ static int resctrl_group_create_info_dir(struct kernfs_node *parent_kn)
}
}
#ifdef CONFIG_ARM64
for (level = RDT_RESOURCE_SMMU; level < RDT_NUM_RESOURCES; level++) {
r = mpam_resctrl_get_resource(level);
if (!r)
continue;
#else
for_each_resctrl_resource(r) {
#endif
if (r->mon_enabled) {
fflags = r->fflags | RF_MON_INFO;
snprintf(name, sizeof(name), "%s_MON", r->name);
......@@ -467,13 +457,11 @@ static struct dentry *resctrl_mount(struct file_system_type *fs_type,
dentry = ERR_PTR(ret);
goto out_options;
}
#ifdef CONFIG_ARM64
ret = schemata_list_init();
if (ret) {
dentry = ERR_PTR(ret);
goto out_options;
}
#endif
ret = resctrl_id_init();
if (ret) {
dentry = ERR_PTR(ret);
......@@ -496,7 +484,6 @@ static struct dentry *resctrl_mount(struct file_system_type *fs_type,
}
kernfs_get(kn_mongrp);
#ifndef CONFIG_ARM64 /* [FIXME] arch specific code */
ret = mkdir_mondata_all_prepare(&resctrl_group_default);
if (ret < 0) {
dentry = ERR_PTR(ret);
......@@ -510,7 +497,6 @@ static struct dentry *resctrl_mount(struct file_system_type *fs_type,
}
kernfs_get(kn_mondata);
resctrl_group_default.mon.mon_data_kn = kn_mondata;
#endif
}
dentry = kernfs_mount(fs_type, flags, resctrl_root,
......@@ -523,11 +509,9 @@ static struct dentry *resctrl_mount(struct file_system_type *fs_type,
goto out;
out_mondata:
#ifndef CONFIG_ARM64 /* [FIXME] arch specific code */
if (resctrl_mon_capable)
kernfs_remove(kn_mondata);
out_mongrp:
#endif
if (resctrl_mon_capable)
kernfs_remove(kn_mongrp);
out_info:
......@@ -652,9 +636,8 @@ static void resctrl_kill_sb(struct super_block *sb)
mutex_lock(&resctrl_group_mutex);
resctrl_resource_reset();
#ifdef CONFIG_ARM64
schemata_list_destroy();
#endif
rmdir_all_sub();
static_branch_disable_cpuslocked(&resctrl_alloc_enable_key);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册