aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm64/include/asm/exec.h3
-rw-r--r--arch/arm64/kernel/process.c3
-rw-r--r--arch/arm64/kernel/suspend.c11
3 files changed, 16 insertions, 1 deletions
diff --git a/arch/arm64/include/asm/exec.h b/arch/arm64/include/asm/exec.h
index db0563c23482..f7865dd9d868 100644
--- a/arch/arm64/include/asm/exec.h
+++ b/arch/arm64/include/asm/exec.h
@@ -18,6 +18,9 @@
18#ifndef __ASM_EXEC_H 18#ifndef __ASM_EXEC_H
19#define __ASM_EXEC_H 19#define __ASM_EXEC_H
20 20
21#include <linux/sched.h>
22
21extern unsigned long arch_align_stack(unsigned long sp); 23extern unsigned long arch_align_stack(unsigned long sp);
24void uao_thread_switch(struct task_struct *next);
22 25
23#endif /* __ASM_EXEC_H */ 26#endif /* __ASM_EXEC_H */
diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c
index 27b2f1387df4..4f186c56c5eb 100644
--- a/arch/arm64/kernel/process.c
+++ b/arch/arm64/kernel/process.c
@@ -49,6 +49,7 @@
49#include <asm/alternative.h> 49#include <asm/alternative.h>
50#include <asm/compat.h> 50#include <asm/compat.h>
51#include <asm/cacheflush.h> 51#include <asm/cacheflush.h>
52#include <asm/exec.h>
52#include <asm/fpsimd.h> 53#include <asm/fpsimd.h>
53#include <asm/mmu_context.h> 54#include <asm/mmu_context.h>
54#include <asm/processor.h> 55#include <asm/processor.h>
@@ -301,7 +302,7 @@ static void tls_thread_switch(struct task_struct *next)
301} 302}
302 303
303/* Restore the UAO state depending on next's addr_limit */ 304/* Restore the UAO state depending on next's addr_limit */
304static void uao_thread_switch(struct task_struct *next) 305void uao_thread_switch(struct task_struct *next)
305{ 306{
306 if (IS_ENABLED(CONFIG_ARM64_UAO)) { 307 if (IS_ENABLED(CONFIG_ARM64_UAO)) {
307 if (task_thread_info(next)->addr_limit == KERNEL_DS) 308 if (task_thread_info(next)->addr_limit == KERNEL_DS)
diff --git a/arch/arm64/kernel/suspend.c b/arch/arm64/kernel/suspend.c
index ad734142070d..bb0cd787a9d3 100644
--- a/arch/arm64/kernel/suspend.c
+++ b/arch/arm64/kernel/suspend.c
@@ -1,8 +1,11 @@
1#include <linux/ftrace.h> 1#include <linux/ftrace.h>
2#include <linux/percpu.h> 2#include <linux/percpu.h>
3#include <linux/slab.h> 3#include <linux/slab.h>
4#include <asm/alternative.h>
4#include <asm/cacheflush.h> 5#include <asm/cacheflush.h>
6#include <asm/cpufeature.h>
5#include <asm/debug-monitors.h> 7#include <asm/debug-monitors.h>
8#include <asm/exec.h>
6#include <asm/pgtable.h> 9#include <asm/pgtable.h>
7#include <asm/memory.h> 10#include <asm/memory.h>
8#include <asm/mmu_context.h> 11#include <asm/mmu_context.h>
@@ -50,6 +53,14 @@ void notrace __cpu_suspend_exit(void)
50 set_my_cpu_offset(per_cpu_offset(cpu)); 53 set_my_cpu_offset(per_cpu_offset(cpu));
51 54
52 /* 55 /*
56 * PSTATE was not saved over suspend/resume, re-enable any detected
57 * features that might not have been set correctly.
58 */
59 asm(ALTERNATIVE("nop", SET_PSTATE_PAN(1), ARM64_HAS_PAN,
60 CONFIG_ARM64_PAN));
61 uao_thread_switch(current);
62
63 /*
53 * Restore HW breakpoint registers to sane values 64 * Restore HW breakpoint registers to sane values
54 * before debug exceptions are possibly reenabled 65 * before debug exceptions are possibly reenabled
55 * through local_dbg_restore. 66 * through local_dbg_restore.