[PATCH OLK-6.6 0/2] some fix for spe hotcold

1. Fix the issue where the boost feature remains enabled even when enable_mm_spe_boost is not set. 2. Embed the boost feature transmission packet into the native SPE packet. Ze Zuo (2): mm_monitor/mm_spe: Fix SPE boost enablement and continuation handling mm_monitor/mm_spe: Embed boost events within SPE packets drivers/arm/mm_monitor/mm_spe.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) -- 2.25.1

hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/ICNW85 CVE: NA ---------------------------------------------------------------------- This patch addresses two issues related to the SPE (Statistical Profiling Extension) boost feature: 1. The SPE boost feature was being enabled on supporting hardware even when the 'enable_mm_spe_boost' command line parameter wasn't passed. This violates the explicit opt-in design and may cause unintended performance impacts. 2. During continuation scenarios, the SPE boost feature register wasn't being properly reset, which could lead to the feature remaining active when it shouldn't be. The fix ensures: - SPE boost is only enabled when explicitly requested via cmdline - The feature register is properly reset during continuation Fixes: b963a30f4ded ("arm-spe: Add kernel cmdline option to enable SPE boost") Signed-off-by: Ze Zuo <zuoze1@huawei.com> --- drivers/arm/mm_monitor/mm_spe.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/arm/mm_monitor/mm_spe.c b/drivers/arm/mm_monitor/mm_spe.c index 192f1f9c6adb..3bdece2ccee4 100644 --- a/drivers/arm/mm_monitor/mm_spe.c +++ b/drivers/arm/mm_monitor/mm_spe.c @@ -332,7 +332,7 @@ int mm_spe_start(void) isb(); write_sysreg_s(reg, SYS_PMSCR_EL1); - if (spe->support_boost_spe) { + if (spe->support_boost_spe && mm_spe_boost_enable) { reg = arm_spe_to_htpg(); isb(); write_sysreg_s(reg, SYS_OMHTPG_EL1); @@ -345,6 +345,12 @@ void mm_spe_continue(void) { int reg; + if (spe->support_boost_spe && mm_spe_boost_enable) { + reg = arm_spe_to_htpg(); + isb(); + write_sysreg_s(reg, SYS_OMHTPG_EL1); + } + mm_spe_buffer_init(); reg = mm_spe_to_pmscr(); @@ -445,7 +451,7 @@ static void mm_spe_sample_para_init(void) spe->min_latency = 120; - if (spe->support_boost_spe) + if (spe->support_boost_spe && mm_spe_boost_enable) arm_spe_boost_spe_para_init(); } -- 2.25.1

hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/ICNW85 CVE: NA ---------------------------------------------------------------------- This patch embeds boost events within SPE packets to: 1.Avoid disrupting standard SPE packet streams 2.Ensure backward compatibility with existing SPE analyzers The embedding is achieved by using reserved bits in the SPE headers, following the architecture specification. Fixes: 9081b8b4bfef ("arm-spe: Boost SPE add TLB hot page and remote access tracking") Signed-off-by: Ze Zuo <zuoze1@huawei.com> --- drivers/arm/mm_monitor/mm_spe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/arm/mm_monitor/mm_spe.c b/drivers/arm/mm_monitor/mm_spe.c index 3bdece2ccee4..61856820ad85 100644 --- a/drivers/arm/mm_monitor/mm_spe.c +++ b/drivers/arm/mm_monitor/mm_spe.c @@ -414,7 +414,7 @@ static void arm_spe_boost_spe_para_init(void) { struct boost_spe_contol *boost_spe = &spe->boost_spe; - boost_spe->record_sel = 1; + boost_spe->record_sel = 0; boost_spe->pop_uop_sel = 0; boost_spe->rmt_acc_pa_flt_en = 0; boost_spe->rmt_acc_en = 1; -- 2.25.1

反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/17240 邮件列表地址:https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/PJY... 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/17240 Mailing list address: https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/PJY...
participants (2)
-
patchwork bot
-
Ze Zuo