ARM: OMAP2+: Fix l2dis_3630 for rodata
commit eeaf9646aca89d097861caa24d9818434e48810e upstream.
We don't want to write to .text section. Let's move l2dis_3630
to .data and access it via a pointer.
For calculating the offset, let's optimize out the add and do it
in ldr/str as suggested by Nicolas Pitre <nicolas.pitre@linaro.org>.
Cc: Kees Cook <keescook@chromium.org>
Cc: Laura Abbott <labbott@redhat.com>
Cc: Nishanth Menon <nm@ti.com>
Cc: Richard Woodruff <r-woodruff2@ti.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Tero Kristo <t-kristo@ti.com>
Acked-by: Nicolas Pitre <nico@linaro.org>
Fixes: 1e6b48116a
("ARM: mm: allow non-text sections to be
non-executable")
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
98b3f17a72
commit
31a50ee1ad
1 changed files with 13 additions and 4 deletions
|
@ -86,8 +86,9 @@ ENTRY(enable_omap3630_toggle_l2_on_restore)
|
||||||
stmfd sp!, {lr} @ save registers on stack
|
stmfd sp!, {lr} @ save registers on stack
|
||||||
/* Setup so that we will disable and enable l2 */
|
/* Setup so that we will disable and enable l2 */
|
||||||
mov r1, #0x1
|
mov r1, #0x1
|
||||||
adrl r2, l2dis_3630 @ may be too distant for plain adr
|
adrl r3, l2dis_3630_offset @ may be too distant for plain adr
|
||||||
str r1, [r2]
|
ldr r2, [r3] @ value for offset
|
||||||
|
str r1, [r2, r3] @ write to l2dis_3630
|
||||||
ldmfd sp!, {pc} @ restore regs and return
|
ldmfd sp!, {pc} @ restore regs and return
|
||||||
ENDPROC(enable_omap3630_toggle_l2_on_restore)
|
ENDPROC(enable_omap3630_toggle_l2_on_restore)
|
||||||
|
|
||||||
|
@ -415,7 +416,9 @@ ENTRY(omap3_restore)
|
||||||
cmp r2, #0x0 @ Check if target power state was OFF or RET
|
cmp r2, #0x0 @ Check if target power state was OFF or RET
|
||||||
bne logic_l1_restore
|
bne logic_l1_restore
|
||||||
|
|
||||||
ldr r0, l2dis_3630
|
adr r1, l2dis_3630_offset @ address for offset
|
||||||
|
ldr r0, [r1] @ value for offset
|
||||||
|
ldr r0, [r1, r0] @ value at l2dis_3630
|
||||||
cmp r0, #0x1 @ should we disable L2 on 3630?
|
cmp r0, #0x1 @ should we disable L2 on 3630?
|
||||||
bne skipl2dis
|
bne skipl2dis
|
||||||
mrc p15, 0, r0, c1, c0, 1
|
mrc p15, 0, r0, c1, c0, 1
|
||||||
|
@ -486,7 +489,9 @@ l2_inv_gp:
|
||||||
mov r12, #0x2
|
mov r12, #0x2
|
||||||
smc #0 @ Call SMI monitor (smieq)
|
smc #0 @ Call SMI monitor (smieq)
|
||||||
logic_l1_restore:
|
logic_l1_restore:
|
||||||
ldr r1, l2dis_3630
|
adr r0, l2dis_3630_offset @ adress for offset
|
||||||
|
ldr r1, [r0] @ value for offset
|
||||||
|
ldr r1, [r0, r1] @ value at l2dis_3630
|
||||||
cmp r1, #0x1 @ Test if L2 re-enable needed on 3630
|
cmp r1, #0x1 @ Test if L2 re-enable needed on 3630
|
||||||
bne skipl2reen
|
bne skipl2reen
|
||||||
mrc p15, 0, r1, c1, c0, 1
|
mrc p15, 0, r1, c1, c0, 1
|
||||||
|
@ -515,6 +520,10 @@ control_stat:
|
||||||
.word CONTROL_STAT
|
.word CONTROL_STAT
|
||||||
control_mem_rta:
|
control_mem_rta:
|
||||||
.word CONTROL_MEM_RTA_CTRL
|
.word CONTROL_MEM_RTA_CTRL
|
||||||
|
l2dis_3630_offset:
|
||||||
|
.long l2dis_3630 - .
|
||||||
|
|
||||||
|
.data
|
||||||
l2dis_3630:
|
l2dis_3630:
|
||||||
.word 0
|
.word 0
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue