
NACK, we don't want to maintain ipi tlb flush anymore. On 2024/9/19 21:08, Liao Chen wrote:
From: Takao Indoh <indou.takao@fujitsu.com>
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I4BLL0 CVE: NA
---------------------------
mm_cpumask was deleted by the commit 38d96287504a ("arm64: mm: kill mm_cpumask usage") because it was not used at that time. Now this is needed to find appropriate CPUs for TLB flush, so this patch reverts this commit.
Signed-off-by: QI Fuli <qi.fuli@fujitsu.com> Signed-off-by: Takao Indoh <indou.takao@fujitsu.com> Signed-off-by: Cheng Jian <cj.chengjian@huawei.com> Reviewed-by: Xie XiuQi <xiexiuqi@huawei.com> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Signed-off-by: Yu Liao <liaoyu15@huawei.com> --- arch/arm64/kernel/smp.c | 6 ++++++ arch/arm64/mm/context.c | 2 ++ 2 files changed, 8 insertions(+)
diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index 13dc8228700f..6f7b760f65cd 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -411,6 +411,7 @@ asmlinkage notrace void secondary_start_kernel(void) */ mmgrab(mm); current->active_mm = mm; + cpumask_set_cpu(cpu, mm_cpumask(mm));
/* * TTBR0 is only used for the identity mapping at this stage. Make it @@ -525,6 +526,11 @@ int __cpu_disable(void) */ irq_migrate_all_off_this_cpu();
+ /* + * Remove this CPU from the vm mask set of all processes. + */ + clear_tasks_mm_cpumask(cpu); + return 0; }
diff --git a/arch/arm64/mm/context.c b/arch/arm64/mm/context.c index 45c92d0f71d3..279d092555b9 100644 --- a/arch/arm64/mm/context.c +++ b/arch/arm64/mm/context.c @@ -224,6 +224,7 @@ set_asid: __set_bit(asid, asid_map); cur_idx = asid;
+ cpumask_clear(mm_cpumask(mm)); return idx2asid(asid) | generation; }
@@ -280,6 +281,7 @@ switch_mm_fastpath: arm64_apply_bp_hardening(); #else arm64_apply_bp_hardening(); + cpumask_set_cpu(cpu, mm_cpumask(mm)); #endif
/*