Wang Nan
f094446390
coresight: fix kernel panic caused by invalid CPU
Commit d52c9750f150 ("coresight: reset "enable_sink" flag when need be")
caused a kernel panic because of the using of an invalid value: after
'for_each_cpu(cpu, mask)', value of local variable 'cpu' become invalid,
causes following 'cpu_to_node' access invalid memory area.
This patch brings the deleted 'cpu = cpumask_first(mask)' back.
Panic log:
$ perf record -e cs_etm// ls
Unable to handle kernel paging request at virtual address fffe801804af4f10
pgd = ffff8017ce031600
[fffe801804af4f10] *pgd=0000000000000000, *pud=0000000000000000
Internal error: Oops: 96000004 [#1] SMP
Modules linked in:
CPU: 33 PID: 1619 Comm: perf Not tainted 4.7.1+ #16
Hardware name: Huawei Taishan 2280 /CH05TEVBA, BIOS 1.10 11/24/2016
task: ffff8017cb0c8400 ti: ffff8017cb154000 task.ti: ffff8017cb154000
PC is at tmc_alloc_etf_buffer+0x60/0xd4
LR is at tmc_alloc_etf_buffer+0x44/0xd4
pc : [<ffff000008633df8>] lr : [<ffff000008633ddc>] pstate: 60000145
sp : ffff8017cb157b40
x29: ffff8017cb157b40 x28: 0000000000000000
...skip...
7a60: ffff000008c64dc8 0000000000000006 0000000000000253 ffffffffffffffff
7a80: 0000000000000000 0000000000000000 ffff0000080872cc 0000000000000001
[<ffff000008633df8>] tmc_alloc_etf_buffer+0x60/0xd4
[<ffff000008632b9c>] etm_setup_aux+0x1dc/0x1e8
[<ffff00000816eed4>] rb_alloc_aux+0x2b0/0x338
[<ffff00000816a5e4>] perf_mmap+0x414/0x568
[<ffff0000081ab694>] mmap_region+0x324/0x544
[<ffff0000081abbe8>] do_mmap+0x334/0x3e0
[<ffff000008191150>] vm_mmap_pgoff+0xa4/0xc8
[<ffff0000081a9a30>] SyS_mmap_pgoff+0xb0/0x22c
[<ffff0000080872e4>] sys_mmap+0x18/0x28
[<ffff0000080843f0>] el0_svc_naked+0x24/0x28
Code: 912040a5 d0001c00 f873d821 911c6000 (b8656822)
---[ end trace 98933da8f92b0c9a ]---
Signed-off-by: Wang Nan <wangnan0@huawei.com>
Cc: Xia Kaixu <xiakaixu@huawei.com>
Cc: Li Zefan <lizefan@huawei.com>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Fixes: d52c9750f150 ("coresight: reset "enable_sink" flag when need be")
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: stable <stable@vger.kernel.org> # 4.10
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-25 11:46:42 +01:00
..
2017-01-06 14:36:30 +01:00
2016-12-13 15:30:50 -08:00
2016-12-24 11:46:01 -08:00
2017-01-11 09:27:30 +01:00
2017-01-14 14:09:03 +01:00
2017-01-14 17:07:04 -08:00
2016-12-16 10:24:44 -08:00
2016-12-25 10:47:44 +01:00
2016-12-24 11:46:01 -08:00
2017-01-25 11:41:44 +01:00
2017-01-06 15:35:27 -08:00
2016-12-25 14:30:04 -08:00
2017-01-06 14:34:52 +01:00
2016-12-24 11:46:01 -08:00
2016-12-27 17:51:36 -08:00
2016-12-18 15:49:10 -08:00
2017-01-03 00:21:45 +01:00
2016-12-24 11:46:01 -08:00
2017-01-13 12:14:28 +05:30
2016-12-24 11:46:01 -08:00
2017-01-25 15:03:54 +09:00
2017-01-15 10:54:39 -08:00
2016-12-30 09:11:21 +01:00
2017-01-09 09:47:19 +10:00
2017-01-11 21:55:35 +01:00
2017-01-20 14:53:34 +01:00
2017-01-02 10:15:28 -08:00
2017-01-25 11:46:42 +01:00
2017-01-12 20:52:12 +01:00
2016-12-24 11:46:01 -08:00
2016-12-13 10:41:53 -08:00
2017-01-02 16:59:44 +01:00
2016-12-29 14:17:40 -05:00
2017-01-13 11:49:34 -08:00
2017-01-06 10:49:36 -08:00
2016-12-25 14:30:04 -08:00
2016-12-24 11:46:01 -08:00
2016-12-25 10:47:44 +01:00
2016-12-24 11:46:01 -08:00
2016-12-13 12:11:01 -08:00
2016-12-24 11:46:01 -08:00
2016-12-25 17:21:22 +01:00
2017-01-09 13:58:10 -08:00
2016-12-25 17:21:22 +01:00
2017-01-19 12:42:25 +01:00
2016-12-13 10:19:16 -08:00
2016-12-24 11:46:01 -08:00
2016-12-19 08:16:26 -08:00
2017-01-25 11:41:44 +01:00
2016-12-24 11:46:01 -08:00
2016-12-24 11:46:01 -08:00
2017-01-11 11:15:15 -08:00
2016-12-23 16:11:07 -05:00
2016-12-24 11:46:01 -08:00
2016-12-18 15:49:10 -08:00
2017-01-13 15:17:04 -07:00
2017-01-04 18:22:47 +01:00
2016-12-15 12:46:48 -08:00
2016-12-24 11:46:01 -08:00
2016-12-24 11:46:01 -08:00
2016-12-24 11:46:01 -08:00
2016-12-25 17:21:22 +01:00
2016-12-12 18:55:06 -08:00
2016-12-25 10:47:44 +01:00
2016-12-14 10:49:33 -08:00
2016-12-30 14:27:42 +01:00
2016-12-28 12:38:10 +02:00
2016-12-24 11:46:01 -08:00
2016-12-25 17:21:22 +01:00
2016-12-12 19:56:15 -08:00
2016-12-15 11:45:13 -08:00
2016-12-19 08:16:26 -08:00
2016-12-30 03:26:31 -08:00
2016-12-15 16:03:25 -08:00
2016-12-30 03:12:11 -08:00
2016-12-25 17:21:22 +01:00
2016-12-25 17:21:22 +01:00
2016-12-24 11:46:01 -08:00
2017-01-14 17:07:04 -08:00
2016-12-12 18:55:08 -08:00
2016-12-16 09:26:42 -08:00
2016-12-14 20:42:45 -08:00
2017-01-03 17:11:50 +01:00
2017-01-10 08:41:30 -08:00
2016-12-13 10:41:53 -08:00
2016-12-13 12:11:01 -08:00
2017-01-11 09:22:54 +01:00
2016-12-10 14:57:58 +01:00
2017-01-12 18:17:38 +01:00
2017-01-13 08:23:33 -07:00
2016-12-16 10:24:44 -08:00
2017-01-04 12:58:45 +01:00
2016-12-16 00:13:39 +02:00
2017-01-25 11:41:44 +01:00
2016-12-24 11:27:45 -08:00
2017-01-06 10:53:21 -08:00
2016-12-24 11:46:01 -08:00