Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Ard Biesheuvel and committed by
Catalin Marinas
9acdc2af 5dfe9d7d

+2 -8
+2 -5
arch/arm64/kernel/sleep.S
··· 164 164 #else 165 165 mov x7, xzr 166 166 #endif 167 - adrp x0, sleep_save_sp 168 - add x0, x0, #:lo12:sleep_save_sp 169 - ldr x0, [x0, #SLEEP_SAVE_SP_PHYS] 167 + ldr_l x0, sleep_save_sp + SLEEP_SAVE_SP_PHYS 170 168 ldr x0, [x0, x7, lsl #3] 171 169 /* load sp from context */ 172 170 ldr x2, [x0, #CPU_CTX_SP] 173 - adrp x1, sleep_idmap_phys 174 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 173 mov sp, x2 177 174 /* 178 175 * cpu_do_resume expects x0 to contain context physical address
-3
arch/arm64/kernel/suspend.c
··· 118 118 } 119 119 120 120 struct sleep_save_sp sleep_save_sp; 121 - phys_addr_t sleep_idmap_phys; 122 121 123 122 static int __init cpu_suspend_init(void) 124 123 { ··· 131 132 132 133 sleep_save_sp.save_ptr_stash = ctx_ptr; 133 134 sleep_save_sp.save_ptr_stash_phys = virt_to_phys(ctx_ptr); 134 - sleep_idmap_phys = virt_to_phys(idmap_pg_dir); 135 135 __flush_dcache_area(&sleep_save_sp, sizeof(struct sleep_save_sp)); 136 - __flush_dcache_area(&sleep_idmap_phys, sizeof(sleep_idmap_phys)); 137 136 138 137 return 0; 139 138 }