.. | .. |
---|
3 | 3 | #include <linux/percpu.h> |
---|
4 | 4 | #include <linux/slab.h> |
---|
5 | 5 | #include <linux/uaccess.h> |
---|
| 6 | +#include <linux/pgtable.h> |
---|
6 | 7 | #include <asm/alternative.h> |
---|
7 | 8 | #include <asm/cacheflush.h> |
---|
8 | 9 | #include <asm/cpufeature.h> |
---|
9 | 10 | #include <asm/daifflags.h> |
---|
10 | 11 | #include <asm/debug-monitors.h> |
---|
11 | 12 | #include <asm/exec.h> |
---|
12 | | -#include <asm/pgtable.h> |
---|
| 13 | +#include <asm/mte.h> |
---|
13 | 14 | #include <asm/memory.h> |
---|
14 | 15 | #include <asm/mmu_context.h> |
---|
15 | 16 | #include <asm/smp_plat.h> |
---|
.. | .. |
---|
48 | 49 | */ |
---|
49 | 50 | cpu_uninstall_idmap(); |
---|
50 | 51 | |
---|
| 52 | + /* Restore CnP bit in TTBR1_EL1 */ |
---|
| 53 | + if (system_supports_cnp()) |
---|
| 54 | + cpu_replace_ttbr1(lm_alias(swapper_pg_dir)); |
---|
| 55 | + |
---|
51 | 56 | /* |
---|
52 | 57 | * PSTATE was not saved over suspend/resume, re-enable any detected |
---|
53 | 58 | * features that might not have been set correctly. |
---|
.. | .. |
---|
68 | 73 | * have turned the mitigation on. If the user has forcefully |
---|
69 | 74 | * disabled it, make sure their wishes are obeyed. |
---|
70 | 75 | */ |
---|
71 | | - if (arm64_get_ssbd_state() == ARM64_SSBD_FORCE_DISABLE) |
---|
72 | | - arm64_set_ssbd_mitigation(false); |
---|
| 76 | + spectre_v4_enable_mitigation(NULL); |
---|
| 77 | + |
---|
| 78 | + /* Restore additional feature-specific configuration */ |
---|
| 79 | + ptrauth_suspend_exit(); |
---|
73 | 80 | } |
---|
74 | 81 | |
---|
75 | 82 | /* |
---|
.. | .. |
---|
84 | 91 | int ret = 0; |
---|
85 | 92 | unsigned long flags; |
---|
86 | 93 | struct sleep_stack_data state; |
---|
| 94 | + |
---|
| 95 | + /* Report any MTE async fault before going to suspend */ |
---|
| 96 | + mte_suspend_enter(); |
---|
87 | 97 | |
---|
88 | 98 | /* |
---|
89 | 99 | * From this point debug exceptions are disabled to prevent |
---|
.. | .. |
---|
113 | 123 | if (!ret) |
---|
114 | 124 | ret = -EOPNOTSUPP; |
---|
115 | 125 | } else { |
---|
116 | | - __cpu_suspend_exit(); |
---|
| 126 | + RCU_NONIDLE(__cpu_suspend_exit()); |
---|
117 | 127 | } |
---|
118 | 128 | |
---|
119 | 129 | unpause_graph_tracing(); |
---|