Skip to contentSkip to conversation

Panic in arch_hw_breakpoint_init() on Cortex-A9 (SPEAr1340)

DISCUSSION Lubomir Rintel 3 participants 5 messages Apr 18, 2017 – May 10, 2022

lore
Share & tools
lore
#0 lore raw

Hi,

I'm getting a crash that looks awfully lot like what ddc37832a1 [ARM:
8634/1: hw_breakpoint: blacklist Scorpion CPUs] aims to fix.

My hardware doesn't use a Scorpion CPU though -- it uses a Cortex-A9 (cpuid=0x412fc091).

[????0.157000] Internal error: Oops - undefined instruction: 0 [#1] SMP ARM
[????0.157000] Modules linked in:
[????0.157000] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.11.0-0.rc3.git0.2.spear2.fc26.armv7hl #1 [????0.157000] Hardware name: ST SPEAr1340 SoC with Flattened Device Tree
[????0.157000] task: ef102b80 task.stack: ef0fa000
[????0.157000] PC is at arch_hw_breakpoint_init+0x130/0x2a0
[????0.157000] LR is at arch_hw_breakpoint_init+0x7c/0x2a0
[????0.157000] pc : [<c0e0538c>]????lr : [<c0e052d8>]????psr: 60000013
[????0.157000] sp : ef0fbee8??ip : 00000000??fp : 00000000
[????0.157000] r10: c0ea183c??r9 : c0f24814??r8 : 00000000
[????0.157000] r7 : 000000e4??r6 : c0ea1828??r5 : c112e488??r4 : c112e488
[????0.157000] r3 : 0000000f??r2 : 510002d0??r1 : 2e7a7000??r0 : 00000003
[????0.157000] Flags: nZCv??IRQs on??FIQs on??Mode SVC_32??ISA ARM??Segment none
[????0.157000] Control: 10c5387d??Table: 0020404a??DAC: 00000051
[????0.157000] Process swapper/0 (pid: 1, stack limit = 0xef0fa220)
[????0.157000] Stack: (0xef0fbee8 to 0xef0fc000)
[????0.157000] bee0:???????????????????c0c7e6c6 ef182234 00000000 54410001 00000000 c0e0525c [????0.157000] bf00: ffffe000 c0ea1828 000000e4 c0301e08 c112d980 00000000 c0ea1800 c036ab70 [????0.157000] bf20: efffcd92 c036ab70 efffcd92 c036ab70 00000003 00000001 c0d9a670 000000e4 [????0.157000] bf40: 00000003 00000003 c0d9a710 c0d9a710 c10359ac 00000004 00000004 c112d980 [????0.157000] bf60: c0ea1828 000000e4 c112d980 c0ea183c 00000000 c0e00ec0 00000003 00000003 [????0.157000] bf80: 00000000 c0e005c0 00000000 c0a33600 00000000 00000000 00000000 00000000 [????0.157000] bfa0: 00000000 c0a33610 00000000 c0307ef8 00000000 00000000 00000000 00000000 [????0.157000] bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [????0.157000] bfe0: 00000000 00000000 00000000 00000000 00000013 00000000 ffffffff ffffffff [????0.157000] [<c0e0538c>] (arch_hw_breakpoint_init) from [<c0301e08>] (do_one_initcall+0x12c/0x154) [????0.157000] [<c0301e08>] (do_one_initcall) from [<c0e00ec0>] (kernel_init_freeable+0x218/0x264) [????0.157000] [<c0e00ec0>] (kernel_init_freeable) from [<c0a33610>] (kernel_init+0x10/0x114) [????0.157000] [<c0a33610>] (kernel_init) from [<c0307ef8>] (ret_from_fork+0x14/0x3c) [????0.157000] Code: e1a00004 ebd52503 ebd522fa eaffffc5 (ee110e91)
[????0.157000] ---[ end trace dc9bbf347b3b7b44 ]---
[????0.158000] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b [????0.158000]
[????0.158000] CPU1: stopping
[????0.158000] CPU: 1 PID: 0 Comm: swapper/1 Tainted: G??????D?????????4.11.0-0.rc3.git0.2.spear2.fc26.armv7hl #1 [????0.158000] Hardware name: ST SPEAr1340 SoC with Flattened Device Tree
[????0.158000] [<c03117a0>] (unwind_backtrace) from [<c030c4d0>] (show_stack+0x18/0x1c) [????0.158000] [<c030c4d0>] (show_stack) from [<c063a044>] (dump_stack+0x80/0xa0) [????0.158000] [<c063a044>] (dump_stack) from [<c030f578>] (handle_IPI+0x154/0x29c) [????0.158000] [<c030f578>] (handle_IPI) from [<c03017ec>] (gic_handle_irq+0x7c/0x84) [????0.158000] [<c03017ec>] (gic_handle_irq) from [<c0a3978c>] (__irq_svc+0x6c/0x90) [????0.158000] Exception stack(0xef12df80 to 0xef12dfc8)
[????0.158000] df80: 00000001 00000000 00000000 c031c800 00000000 00000000 ffffe000 c1004df4 [????0.158000] dfa0: c1004e58 412fc091 00000000 00000000 00000001 ef12dfd0 c0308988 c0308978 [????0.158000] dfc0: 60000013 ffffffff
[????0.158000] [<c0a3978c>] (__irq_svc) from [<c0308978>] (arch_cpu_idle+0x24/0x40) [????0.158000] [<c0308978>] (arch_cpu_idle) from [<c0391a54>] (do_idle+0xfc/0x1d8) [????0.158000] [<c0391a54>] (do_idle) from [<c0391d84>] (cpu_startup_entry+0x20/0x24) [????0.158000] [<c0391d84>] (cpu_startup_entry) from [<00301a2c>] (0x301a2c)
[????0.158000] Rebooting in 10 seconds..

Lubo

#1 lore raw
Quoted 1 line · Lubomir Rintel

Hi,

Hi,

Quoted 2 lines

I'm getting a crash that looks awfully lot like what ddc37832a1 [ARM:
8634/1: hw_breakpoint: blacklist Scorpion CPUs] aims to fix.

