forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-11 04dd17822334871b23ea2862f7798fb0e0007777
kernel/arch/powerpc/mm/mmu_context.c
....@@ -1,13 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Common implementation of switch_mm_irqs_off
34 *
45 * Copyright IBM Corp. 2017
5
- *
6
- * This program is free software; you can redistribute it and/or
7
- * modify it under the terms of the GNU General Public License
8
- * as published by the Free Software Foundation; either version
9
- * 2 of the License, or (at your option) any later version.
10
- *
116 */
127
138 #include <linux/mm.h>
....@@ -15,6 +10,7 @@
1510 #include <linux/sched/mm.h>
1611
1712 #include <asm/mmu_context.h>
13
+#include <asm/pgalloc.h>
1814
1915 #if defined(CONFIG_PPC32)
2016 static inline void switch_mm_pgdir(struct task_struct *tsk,
....@@ -83,7 +79,7 @@
8379 * context
8480 */
8581 if (cpu_has_feature(CPU_FTR_ALTIVEC))
86
- asm volatile ("dssall");
82
+ asm volatile (PPC_DSSALL);
8783
8884 if (new_on_cpu)
8985 radix_kvm_prefetch_workaround(next);
....@@ -97,3 +93,12 @@
9793 switch_mmu_context(prev, next, tsk);
9894 }
9995
96
+#ifndef CONFIG_PPC_BOOK3S_64
97
+void arch_exit_mmap(struct mm_struct *mm)
98
+{
99
+ void *frag = pte_frag_get(&mm->context);
100
+
101
+ if (frag)
102
+ pte_frag_destroy(frag);
103
+}
104
+#endif