提交 0eb41106 编写于 作者: C Cui GaoSheng 提交者: Zheng Zengkai

ARM: use ldr_l to replace ldr instruction for the symbol jump

hulk inclusion
category: bugfix
bugzilla: 185737 https://gitee.com/openeuler/kernel/issues/I4DDEL

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

ARM supports position independent code sequences that produce symbol
references with a greater reach than the ordinary adr/ldr instructions,
pseudo-instruction ldr_l is used to solve the symbol references problem,
so we should use ldr_l to replace ldr instrutction when kaslr is enabled.
Signed-off-by: NCui GaoSheng <cuigaosheng1@huawei.com>
Reviewed-by: NXiu Jianfeng <xiujianfeng@huawei.com>
Reviewed-by: NJason Yan <yanaijie@huawei.com>
Reviewed-by: NHanjun Guo <guohanjun@huawei.com>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 a8532cfb
......@@ -112,10 +112,8 @@ ENTRY(cpu_v7_hvc_switch_mm)
ENDPROC(cpu_v7_hvc_switch_mm)
#endif
.globl nospectre_v2
ENTRY(cpu_v7_iciallu_switch_mm)
adr r3, 3f
ldr r3, [r3]
ldr_l r3, nospectre_v2
cmp r3, #1
beq 1f
mov r3, #0
......@@ -124,8 +122,7 @@ ENTRY(cpu_v7_iciallu_switch_mm)
b cpu_v7_switch_mm
ENDPROC(cpu_v7_iciallu_switch_mm)
ENTRY(cpu_v7_bpiall_switch_mm)
adr r3, 3f
ldr r3, [r3]
ldr_l r3, nospectre_v2
cmp r3, #1
beq 1f
mov r3, #0
......@@ -134,9 +131,6 @@ ENTRY(cpu_v7_bpiall_switch_mm)
b cpu_v7_switch_mm
ENDPROC(cpu_v7_bpiall_switch_mm)
.align
3: .long nospectre_v2
string cpu_v7_name, "ARMv7 Processor"
.align
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册