
From: Cui GaoSheng <cuigaosheng1@huawei.com> 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: Cui GaoSheng <cuigaosheng1@huawei.com> Reviewed-by: Xiu Jianfeng <xiujianfeng@huawei.com> Reviewed-by: Jason Yan <yanaijie@huawei.com> Reviewed-by: Hanjun Guo <guohanjun@huawei.com> Signed-off-by: Chen Jun <chenjun102@huawei.com> --- arch/arm/mm/proc-v7.S | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S index a59ddfd7a179..2fcffcc60cc6 100644 --- a/arch/arm/mm/proc-v7.S +++ b/arch/arm/mm/proc-v7.S @@ -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 -- 2.20.1