aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Rutland <mark.rutland@arm.com>2017-08-14 23:09:01 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-08-14 23:09:01 +0000
commit9efca214f94bdb59b42791ebbd6319cccb8d1bb8 (patch)
treefbfcddbc513e7ba468cf5b64995db71650a960bb
parentc1a162afba252161b5233df49c1475688811f862 (diff)
parenta0b2e0272c5304fe6564db9eb26a0b398418f4f4 (diff)
downloadv4.4-9efca214f94bdb59b42791ebbd6319cccb8d1bb8.tar.gz
BACKPORT: arm64: move sp_el0 and tpidr_el1 into cpu_suspend_ctx am: 48dd80cb13
am: a0b2e0272c Change-Id: I17cc891f68b9938370912e69de0b8dd90aa83cb7
-rw-r--r--arch/arm64/include/asm/suspend.h2
-rw-r--r--arch/arm64/kernel/sleep.S3
-rw-r--r--arch/arm64/kernel/suspend.c6
-rw-r--r--arch/arm64/mm/proc.S10
4 files changed, 9 insertions, 12 deletions
diff --git a/arch/arm64/include/asm/suspend.h b/arch/arm64/include/asm/suspend.h
index 59a5b0f1e81c..4d19a03d316e 100644
--- a/arch/arm64/include/asm/suspend.h
+++ b/arch/arm64/include/asm/suspend.h
@@ -1,7 +1,7 @@
#ifndef __ASM_SUSPEND_H
#define __ASM_SUSPEND_H
-#define NR_CTX_REGS 11
+#define NR_CTX_REGS 13
/*
* struct cpu_suspend_ctx must be 16-byte aligned since it is allocated on
diff --git a/arch/arm64/kernel/sleep.S b/arch/arm64/kernel/sleep.S
index e33fe33876ab..f586f7c875e2 100644
--- a/arch/arm64/kernel/sleep.S
+++ b/arch/arm64/kernel/sleep.S
@@ -173,9 +173,6 @@ ENTRY(cpu_resume)
/* load physical address of identity map page table in x1 */
adrp x1, idmap_pg_dir
mov sp, x2
- /* save thread_info */
- and x2, x2, #~(THREAD_SIZE - 1)
- msr sp_el0, x2
/*
* cpu_do_resume expects x0 to contain context physical address
* pointer and x1 to contain physical address of 1:1 page tables
diff --git a/arch/arm64/kernel/suspend.c b/arch/arm64/kernel/suspend.c
index f42b8b8f1d0a..e7a96462ca2d 100644
--- a/arch/arm64/kernel/suspend.c
+++ b/arch/arm64/kernel/suspend.c
@@ -96,12 +96,6 @@ int cpu_suspend(unsigned long arg, int (*fn)(unsigned long))
cpu_uninstall_idmap();
/*
- * Restore per-cpu offset before any kernel
- * subsystem relying on it has a chance to run.
- */
- set_my_cpu_offset(per_cpu_offset(smp_processor_id()));
-
- /*
* PSTATE was not saved over suspend/resume, re-enable any
* detected features that might not have been set correctly.
*/
diff --git a/arch/arm64/mm/proc.S b/arch/arm64/mm/proc.S
index 85a542b21575..3b3a4710dcd6 100644
--- a/arch/arm64/mm/proc.S
+++ b/arch/arm64/mm/proc.S
@@ -71,12 +71,15 @@ ENTRY(cpu_do_suspend)
mrs x10, mdscr_el1
mrs x11, oslsr_el1
mrs x12, sctlr_el1
+ mrs x13, tpidr_el1
+ mrs x14, sp_el0
stp x2, x3, [x0]
stp x4, x5, [x0, #16]
stp x6, x7, [x0, #32]
stp x8, x9, [x0, #48]
stp x10, x11, [x0, #64]
- str x12, [x0, #80]
+ stp x12, x13, [x0, #80]
+ str x14, [x0, #96]
ret
ENDPROC(cpu_do_suspend)
@@ -99,7 +102,8 @@ ENTRY(cpu_do_resume)
ldp x6, x7, [x0, #32]
ldp x8, x9, [x0, #48]
ldp x10, x11, [x0, #64]
- ldr x12, [x0, #80]
+ ldp x12, x13, [x0, #80]
+ ldr x14, [x0, #96]
msr tpidr_el0, x2
msr tpidrro_el0, x3
msr contextidr_el1, x4
@@ -111,6 +115,8 @@ ENTRY(cpu_do_resume)
msr tcr_el1, x8
msr vbar_el1, x9
msr mdscr_el1, x10
+ msr tpidr_el1, x13
+ msr sp_el0, x14
/*
* Restore oslsr_el1 by writing oslar_el1
*/