Hi all,
Here are read-only data fixes for omaps discovered few weeks ago
with "[PATCH v2] ARM: mm: flip priority of CONFIG_DEBUG_RODATA"
that caused issues during deeper idle states on omaps [0].
Please review and test if possible. I'd like to merge these fixes
during v4.5-rc cycle to remove these blockers for making it possible
to have CONFIG_DEBUG_RODATA enabled by default.
Regards,
Tony
[0] https://lkml.org/lkml/2015/12/2/908
Tony Lindgren (5):
ARM: OMAP2+: Fix wait_dll_lock_timed for rodata
ARM: OMAP2+: Fix l2dis_3630 for rodata
ARM: OMAP2+: Fix save_secure_ram_context for rodata
ARM: OMAP2+: Fix l2_inv_api_params for rodata
ARM: OMAP2+: Fix ppa_zero_params and ppa_por_params for rodata
arch/arm/mach-omap2/sleep34xx.S | 60 ++++++++++++++++++++---------------------
arch/arm/mach-omap2/sleep44xx.S | 25 +++++++++++------
2 files changed, 47 insertions(+), 38 deletions(-)
--
2.7.0.rc3
We don't want to be writing to .text so it can be set rodata.
Fix error "Unable to handle kernel paging request at virtual address
c012396c" in wait_dll_lock_timed if CONFIG_DEBUG_RODATA is selected.
As these counters are for debugging only and unused, we can just
remove them.
Cc: Kees Cook <redacted>
Cc: Laura Abbott <redacted>
Cc: Nicolas Pitre <redacted>
Cc: Nishanth Menon <redacted>
Cc: Richard Woodruff <redacted>
Cc: Russell King <redacted>
Cc: Tero Kristo <redacted>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
arch/arm/mach-omap2/sleep34xx.S | 22 ----------------------
1 file changed, 22 deletions(-)
We don't want to write to .text section. Let's move l2dis_3630
to .data and access it via a pointer.
Cc: Kees Cook <redacted>
Cc: Laura Abbott <redacted>
Cc: Nicolas Pitre <redacted>
Cc: Nishanth Menon <redacted>
Cc: Richard Woodruff <redacted>
Cc: Russell King <redacted>
Cc: Tero Kristo <redacted>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
arch/arm/mach-omap2/sleep34xx.S | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
@@ -415,7 +417,9 @@ ENTRY(omap3_restore)cmpr2,#0x0 @ Check if target power state was OFF or RETbnelogic_l1_restore-ldrr0,l2dis_3630+adrr1,l2dis_3630_offset+ldrr0,[r1]+addr0,r0,r1cmpr0,#0x1 @ should we disable L2 on 3630?bneskipl2dismrcp15,0,r0,c1,c0,1
@@ -484,7 +488,9 @@ l2_inv_gp:movr12,#0x2smc#0 @ Call SMI monitor (smieq)logic_l1_restore:-ldrr1,l2dis_3630+adrr0,l2dis_3630_offset+ldrr1,[r0]+addr1,r1,r0cmpr1,#0x1 @ Test if L2 re-enable needed on 3630bneskipl2reenmrcp15,0,r1,c1,c0,1
We don't want to write to .text and we can move save_secure_ram_context
into .data as it all gets copied into SRAM anyways.
Cc: Kees Cook <redacted>
Cc: Laura Abbott <redacted>
Cc: Nicolas Pitre <redacted>
Cc: Nishanth Menon <redacted>
Cc: Richard Woodruff <redacted>
Cc: Russell King <redacted>
Cc: Tero Kristo <redacted>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
arch/arm/mach-omap2/sleep34xx.S | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
We don't want to write to .text, so let's move l2_inv_api_params
to .data and access it via a pointer.
Cc: Kees Cook <redacted>
Cc: Laura Abbott <redacted>
Cc: Nicolas Pitre <redacted>
Cc: Nishanth Menon <redacted>
Cc: Richard Woodruff <redacted>
Cc: Russell King <redacted>
Cc: Tero Kristo <redacted>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
arch/arm/mach-omap2/sleep34xx.S | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
@@ -437,12 +437,14 @@ skipl2dis:andr1,#0x700cmpr1,#0x300beql2_inv_gp+adrr0,l2_inv_api_params_offset@r3pointstodummyparameters+ldrr3,[r0]+addr3,r3,r0movr0,#40 @ set service ID for PPAmovr12,r0@copysecureServiceIDinr12movr1,#0 @ set task id for ROM code in r1movr2,#4 @ set some flags in r2, r6movr6,#0xff-adrr3,l2_inv_api_params@r3pointstodummyparametersdsb@datawritebarrierdmb@datamemorybarriersmc#1 @ call SMI monitor (smi #1)
@@ -476,8 +478,8 @@ skipl2dis:blogic_l1_restore.align-l2_inv_api_params:-.word0x1,0x00+l2_inv_api_params_offset:+.longl2_inv_api_params-.l2_inv_gp:/*ExecutesmitoinvalidateL2cache*/movr12,#0x1 @ set up to invalidate L2
We don't want to write to .text so let's move ppa_zero_params and
ppa_por_params to .data and access them via pointers.
Note that I have not been able to test as we I don't have a HS
omap4 to test with. The code has been changed in similar way as
for omap3 though.
Cc: Kees Cook <redacted>
Cc: Laura Abbott <redacted>
Cc: Nicolas Pitre <redacted>
Cc: Nishanth Menon <redacted>
Cc: Richard Woodruff <redacted>
Cc: Russell King <redacted>
Cc: Tero Kristo <redacted>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
arch/arm/mach-omap2/sleep44xx.S | 25 +++++++++++++++++--------
1 file changed, 17 insertions(+), 8 deletions(-)
@@ -266,7 +260,9 @@ ENTRY(omap4_cpu_resume)beqskip_ns_smp_enableppa_actrl_retry:movr0,#OMAP4_PPA_CPU_ACTRL_SMP_INDEX-adrr3,ppa_zero_params@Pointertoparameters+adrr1,ppa_zero_params_offset@Pointertoparameters+ldrr3,[r1]+addr3,r3,r1movr1,#0x0 @ Process IDmovr2,#0x4 @ Flagmovr6,#0xff
@@ -303,7 +299,9 @@ skip_ns_smp_enable:ldrr0,=OMAP4_PPA_L2_POR_INDEXldrr1,=OMAP44XX_SAR_RAM_BASEldrr4,[r1,#L2X0_PREFETCH_CTRL_OFFSET]-adrr3,ppa_por_params+adrr1,ppa_por_params_offset+ldrr3,[r1]+addr3,r3,r1strr4,[r3,#0x04]movr1,#0x0 @ Process IDmovr2,#0x4 @ Flag
From: Nicolas Pitre <hidden> Date: 2016-01-19 18:10:09
On Tue, 19 Jan 2016, Tony Lindgren wrote:
quoted hunk
We don't want to write to .text section. Let's move l2dis_3630
to .data and access it via a pointer.
Cc: Kees Cook <redacted>
Cc: Laura Abbott <redacted>
Cc: Nicolas Pitre <redacted>
Cc: Nishanth Menon <redacted>
Cc: Richard Woodruff <redacted>
Cc: Russell King <redacted>
Cc: Tero Kristo <redacted>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
arch/arm/mach-omap2/sleep34xx.S | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
You could combine the add with the following str:
str r1, [r2, r3]
quoted hunk
ldmfd sp!, {pc} @ restore regs and return
ENDPROC(enable_omap3630_toggle_l2_on_restore)
@@ -415,7 +417,9 @@ ENTRY(omap3_restore) cmp r2, #0x0 @ Check if target power state was OFF or RET bne logic_l1_restore- ldr r0, l2dis_3630+ adr r1, l2dis_3630_offset+ ldr r0, [r1]+ add r0, r0, r1 cmp r0, #0x1 @ should we disable L2 on 3630?
This looks wrong. You're testing the first bit of the address for
l2dis_3630 rather than its content.
On Tue, Jan 19, 2016 at 9:48 AM, Tony Lindgren [off-list ref] wrote:
Hi all,
Here are read-only data fixes for omaps discovered few weeks ago
with "[PATCH v2] ARM: mm: flip priority of CONFIG_DEBUG_RODATA"
that caused issues during deeper idle states on omaps [0].
Please review and test if possible. I'd like to merge these fixes
during v4.5-rc cycle to remove these blockers for making it possible
to have CONFIG_DEBUG_RODATA enabled by default.
Yay! :) Thanks for working on this.
-Kees
Regards,
Tony
[0] https://lkml.org/lkml/2015/12/2/908
Tony Lindgren (5):
ARM: OMAP2+: Fix wait_dll_lock_timed for rodata
ARM: OMAP2+: Fix l2dis_3630 for rodata
ARM: OMAP2+: Fix save_secure_ram_context for rodata
ARM: OMAP2+: Fix l2_inv_api_params for rodata
ARM: OMAP2+: Fix ppa_zero_params and ppa_por_params for rodata
arch/arm/mach-omap2/sleep34xx.S | 60 ++++++++++++++++++++---------------------
arch/arm/mach-omap2/sleep44xx.S | 25 +++++++++++------
2 files changed, 47 insertions(+), 38 deletions(-)
--
2.7.0.rc3
ldmfd sp!, {pc} @ restore regs and return
ENDPROC(enable_omap3630_toggle_l2_on_restore)
@@ -415,7 +417,9 @@ ENTRY(omap3_restore) cmp r2, #0x0 @ Check if target power state was OFF or RET bne logic_l1_restore- ldr r0, l2dis_3630+ adr r1, l2dis_3630_offset+ ldr r0, [r1]+ add r0, r0, r1 cmp r0, #0x1 @ should we disable L2 on 3630?
This looks wrong. You're testing the first bit of the address for
l2dis_3630 rather than its content.
Ugh yup a ldr missing missing there. Will check the whole series
and repost. Thanks for checking!
Regards,
Tony
From: Sergei Shtylyov <hidden> Date: 2016-01-19 18:45:51
Hello.
On 01/19/2016 08:48 PM, Tony Lindgren wrote:
quoted hunk
We don't want to write to .text and we can move save_secure_ram_context
into .data as it all gets copied into SRAM anyways.
Cc: Kees Cook <redacted>
Cc: Laura Abbott <redacted>
Cc: Nicolas Pitre <redacted>
Cc: Nishanth Menon <redacted>
Cc: Richard Woodruff <redacted>
Cc: Russell King <redacted>
Cc: Tero Kristo <redacted>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
arch/arm/mach-omap2/sleep34xx.S | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
+ * relocated to SRAM, so it can be all in .data section. Otherwise+ * we need to initialize api_params separately.+ */+ .data .align 3 ENTRY(save_secure_ram_context) stmfd sp!, {r4 - r11, lr} @ save registers on stack