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: 58e843d94efe ("arm64/mpam: resctrl: Support priority and hardlimit(Memory bandwidth) configuration") Signed-off-by: Zeng Heng zengheng4@huawei.com --- arch/arm64/kernel/mpam/mpam_resctrl.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/arch/arm64/kernel/mpam/mpam_resctrl.c b/arch/arm64/kernel/mpam/mpam_resctrl.c index 5808ece9ed53..c9882b38fb7e 100644 --- a/arch/arm64/kernel/mpam/mpam_resctrl.c +++ b/arch/arm64/kernel/mpam/mpam_resctrl.c @@ -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;