Just to check, have you successfully booted a kernel on this board before? i.e. is this a new crash?

Quoted 11 lines

My hardware doesn't use a Scorpion CPU though -- it uses a Cortex-A9 (cpuid=0x412fc091).

[????0.157000] Internal error: Oops - undefined instruction: 0 [#1] SMP ARM [????0.157000] Modules linked in:
[????0.157000] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.11.0-0.rc3.git0.2.spear2.fc26.armv7hl #1 [????0.157000] Hardware name: ST SPEAr1340 SoC with Flattened Device Tree [????0.157000] task: ef102b80 task.stack: ef0fa000
[????0.157000] PC is at arch_hw_breakpoint_init+0x130/0x2a0
[????0.157000] LR is at arch_hw_breakpoint_init+0x7c/0x2a0
[????0.157000] pc : [<c0e0538c>]????lr : [<c0e052d8>]????psr: 60000013

It would be helpful to know which specific access that is.

Can you figure that out with addr2line, e.g.

 $ addr2line -ife vmlinux c0e0538c

Thanks,
Mark

#2 lore raw
Quoted 10 lines · Mark Rutland
Quoted 1 line · Lubomir Rintel

Hi,

Hi,

Quoted 2 lines

I'm getting a crash that looks awfully lot like what ddc37832a1 [ARM:
8634/1: hw_breakpoint: blacklist Scorpion CPUs] aims to fix.

Just to check, have you successfully booted a kernel on this board before? i.e. is this a new crash?

I've now checked, and it doesn't seem like it ever worked when PERF_EVENTS (and in turn HAVE_HW_BREAKPOINT) is enabled. The crash look the same up to 4.7; the previous versions also crash as soon as I enable the options but for some reason I don't get an oops on the console even with earlyprintk enabled (the machine reboots with panic= argument, so there's just possibly just something wrong with the console).

Quoted 12 lines
Quoted 11 lines

My hardware doesn't use a Scorpion CPU though -- it uses a Cortex-A9 (cpuid=0x412fc091).

