[PATCH OLK-6.6 0/2] arm64/mpam: Fix incorrect CPU-to-partid binding under CDP mode

Zeng Heng (2): arm64/mpam: Fix typo in resctrl_arch_set_cdp_enabled() arm64/mpam: Fix incorrect CPU-to-partid binding under CDP mode arch/arm64/include/asm/mpam.h | 2 +- drivers/platform/mpam/mpam_resctrl.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) -- 2.25.1

hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/ICO2ME -------------------------------- After CDP mode is enabled, MPAM uses different PartIDs to track CPU instruction-port and data-port memory-access requests. If these PartIDs are configured in reverse, the root directory group’s isolation settings for data and instruction ports will not behave as expected. Fixes: b4280653f60d ("arm_mpam: resctrl: Add CDP emulation") Signed-off-by: Zeng Heng <zengheng4@huawei.com> --- drivers/platform/mpam/mpam_resctrl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/platform/mpam/mpam_resctrl.c b/drivers/platform/mpam/mpam_resctrl.c index c3f9f0c2a94c..428afe27fda2 100644 --- a/drivers/platform/mpam/mpam_resctrl.c +++ b/drivers/platform/mpam/mpam_resctrl.c @@ -111,8 +111,8 @@ int resctrl_arch_set_cdp_enabled(enum resctrl_res_level ignored, bool enable) partid = RESCTRL_RESERVED_CLOSID; if (enable) { - partid_d = resctrl_get_config_index(partid, CDP_CODE); - partid_i = resctrl_get_config_index(partid, CDP_DATA); + partid_d = resctrl_get_config_index(partid, CDP_DATA); + partid_i = resctrl_get_config_index(partid, CDP_CODE); regval = FIELD_PREP(MPAM_SYSREG_PARTID_D, partid_d) | FIELD_PREP(MPAM_SYSREG_PARTID_I, partid_i); -- 2.25.1

hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/ICO2ME -------------------------------- Under CDP mode, MPAM uses different PartIDs to track CPU instruction-port and data-port memory-access requests. In practice, to prevent tasks switching their PartIDs too frequently, the root directory group’s default mpam_partid_pmg remains 0, rather than 1, under CDP mode. Accordingly, mpam_thread_switch() must check the task’s mpam_partid_pmg against 0 instead of against mpam_resctrl_default_group; otherwise, in CDP mode the scheduler will fail to switch to the partid that corresponds to CPU. Fixes: 5cd0dad659e8 ("arm64: mpam: Context switch the MPAM registers") Signed-off-by: Zeng Heng <zengheng4@huawei.com> --- arch/arm64/include/asm/mpam.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/mpam.h b/arch/arm64/include/asm/mpam.h index 9abe1fe58c34..8caac70e22ed 100644 --- a/arch/arm64/include/asm/mpam.h +++ b/arch/arm64/include/asm/mpam.h @@ -153,7 +153,7 @@ static inline void mpam_thread_switch(struct task_struct *tsk) !static_branch_likely(&mpam_enabled)) return; - if (regval == READ_ONCE(mpam_resctrl_default_group)) + if (!regval) regval = READ_ONCE(per_cpu(arm64_mpam_default, cpu)); oldregval = READ_ONCE(per_cpu(arm64_mpam_current, cpu)); -- 2.25.1

反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/17250 邮件列表地址:https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/K6X... FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://gitee.com/openeuler/kernel/pulls/17250 Mailing list address: https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/K6X...
participants (2)
-
patchwork bot
-
Zeng Heng