aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm64/kernel/suspend.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm64/kernel/suspend.c')
-rw-r--r--arch/arm64/kernel/suspend.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/arch/arm64/kernel/suspend.c b/arch/arm64/kernel/suspend.c
index 3771b72b6569..2d6b6065fe7f 100644
--- a/arch/arm64/kernel/suspend.c
+++ b/arch/arm64/kernel/suspend.c
@@ -5,6 +5,7 @@
5#include <asm/debug-monitors.h> 5#include <asm/debug-monitors.h>
6#include <asm/pgtable.h> 6#include <asm/pgtable.h>
7#include <asm/memory.h> 7#include <asm/memory.h>
8#include <asm/mmu_context.h>
8#include <asm/smp_plat.h> 9#include <asm/smp_plat.h>
9#include <asm/suspend.h> 10#include <asm/suspend.h>
10#include <asm/tlbflush.h> 11#include <asm/tlbflush.h>
@@ -98,7 +99,18 @@ int __cpu_suspend(unsigned long arg, int (*fn)(unsigned long))
98 */ 99 */
99 ret = __cpu_suspend_enter(arg, fn); 100 ret = __cpu_suspend_enter(arg, fn);
100 if (ret == 0) { 101 if (ret == 0) {
101 cpu_switch_mm(mm->pgd, mm); 102 /*
103 * We are resuming from reset with TTBR0_EL1 set to the
104 * idmap to enable the MMU; restore the active_mm mappings in
105 * TTBR0_EL1 unless the active_mm == &init_mm, in which case
106 * the thread entered __cpu_suspend with TTBR0_EL1 set to
107 * reserved TTBR0 page tables and should be restored as such.
108 */
109 if (mm == &init_mm)
110 cpu_set_reserved_ttbr0();
111 else
112 cpu_switch_mm(mm->pgd, mm);
113
102 flush_tlb_all(); 114 flush_tlb_all();
103 115
104 /* 116 /*