Commit 029f410
ANDROID: ARM64: smp: disable preempt in backtracing across all cores
We use IPI instead of NMI in ARM64 to get backtrace of all CPUs.
However, smp_processor_id expects preempt disabled, and this leads to
a kernel BUG seen as below:
c3 19299 SysRq : Show backtrace of all active CPUs
c3 19299 BUG: using smp_processor_id() in preemptible [00000000] code: sh/19299
c3 19299 caller is debug_smp_processor_id+0x1c/0x24
c3 19299 CPU: 3 PID: 19299 Comm: sh Tainted: G W 3.18.31-gb1be511 #1
c3 19299 Hardware name: HTC Corporation. MSM8996pro + PMI8996 Sailfish XB (DT)
c3 19299 Call trace:
c3 19299 [<ffffffc00008aab4>] dump_backtrace+0x0/0x23c
c3 19299 [<ffffffc00008ad04>] show_stack+0x14/0x1c
c3 19299 [<ffffffc000e29f38>] dump_stack+0x80/0xa4
c3 19299 [<ffffffc0003147a4>] check_preemption_disabled+0xe0/0x104
c3 19299 [<ffffffc0003147e4>] debug_smp_processor_id+0x1c/0x24
c3 19299 [<ffffffc000092b24>] arch_trigger_all_cpu_backtrace+0x18/0xdc
c3 19299 [<ffffffc00048dd64>] sysrq_handle_showallcpus+0xc/0x14
c3 19299 [<ffffffc00048e33c>] __handle_sysrq+0x9c/0x154
c3 19299 [<ffffffc00048e724>] write_sysrq_trigger+0x54/0x68
c3 19299 [<ffffffc0001f9c54>] proc_reg_write+0x68/0x84
c3 19299 [<ffffffc0001a6e0c>] vfs_write+0xbc/0x18c
c3 19299 [<ffffffc0001a6fd4>] SyS_write+0x54/0xa4
c3 19299 Backtrace for cpu 3 (current):
c3 19299 CPU: 3 PID: 19299 Comm: sh Tainted: G W 3.18.31-gb1be511 #1
c3 19299 Hardware name: HTC Corporation. MSM8996pro + PMI8996 Sailfish XB (DT)
c3 19299 Call trace:
c3 19299 [<ffffffc00008aab4>] dump_backtrace+0x0/0x23c
c3 19299 [<ffffffc00008ad04>] show_stack+0x14/0x1c
c3 19299 [<ffffffc000e29f38>] dump_stack+0x80/0xa4
c3 19299 [<ffffffc000092b70>] arch_trigger_all_cpu_backtrace+0x64/0xdc
c3 19299 [<ffffffc00048dd64>] sysrq_handle_showallcpus+0xc/0x14
c3 19299 [<ffffffc00048e33c>] __handle_sysrq+0x9c/0x154
c3 19299 [<ffffffc00048e724>] write_sysrq_trigger+0x54/0x68
c3 19299 [<ffffffc0001f9c54>] proc_reg_write+0x68/0x84
c3 19299 [<ffffffc0001a6e0c>] vfs_write+0xbc/0x18c
c3 19299 [<ffffffc0001a6fd4>] SyS_write+0x54/0xa4
c3 19299
c3 19299 sending IPI to all other CPUs:
c3 19299 BUG: using smp_processor_id() in preemptible [00000000] code: sh/19299
c3 19299 caller is debug_smp_processor_id+0x1c/0x24
c3 19299 CPU: 3 PID: 19299 Comm: sh Tainted: G W 3.18.31-gb1be511 #1
c3 19299 Hardware name: HTC Corporation. MSM8996pro + PMI8996 Sailfish XB (DT)
c3 19299 Call trace:
c3 19299 [<ffffffc00008aab4>] dump_backtrace+0x0/0x23c
c3 19299 [<ffffffc00008ad04>] show_stack+0x14/0x1c
c3 19299 [<ffffffc000e29f38>] dump_stack+0x80/0xa4
c3 19299 [<ffffffc0003147a4>] check_preemption_disabled+0xe0/0x104
c3 19299 [<ffffffc0003147e4>] debug_smp_processor_id+0x1c/0x24
c3 19299 [<ffffffc000327d24>] gic_raise_softirq+0x128/0x158
c3 19299 [<ffffffc000092828>] smp_cross_call_common+0x80/0x94
c3 19299 [<ffffffc000092b94>] arch_trigger_all_cpu_backtrace+0x88/0xdc
c3 19299 [<ffffffc00048dd64>] sysrq_handle_showallcpus+0xc/0x14
c3 19299 [<ffffffc00048e33c>] __handle_sysrq+0x9c/0x154
c3 19299 [<ffffffc00048e724>] write_sysrq_trigger+0x54/0x68
c3 19299 [<ffffffc0001f9c54>] proc_reg_write+0x68/0x84
c3 19299 [<ffffffc0001a6e0c>] vfs_write+0xbc/0x18c
c3 19299 [<ffffffc0001a6fd4>] SyS_write+0x54/0xa4
Bug: 35409577
Bug: 34193533
Test: on marlin, trigger sysrq
Change-Id: I0239f388c8ec63f10fc73a32bf8a7deddc408104
Signed-off-by: Wei Wang <[email protected]>
Signed-off-by: ahmedradaideh <[email protected]>1 parent c7e64da commit 029f410
1 file changed
+6
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
617 | 617 | | |
618 | 618 | | |
619 | 619 | | |
620 | | - | |
| 620 | + | |
621 | 621 | | |
622 | 622 | | |
623 | | - | |
| 623 | + | |
| 624 | + | |
624 | 625 | | |
625 | 626 | | |
626 | 627 | | |
627 | 628 | | |
| 629 | + | |
628 | 630 | | |
| 631 | + | |
629 | 632 | | |
630 | 633 | | |
631 | 634 | | |
| |||
637 | 640 | | |
638 | 641 | | |
639 | 642 | | |
| 643 | + | |
640 | 644 | | |
641 | 645 | | |
642 | 646 | | |
| |||
0 commit comments