提交 352f1bcc 编写于 作者: A Ard Biesheuvel 提交者: Zheng Zengkai

ARM: kernel: use PC relative symbol references in suspend/resume code

maillist inclusion
commit 2c7e6b4d7cbff417ff96a24c243508e16168f90c
category: feature
feature: ARM kaslr support
bugzilla: 47952
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git/commit/?h=arm-kaslr-latest&id=2c7e6b4d7cbff417ff96a24c243508e16168f90c

-------------------------------------------------

Replace some unnecessary absolute references with relative ones.

Cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: NCui GaoSheng <cuigaosheng1@huawei.com>
Reviewed-by: NXiu Jianfeng <xiujianfeng@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 c9284882
...@@ -61,15 +61,14 @@ ...@@ -61,15 +61,14 @@
ENTRY(__cpu_suspend) ENTRY(__cpu_suspend)
stmfd sp!, {r4 - r11, lr} stmfd sp!, {r4 - r11, lr}
#ifdef MULTI_CPU #ifdef MULTI_CPU
ldr r10, =processor ldr_l r4, processor + CPU_SLEEP_SIZE @ size of CPU sleep state
ldr r4, [r10, #CPU_SLEEP_SIZE] @ size of CPU sleep state
#else #else
ldr r4, =cpu_suspend_size adr_l r4, cpu_suspend_size
#endif #endif
mov r5, sp @ current virtual SP mov r5, sp @ current virtual SP
add r4, r4, #12 @ Space for pgd, virt sp, phys resume fn add r4, r4, #12 @ Space for pgd, virt sp, phys resume fn
sub sp, sp, r4 @ allocate CPU state on stack sub sp, sp, r4 @ allocate CPU state on stack
ldr r3, =sleep_save_sp adr_l r3, sleep_save_sp
stmfd sp!, {r0, r1} @ save suspend func arg and pointer stmfd sp!, {r0, r1} @ save suspend func arg and pointer
ldr r3, [r3, #SLEEP_SAVE_SP_VIRT] ldr r3, [r3, #SLEEP_SAVE_SP_VIRT]
ALT_SMP(W(nop)) @ don't use adr_l inside ALT_SMP() ALT_SMP(W(nop)) @ don't use adr_l inside ALT_SMP()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册