Commit 7da6ee0f authored by Zeng Heng's avatar Zeng Heng
Browse files

arm64/mpam: Not allowed setting 0 to cache portion bit mask

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I9H4YE



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

Not allowed cache portion to be set to 0, and this kind of operation is
not supported by hardware.

Fixes: 58e843d9 ("arm64/mpam: resctrl: Support priority and hardlimit(Memory bandwidth) configuration")
Signed-off-by: default avatarZeng Heng <zengheng4@huawei.com>
parent b152f5a5
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -321,6 +321,11 @@ parse_cache(char *buf, struct resctrl_resource *r,
	if (data >= rr->ctrl_features[type].max_wd)
		return -EINVAL;

	if (type == SCHEMA_COMM && data == 0) {
		rdt_last_cmd_puts("No allowed CPBM to be set to 0\n");
		return -EINVAL;
	}

	cfg->new_ctrl[type] = data;
	cfg->ctrl_updated[type] = true;
	cfg->have_new_ctrl = true;