v4.12 breaks pxa25x
Hi Russell,
In current linux master branch, the lubbock board systematically breaks in early boot stages. That doesn't happen in v4.12.
Quoted 1 line
From what I got so far as information, I have :
- the full kernel message in [1]
- the breakage is between v4.12 and
568d135d337d ("Merge branch 'upstream' of
git://git.linux-mips.org/pub/scm/ralf/upstream-linus")
- pc = 0xc0019e24
arm-none-linux-gnueabi-addr2line -i -e vmlinux c0019e24
=> /kernel/work/jenkins/jobs/Linux_Kernel/workspace/arch/arm/mm/proc-xscale.S:215
- gdb
(gdb) disass __flush_whole_cache
Dump of assembler code for function __flush_whole_cache:
0xc0019e20 <+0>: ldr r1, [pc, #788] ; 0xc001a13c <cpu_xscale_set_pte_ext+92>
0xc0019e24 <+4>: ldr r0, [r1]
(gdb) disass /m paging_init
1411 local_flush_tlb_all();
1412 flush_cache_all();
0xc049d270 <+1200>: bl 0xc0019e18 <xscale_flush_user_cache_all>
1413
1414 /* Enable asynchronous aborts */
1415 early_abt_enable();
0xc049d274 <+1204>: bl 0xc049b78c <early_abt_enable>
I have not yet begun the bissection which will be my next task, so this is a heads up until I find out which commit is triggering this.
Signature · 49 lines
Robert [1] Loading ARM Linux zImage '/mnt/tftp/zImage_jenkins' commandline: console=ttyS0,115200 earlycon ip=dhcp root=/dev/nfs nfsroot=/home/none/nfsroot/lubbock,v3,tcp mtdparts=application-flash:2048k at 0(nor0.barebox)ro,256k(nor0.barebox-env),256k(nor0.barebox-logo),256k(nor0.barebox-logo2),5120k(nor0.kernel),-(nor0.root) arch_number: 89 Uncompressing Linux... done, booting the kernel. [ 0.000000] Booting Linux on physical CPU 0x0 [ 0.000000] Linux version 4.12.0-11927-g6bf3d68 (jenkins at belgarath) (gcc version 4.8.3 20140320 (prerelease) (Sourcery CodeBench Lite 2014.05-29)) #4582 Mon Jul 17 08:27:18 CEST 2017 [ 0.000000] CPU: XScale-PXA255 [69052d06] revision 6 (ARMv5TE), cr=0000397f [ 0.000000] CPU: VIVT data cache, VIVT instruction cache [ 0.000000] Machine: Intel DBPXA250 Development Platform (aka Lubbock) [ 0.000000] Ignoring tag cmdline (using the default kernel command line) [ 0.000000] earlycon: early_pxa0 at MMIO 0x40100000 (options '') [ 0.000000] bootconsole [early_pxa0] enabled [ 0.000000] Memory policy: Data cache writeback [ 0.000000] Run Mode clock: 0.00MHz [ 0.000000] Turbo Mode clock: 0.00MHz [ 0.000000] Memory clock: 0.00MHz [ 0.000000] Unhandled fault: alignment exception (0x003) at 0xc06f82cd [ 0.000000] pgd = c0004000 [ 0.000000] [c06f82cd] *pgd=a060040e(bad) [ 0.000000] Internal error: : 3 [#1] ARM [ 0.000000] Modules linked in: [ 0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 4.12.0-11927-g6bf3d68 #4582 [ 0.000000] Hardware name: Intel DBPXA250 Development Platform (aka Lubbock) [ 0.000000] task: c06f6fd8 task.stack: c06f2000 [ 0.000000] PC is at __flush_whole_cache+0x4/0x60 [ 0.000000] LR is at paging_init+0x4b4/0x590 [ 0.000000] pc : [<c0019e24>] lr : [<c049d274>] psr: 600000d3 [ 0.000000] sp : c06f3f38 ip : 00000000 fp : c0700000 [ 0.000000] r10: a4000000 r9 : c06f82c0 r8 : c0723540 [ 0.000000] r7 : fe100000 r6 : fe200000 r5 : c06f82a0 r4 : c0705ef4 [ 0.000000] r3 : 00000000 r2 : 00000004 r1 : c06f82cd r0 : c06f82c0 [ 0.000000] Flags: nZCv IRQs off FIQs off Mode SVC_32 ISA ARM Segment none [ 0.000000] Control: 0000397f Table: a0004000 DAC: 00000053 [ 0.000000] Process swapper (pid: 0, stack limit = 0xc06f2190) [ 0.000000] Stack: (0xc06f3f38 to 0xc06f4000) [ 0.000000] 3f20: 000a0000 000a0700 [ 0.000000] 3f40: c04b3b38 c0000000 ffff1000 000a3ffd 00001000 00000007 c04b3b38 c04b3b38 [ 0.000000] 3f60: c0008000 c06f3fd4 c04b5a28 c04b5a18 c0706084 c0723538 00000000 c049aaac [ 0.000000] 3f80: 0000006c 0000397f 00000000 c004992c c040b5ad c06f3fb4 c06f3fb4 00000000 [ 0.000000] 3fa0: c06f5018 c04b5a24 c06f7e68 00000001 c06f5000 a04b3ad0 00000000 c0497904 [ 0.000000] 3fc0: 00000000 00000000 00000000 00000000 00000000 c04b5a28 c07234f4 c06f5018 [ 0.000000] 3fe0: c04b5a24 c06f7e68 a0004000 69052d06 a04b3ad0 a0008048 00000000 00000000 [ 0.000000] Code: e1a0f00e e3a02004 e3a0c000 e59f1314 (e5910000) [ 0.000000] ---[ end trace 0000000000000000 ]--- [ 0.000000] Kernel panic - not syncing: Attempted to kill the idle task! [ 0.000000] ---[ end Kernel panic - not syncing: Attempted to kill the idle task!
Russell King - ARM Linux
maintainerQuoted 7 lines · Robert Jarzmik
[ 0.000000] Unhandled fault: alignment exception (0x003) at 0xc06f82cd [ 0.000000] pgd = c0004000 [ 0.000000] [c06f82cd] *pgd=a060040e(bad) [ 0.000000] Internal error: : 3 [#1] ARM [ 0.000000] Modules linked in: [ 0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 4.12.0-11927-g6bf3d68 #4582 [ 0.000000] Hardware name: Intel DBPXA250 Development Platform (aka Lubbock)
Quoted 8 lines
[ 0.000000] task: c06f6fd8 task.stack: c06f2000 [ 0.000000] PC is at __flush_whole_cache+0x4/0x60 [ 0.000000] LR is at paging_init+0x4b4/0x590 [ 0.000000] pc : [<c0019e24>] lr : [<c049d274>] psr: 600000d3 [ 0.000000] sp : c06f3f38 ip : 00000000 fp : c0700000 [ 0.000000] r10: a4000000 r9 : c06f82c0 r8 : c0723540 [ 0.000000] r7 : fe100000 r6 : fe200000 r5 : c06f82a0 r4 : c0705ef4 [ 0.000000] r3 : 00000000 r2 : 00000004 r1 : c06f82cd r0 : c06f82c0
Looks like the .data section has become misaligned somehow. r1 is the address of "clean_addr" which is clearly not 32-bit aligned.
Please can you check in System.map to see what's immediately before it?
Signature · 3 lines
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net.
Quoted 18 lines · Russell King - ARM Linux
Quoted 7 lines · Robert Jarzmik
[ 0.000000] Unhandled fault: alignment exception (0x003) at 0xc06f82cd [ 0.000000] pgd = c0004000 [ 0.000000] [c06f82cd] *pgd=a060040e(bad) [ 0.000000] Internal error: : 3 [#1] ARM [ 0.000000] Modules linked in: [ 0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 4.12.0-11927-g6bf3d68 #4582 [ 0.000000] Hardware name: Intel DBPXA250 Development Platform (aka Lubbock)Quoted 8 lines
[ 0.000000] task: c06f6fd8 task.stack: c06f2000 [ 0.000000] PC is at __flush_whole_cache+0x4/0x60 [ 0.000000] LR is at paging_init+0x4b4/0x590 [ 0.000000] pc : [<c0019e24>] lr : [<c049d274>] psr: 600000d3 [ 0.000000] sp : c06f3f38 ip : 00000000 fp : c0700000 [ 0.000000] r10: a4000000 r9 : c06f82c0 r8 : c0723540 [ 0.000000] r7 : fe100000 r6 : fe200000 r5 : c06f82a0 r4 : c0705ef4 [ 0.000000] r3 : 00000000 r2 : 00000004 r1 : c06f82cd r0 : c06f82c0
Quoted 4 lines
Looks like the .data section has become misaligned somehow. r1 is the address of "
clean_addr" which is clearly not 32-bit aligned.Please can you check in System.map to see what's immediately before it?
Sure, it like this :c06f22c8 D user_pmd_tablec06f22cc d __warned.19178c06f22cd d clean_addr
And I have no idea how to link that __warned.19178 with the WARN_xxx() statement ...
This bisection I made points me to :
# first bad commit: [799c43415442414b1032580c47684cb709dfed6d] kbuild: thin archives make default for all archs
Reverting this commit makes my kernel boot again.
--
Robert
Quoted 29 lines · Robert Jarzmik
Quoted 18 lines · Russell King - ARM Linux
Quoted 7 lines · Robert Jarzmik
[ 0.000000] Unhandled fault: alignment exception (0x003) at 0xc06f82cd [ 0.000000] pgd = c0004000 [ 0.000000] [c06f82cd] *pgd=a060040e(bad) [ 0.000000] Internal error: : 3 [#1] ARM [ 0.000000] Modules linked in: [ 0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 4.12.0-11927-g6bf3d68 #4582 [ 0.000000] Hardware name: Intel DBPXA250 Development Platform (aka Lubbock)Quoted 8 lines
[ 0.000000] task: c06f6fd8 task.stack: c06f2000 [ 0.000000] PC is at __flush_whole_cache+0x4/0x60 [ 0.000000] LR is at paging_init+0x4b4/0x590 [ 0.000000] pc : [<c0019e24>] lr : [<c049d274>] psr: 600000d3 [ 0.000000] sp : c06f3f38 ip : 00000000 fp : c0700000 [ 0.000000] r10: a4000000 r9 : c06f82c0 r8 : c0723540 [ 0.000000] r7 : fe100000 r6 : fe200000 r5 : c06f82a0 r4 : c0705ef4 [ 0.000000] r3 : 00000000 r2 : 00000004 r1 : c06f82cd r0 : c06f82c0Quoted 4 lines
Looks like the .data section has become misaligned somehow. r1 is the address of "
clean_addr" which is clearly not 32-bit aligned.Please can you check in System.map to see what's immediately before it?
Sure, it like this :
c06f22c8Duser_pmd_tablec06f22ccd __warned.19178c06f22cddclean_addr
Quoted 6 lines
And I have no idea how to link that __warned.19178 with the
WARN_xxx()statement ...This bisection I made points me to :
# first bad commit: [799c43415442414b1032580c47684cb709dfed6d] kbuild: thin archives make default for all archsReverting this commit makes my kernel boot again.
Hi Russell,
I think I know where this is comming from.
- in file: ~/mio_linux/kernel/include/asm-generic/vmlinux.lds.h:206
- the definition of DATA_DATA looks like :
(*.data .data.[0-9a-zA-Z_]*)
...
*(.data.unlikely)
...This doesn't look good to me, as .data.unlikely fullfills the first wildcard, and the linker is allowed to mix .data and .data.unlikely symbols to its pleasure, while .data.unlikely symbols (at least in my case) are not 4 bytes multiples.
I'm clearly not a ld specialist, as I would have put a *(.data.unlikely) first in DATA_DATA, an align statement, then continued with the current wildcards, but that might not be the right approach.
If you suggest something else, I'll send a patch for it. If not, I'll send a patch for my idea. And lastly, if it doesn't fit you, I'll have to modify the PXA kconfig to toggle the default flag which triggers the error.
Cheers.
Signature · 4 lines
Robert PS: In the meantime, I'll corner down which exact instruction and code is creating the .data.unlikely 1 byte data.
Russell King - ARM Linux
maintainerQuoted 23 lines · Robert Jarzmik
Quoted 11 lines · Robert Jarzmik
Sure, it like this :
c06f22c8Duser_pmd_tablec06f22ccd __warned.19178c06f22cddclean_addrAnd I have no idea how to link that __warned.19178 with the
WARN_xxx()statement ...This bisection I made points me to :
# first bad commit: [799c43415442414b1032580c47684cb709dfed6d] kbuild: thin archives make default for all archsReverting this commit makes my kernel boot again.
Hi Russell,
I think I know where this is comming from.
- in file:~/mio_linux/kernel/include/asm-generic/vmlinux.lds.h:206
- the definition ofDATA_DATAlooks like :(*.data .data.[0-9a-zA-Z_]*) ... *(.data.unlikely) ...
Quoted 4 lines
This doesn't look good to me, as .data.unlikely fullfills the first wildcard, and the linker is allowed to mix .data and .data.unlikely symbols to its pleasure, while .data.unlikely symbols (at least in my case) are not 4 bytes multiples.
Obviously, the mixing of .data.unlikely with the normal .data sections is undesirable - that looks like it's come from commit b67067f1176d ("kbuild: allow archs to select link dead code/data elimination") dated 2016, which according to git describe --contains was merged in v4.9-rc1. So it's unlikely to be directly caused by this, although this commit is implicated.
I wonder if Nick realised this side effect (that .data.unlikely is no longer grouped together) - maybe we need to rename .data.unlikely? (Adding Nick and Michal).
Anyway, I think this patch may resolve the problem you're seeing as well
- this should mark the .data sections in the ELF objects as requiring a 32-bit alignment - if you check with objdump -h, you should see the "Algn" column for the .data section change from "2**0" to "2**2", which should cause the linker to apply the appropriate alignment to the files .data section.
We will have to ensure that all new .data statements have an appropriate .align directive after them if the data requires alignment.
arch/arm/kernel/entry-armv.S | 2 ++ arch/arm/kernel/head.S | 2 ++ arch/arm/kernel/hyp-stub.S | 1 + arch/arm/kernel/iwmmxt.S | 1 + arch/arm/kernel/sleep.S | 1 + arch/arm/mm/cache-v4wb.S | 1 + arch/arm/mm/proc-xscale.S | 1 + 7 files changed, 9 insertions(+)
arch/arm/kernel/entry-armv.S +2 -0
@@ -721,6 +721,7 @@ ENDPROC(__und_usr) */ .pushsection .data + .align 2 ENTRY(fp_enter) .word no_fp .popsection
@@ -1026,6 +1027,7 @@ ENDPROC(vector_\name) W(b) vector_fiq .data + .align 2 .globl cr_alignment cr_alignment:
arch/arm/kernel/head.S +2 -0
@@ -556,6 +556,7 @@ ENDPROC(__fixup_smp) .word __smpalt_end .pushsection .data + .align 2 .globl smp_on_up smp_on_up: ALT_SMP(.long 1)
@@ -716,6 +717,7 @@ ENTRY(fixup_pv_table) ENDPROC(fixup_pv_table) .data + .align 2 .globl __pv_phys_pfn_offset .type __pv_phys_pfn_offset, %object __pv_phys_pfn_offset:
arch/arm/kernel/hyp-stub.S +1 -0
@@ -31,6 +31,7 @@ * zeroing of .bss would clobber it. */ .data + .align 2 ENTRY(__boot_cpu_mode) .long 0 .text
arch/arm/kernel/iwmmxt.S +1 -0
@@ -367,6 +367,7 @@ ENTRY(iwmmxt_task_release) ENDPROC(iwmmxt_task_release) .data + .align 2 concan_owner: .word 0
arch/arm/kernel/sleep.S +1 -0
@@ -171,6 +171,7 @@ ENDPROC(cpu_resume_arm) .long mpidr_hash - . @ mpidr_hash struct offset .data + .align 2 .type sleep_save_sp, #object ENTRY(sleep_save_sp) .space SLEEP_SAVE_SP_SZ @ struct sleep_save_sp
arch/arm/mm/cache-v4wb.S +1 -0
@@ -47,6 +47,7 @@ #define CACHE_DLIMIT (CACHE_DSIZE * 4) .data + .align 2 flush_base: .long FLUSH_BASE .text
arch/arm/mm/proc-xscale.S +1 -0
@@ -104,6 +104,7 @@ .endm .data + .align 2 clean_addr: .word CLEAN_ADDR .text
Signature · 3 lines
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net.
Quoted 36 lines · On Wed, 26 Jul 2017 12:41:39 +0100 Russell King - ARM Linux…
Quoted 23 lines · Robert Jarzmik
Quoted 11 lines · Robert Jarzmik
Sure, it like this :
c06f22c8Duser_pmd_tablec06f22ccd __warned.19178c06f22cddclean_addrAnd I have no idea how to link that __warned.19178 with the
WARN_xxx()statement ...This bisection I made points me to :
# first bad commit: [799c43415442414b1032580c47684cb709dfed6d] kbuild: thin archives make default for all archsReverting this commit makes my kernel boot again.
Hi Russell,
I think I know where this is comming from.
- in file:~/mio_linux/kernel/include/asm-generic/vmlinux.lds.h:206
- the definition ofDATA_DATAlooks like :(*.data .data.[0-9a-zA-Z_]*) ... *(.data.unlikely) ...Quoted 4 lines
This doesn't look good to me, as .data.unlikely fullfills the first wildcard, and the linker is allowed to mix .data and .data.unlikely symbols to its pleasure, while .data.unlikely symbols (at least in my case) are not 4 bytes multiples.
Obviously, the mixing of .data.unlikely with the normal .data sections is undesirable - that looks like it's come from commit
b67067f1176d("kbuild: allow archs to select link dead code/data elimination") dated 2016, which according to git describe --contains was merged in v4.9-rc1. So it's unlikely to be directly caused by this, although this commit is implicated.
Quoted 3 lines
I wonder if Nick realised this side effect (that .data.unlikely is no longer grouped together) - maybe we need to rename .data.unlikely? (Adding Nick and Michal).
I did to some degree -- hence TEXT was not done that way -- but obviously did not look closely enough.
The right short term fix I think is to make those wildcards depend only on CONFIG_LD_DEAD_CODE_DATA_ELIMINATION.
One way to avoid clashes with compiler generated section names is to use ".." as separators in our section names.
Anyway I'll code up a fix for the linker script that we can get into 4.12, thanks for pointing it out.
Thanks,
Nick
Quoted 16 lines · Nicholas Piggin
Quoted 10 lines · On Wed, 26 Jul 2017 12:41:39 +0100 Russell King - ARM Linux…
Obviously, the mixing of .data.unlikely with the normal .data sections is undesirable - that looks like it's come from commit
b67067f1176d("kbuild: allow archs to select link dead code/data elimination") dated 2016, which according to git describe --contains was merged in v4.9-rc1. So it's unlikely to be directly caused by this, although this commit is implicated.I wonder if Nick realised this side effect (that .data.unlikely is no longer grouped together) - maybe we need to rename .data.unlikely? (Adding Nick and Michal).
I did to some degree -- hence TEXT was not done that way -- but obviously did not look closely enough.
Quoted 8 lines
The right short term fix I think is to make those wildcards depend only on
CONFIG_LD_DEAD_CODE_DATA_ELIMINATION.One way to avoid clashes with compiler generated section names is to use ".." as separators in our section names.
Anyway I'll code up a fix for the linker script that we can get into 4.12, thanks for pointing it out.
Ok, cool. I'd like to be copied to your patch so that I can test it please.
For what is worth, your patch, Russell, fixes the issue as well, I just tested it.
Cheers.
Signature · 1 line
Robert
Quoted 21 lines · On Wed, 26 Jul 2017 23:02:46 +0200 Robert Jarzmik <[email protected]>…
Quoted 19 lines · Nicholas Piggin
Quoted 10 lines · On Wed, 26 Jul 2017 12:41:39 +0100 Russell King - ARM Linux…
Obviously, the mixing of .data.unlikely with the normal .data sections is undesirable - that looks like it's come from commit
b67067f1176d("kbuild: allow archs to select link dead code/data elimination") dated 2016, which according to git describe --contains was merged in v4.9-rc1. So it's unlikely to be directly caused by this, although this commit is implicated.I wonder if Nick realised this side effect (that .data.unlikely is no longer grouped together) - maybe we need to rename .data.unlikely? (Adding Nick and Michal).
I did to some degree -- hence TEXT was not done that way -- but obviously did not look closely enough.
The right short term fix I think is to make those wildcards depend only on
CONFIG_LD_DEAD_CODE_DATA_ELIMINATION.
Quoted 6 lines
Quoted 5 lines
One way to avoid clashes with compiler generated section names is to use ".." as separators in our section names.
Anyway I'll code up a fix for the linker script that we can get into 4.12, thanks for pointing it out.
Ok, cool. I'd like to be copied to your patch so that I can test it please.
Hmm, I intended to cc you, but somehow failed that too. No wonder my code has bugs :\
It's gone to linux-kbuild and linux-arm-kernel
http://marc.info/?l=linux-kbuild&m=150107320226315&q=raw
Or msg me privately I'll resend it to you.
Thanks,
Nick
Robert Jarzmik
Tested-byQuoted 6 lines · Nicholas Piggin
Hmm, I intended to cc you, but somehow failed that too. No wonder my code has bugs :\
It's gone to linux-kbuild and linux-arm-kernel
I verified your patch, it works. Could you please add :
...
Cheers.
Signature · 1 line
Robert
Russell King - ARM Linux
maintainerQuoted 2 lines · Robert Jarzmik
For what is worth, your patch, Russell, fixes the issue as well, I just tested it.
Shall I take that as permission to add a Tested-by line to the patch?
Signature · 3 lines
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up According to speedtest.net: 8.21Mbps down 510kbps up
Robert Jarzmik
Tested-byQuoted 5 lines · Russell King - ARM Linux
Quoted 2 lines · Robert Jarzmik
For what is worth, your patch, Russell, fixes the issue as well, I just tested it.
Shall I take that as permission to add a Tested-by line to the patch?
Most certainly.
Cheers.
Signature · 1 line
Robert