aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2015-06-01 07:40:34 -0400
committerCatalin Marinas <catalin.marinas@arm.com>2015-06-02 12:45:07 -0400
commit9acdc2af0c0b836183b7f31f630bbed341a7cf4d (patch)
tree095abac6f030e321258b85eb7edd61e34be033ec
parent5dfe9d7d23c26d029415379630523f141a748c5b (diff)
arm64: drop sleep_idmap_phys and clean up cpu_resume()
Two cleanups of the asm function cpu_resume(): - The global variable sleep_idmap_phys always points to idmap_pg_dir, so we can just use that value directly in the CPU resume path. - Unclutter the load of sleep_save_sp::save_ptr_stash_phys. Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Tested-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
-rw-r--r--arch/arm64/kernel/sleep.S7
-rw-r--r--arch/arm64/kernel/suspend.c3
2 files changed, 2 insertions, 8 deletions
diff --git a/arch/arm64/kernel/sleep.S b/arch/arm64/kernel/sleep.S
index 811e61a2d847..803cfea41962 100644
--- a/arch/arm64/kernel/sleep.S
+++ b/arch/arm64/kernel/sleep.S
@@ -164,15 +164,12 @@ ENTRY(cpu_resume)
164#else 164#else
165 mov x7, xzr 165 mov x7, xzr
166#endif 166#endif
167 adrp x0, sleep_save_sp 167 ldr_l x0, sleep_save_sp + SLEEP_SAVE_SP_PHYS
168 add x0, x0, #:lo12:sleep_save_sp
169 ldr x0, [x0, #SLEEP_SAVE_SP_PHYS]
170 ldr x0, [x0, x7, lsl #3] 168 ldr x0, [x0, x7, lsl #3]
171 /* load sp from context */ 169 /* load sp from context */
172 ldr x2, [x0, #CPU_CTX_SP] 170 ldr x2, [x0, #CPU_CTX_SP]
173 adrp x1, sleep_idmap_phys
174 /* load physical address of identity map page table in x1 */ 171 /* load physical address of identity map page table in x1 */
175 ldr x1, [x1, #:lo12:sleep_idmap_phys] 172 adrp x1, idmap_pg_dir
176 mov sp, x2 173 mov sp, x2
177 /* 174 /*
178 * cpu_do_resume expects x0 to contain context physical address 175 * cpu_do_resume expects x0 to contain context physical address
diff --git a/arch/arm64/kernel/suspend.c b/arch/arm64/kernel/suspend.c
index d7daf45ae7a2..f6073c27d65f 100644
--- a/arch/arm64/kernel/suspend.c
+++ b/arch/arm64/kernel/suspend.c
@@ -118,7 +118,6 @@ int __cpu_suspend(unsigned long arg, int (*fn)(unsigned long))
118} 118}
119 119
120struct sleep_save_sp sleep_save_sp; 120struct sleep_save_sp sleep_save_sp;
121phys_addr_t sleep_idmap_phys;
122 121
123static int __init cpu_suspend_init(void) 122static int __init cpu_suspend_init(void)
124{ 123{
@@ -132,9 +131,7 @@ static int __init cpu_suspend_init(void)
132 131
133 sleep_save_sp.save_ptr_stash = ctx_ptr; 132 sleep_save_sp.save_ptr_stash = ctx_ptr;
134 sleep_save_sp.save_ptr_stash_phys = virt_to_phys(ctx_ptr); 133 sleep_save_sp.save_ptr_stash_phys = virt_to_phys(ctx_ptr);
135 sleep_idmap_phys = virt_to_phys(idmap_pg_dir);
136 __flush_dcache_area(&sleep_save_sp, sizeof(struct sleep_save_sp)); 134 __flush_dcache_area(&sleep_save_sp, sizeof(struct sleep_save_sp));
137 __flush_dcache_area(&sleep_idmap_phys, sizeof(sleep_idmap_phys));
138 135
139 return 0; 136 return 0;
140} 137}