[????0.157000] Internal error: Oops - undefined instruction: 0 [#1] SMP ARM [????0.157000] Modules linked in:
[????0.157000] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.11.0-0.rc3.git0.2.spear2.fc26.armv7hl #1 [????0.157000] Hardware name: ST SPEAr1340 SoC with Flattened Device Tree [????0.157000] task: ef102b80 task.stack: ef0fa000
[????0.157000] PC is at arch_hw_breakpoint_init+0x130/0x2a0
[????0.157000] LR is at arch_hw_breakpoint_init+0x7c/0x2a0
[????0.157000] pc : [<c0e0538c>]????lr : [<c0e052d8>]????psr: 60000013

Quoted 5 lines

It would be helpful to know which specific access that is.

Can you figure that out with addr2line, e.g.

?$ addr2line -ife vmlinux c0e0538c

Internal error: Oops - undefined instruction: 0 [#1] SMP ARM
Modules linked in:
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.11.0-rc7 #21
Hardware name: ST SPEAr1340 SoC with Flattened Device Tree
task: ef058000 task.stack: ef04c000
PC is at arch_hw_breakpoint_init+0x9c/0x2a4
LR is at arch_hw_breakpoint_init+0x84/0x2a4
pc : [<c0905504>]????lr : [<c09054ec>]????psr: 60000013
$ addr2line -ife vmlinux c0905504
core_has_os_save_restore
/home/lkundrak/spear/linux/arch/arm/kernel/hw_breakpoint.c:920
arch_hw_breakpoint_init
/home/lkundrak/spear/linux/arch/arm/kernel/hw_breakpoint.c:1082
Quoted 3 lines

Thanks,
Mark

#3 lore raw
Quoted 8 lines · Lubomir Rintel
Quoted 6 lines · Mark Rutland
Quoted 2 lines · Lubomir Rintel

I'm getting a crash that looks awfully lot like what ddc37832a1 [ARM:
8634/1: hw_breakpoint: blacklist Scorpion CPUs] aims to fix.

Just to check, have you successfully booted a kernel on this board before? i.e. is this a new crash?

Quoted 7 lines

I've now checked, and it doesn't seem like it ever worked when PERF_EVENTS (and in turn HAVE_HW_BREAKPOINT) is enabled. The crash look the same up to 4.7; the previous versions also crash as soon as I enable the options but for some reason I don't get an oops on the console even with earlyprintk enabled (the machine reboots with panic= argument, so there's just possibly just something wrong with the console).

Ok. So this isn't a recent regression.

Quoted 27 lines
Quoted 12 lines
Quoted 11 lines

My hardware doesn't use a Scorpion CPU though -- it uses a Cortex-A9 (cpuid=0x412fc091).

[????0.157000] Internal error: Oops - undefined instruction: 0 [#1] SMP ARM [????0.157000] Modules linked in:
[????0.157000] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.11.0-0.rc3.git0.2.spear2.fc26.armv7hl #1 [????0.157000] Hardware name: ST SPEAr1340 SoC with Flattened Device Tree [????0.157000] task: ef102b80 task.stack: ef0fa000
[????0.157000] PC is at arch_hw_breakpoint_init+0x130/0x2a0
[????0.157000] LR is at arch_hw_breakpoint_init+0x7c/0x2a0
[????0.157000] pc : [<c0e0538c>]????lr : [<c0e052d8>]????psr: 60000013

Quoted 5 lines

It would be helpful to know which specific access that is.

Can you figure that out with addr2line, e.g.

?$ addr2line -ife vmlinux c0e0538c

Internal error: Oops - undefined instruction: 0 [#1] SMP ARM
Modules linked in:
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.11.0-rc7 #21
Hardware name: ST SPEAr1340 SoC with Flattened Device Tree
task: ef058000 task.stack: ef04c000
PC is at arch_hw_breakpoint_init+0x9c/0x2a4
LR is at arch_hw_breakpoint_init+0x84/0x2a4
pc : [<c0905504>]????lr : [<c09054ec>]????psr: 60000013
Quoted 3 lines
$ addr2line -ife vmlinux c0905504
core_has_os_save_restore
/home/lkundrak/spear/linux/arch/arm/kernel/hw_breakpoint.c:920

That's a read of DBGOSLSR, which shouldn't UNDEF.

I suspect this is a result of Cortex-A9 erratum 764319, which causes DBGOSLSR to unexpectedly behave as UNDEF when the external DBGSWENABLE pin is wired to 0.

The official workaround is to ensure that the DBGSWENABLE pin is wired to 1.

It might be possible to handle the trap and bail out, but it's not clear to me if we can safely assume that other functionality is available.

Thanks,
Mark.

#4 lore raw
Quoted 13 lines · Mark Rutland
Quoted 5 lines · Lubomir Rintel
Quoted 1 line · Mark Rutland

On Tue, Apr 18, 2017 at 12:44:28PM +0200, Lubomir Rintel wrote:

$ addr2line -ife vmlinux c0905504
core_has_os_save_restore
/home/lkundrak/spear/linux/arch/arm/kernel/hw_breakpoint.c:920

That's a read of DBGOSLSR, which shouldn't UNDEF.

I suspect this is a result of Cortex-A9 erratum 764319, which causes DBGOSLSR to unexpectedly behave as UNDEF when the external DBGSWENABLE pin is wired to 0.

Quoted 5 lines

The official workaround is to ensure that the DBGSWENABLE pin is wired to 1.

It might be possible to handle the trap and bail out, but it's not clear to me if we can safely assume that other functionality is available.

I searched for 764319 as Nick posted a patch for an errata workaround recently. If this problem still exists on the SPEAr1340, maybe the same patch will fix it. See [1] for the initial proposal that worked for Nick. I think there is a better way to do it, but either way it should address other platforms as well.

Arnd

[1] https://lore.kernel.org/lkml/[email protected]/

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel