hc
2024-11-01 2f529f9b558ca1c1bd74be7437a84e4711743404
kernel/kernel/kthread.c
....@@ -14,6 +14,7 @@
1414 #include <linux/sched/mm.h>
1515 #include <linux/sched/task.h>
1616 #include <linux/kthread.h>
17
+#include <linux/irq_pipeline.h>
1718 #include <linux/completion.h>
1819 #include <linux/err.h>
1920 #include <linux/cgroup.h>
....@@ -1331,6 +1332,7 @@
13311332 {
13321333 struct mm_struct *active_mm;
13331334 struct task_struct *tsk = current;
1335
+ unsigned long flags;
13341336
13351337 WARN_ON_ONCE(!(tsk->flags & PF_KTHREAD));
13361338 WARN_ON_ONCE(tsk->mm);
....@@ -1339,12 +1341,14 @@
13391341 /* Hold off tlb flush IPIs while switching mm's */
13401342 local_irq_disable();
13411343 active_mm = tsk->active_mm;
1344
+ protect_inband_mm(flags);
13421345 if (active_mm != mm) {
13431346 mmgrab(mm);
13441347 tsk->active_mm = mm;
13451348 }
13461349 tsk->mm = mm;
13471350 switch_mm_irqs_off(active_mm, mm, tsk);
1351
+ unprotect_inband_mm(flags);
13481352 local_irq_enable();
13491353 task_unlock(tsk);
13501354 #ifdef finish_arch_post_lock_switch