Jiri Olsa
5aab90ce1e
perf/powerpc: Don't call perf_event_disable() from atomic context
...
The trinity syscall fuzzer triggered following WARN() on powerpc:
WARNING: CPU: 9 PID: 2998 at arch/powerpc/kernel/hw_breakpoint.c:278
...
NIP [c00000000093aedc] .hw_breakpoint_handler+0x28c/0x2b0
LR [c00000000093aed8] .hw_breakpoint_handler+0x288/0x2b0
Call Trace:
[c0000002f7933580] [c00000000093aed8] .hw_breakpoint_handler+0x288/0x2b0 (unreliable)
[c0000002f7933630] [c0000000000f671c] .notifier_call_chain+0x7c/0xf0
[c0000002f79336d0] [c0000000000f6abc] .__atomic_notifier_call_chain+0xbc/0x1c0
[c0000002f7933780] [c0000000000f6c40] .notify_die+0x70/0xd0
[c0000002f7933820] [c00000000001a74c] .do_break+0x4c/0x100
[c0000002f7933920] [c0000000000089fc] handle_dabr_fault+0x14/0x48
Followed by a lockdep warning:
===============================
[ INFO: suspicious RCU usage. ]
4.8.0-rc5+ #7 Tainted: G W
-------------------------------
./include/linux/rcupdate.h:556 Illegal context switch in RCU read-side critical section!
other info that might help us debug this:
rcu_scheduler_active = 1, debug_locks = 0
2 locks held by ls/2998:
#0 : (rcu_read_lock){......}, at: [<c0000000000f6a00>] .__atomic_notifier_call_chain+0x0/0x1c0
#1 : (rcu_read_lock){......}, at: [<c00000000093ac50>] .hw_breakpoint_handler+0x0/0x2b0
stack backtrace:
CPU: 9 PID: 2998 Comm: ls Tainted: G W 4.8.0-rc5+ #7
Call Trace:
[c0000002f7933150] [c00000000094b1f8] .dump_stack+0xe0/0x14c (unreliable)
[c0000002f79331e0] [c00000000013c468] .lockdep_rcu_suspicious+0x138/0x180
[c0000002f7933270] [c0000000001005d8] .___might_sleep+0x278/0x2e0
[c0000002f7933300] [c000000000935584] .mutex_lock_nested+0x64/0x5a0
[c0000002f7933410] [c00000000023084c] .perf_event_ctx_lock_nested+0x16c/0x380
[c0000002f7933500] [c000000000230a80] .perf_event_disable+0x20/0x60
[c0000002f7933580] [c00000000093aeec] .hw_breakpoint_handler+0x29c/0x2b0
[c0000002f7933630] [c0000000000f671c] .notifier_call_chain+0x7c/0xf0
[c0000002f79336d0] [c0000000000f6abc] .__atomic_notifier_call_chain+0xbc/0x1c0
[c0000002f7933780] [c0000000000f6c40] .notify_die+0x70/0xd0
[c0000002f7933820] [c00000000001a74c] .do_break+0x4c/0x100
[c0000002f7933920] [c0000000000089fc] handle_dabr_fault+0x14/0x48
While it looks like the first WARN() is probably valid, the other one is
triggered by disabling event via perf_event_disable() from atomic context.
The event is disabled here in case we were not able to emulate
the instruction that hit the breakpoint. By disabling the event
we unschedule the event and make sure it's not scheduled back.
But we can't call perf_event_disable() from atomic context, instead
we need to use the event's pending_disable irq_work method to disable it.
Reported-by: Jan Stancek <jstancek@redhat.com >
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Arnaldo Carvalho de Melo <acme@redhat.com >
Cc: Huang Ying <ying.huang@intel.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: Linus Torvalds <torvalds@linux-foundation.org >
Cc: Michael Neuling <mikey@neuling.org >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Thomas Gleixner <tglx@linutronix.de >
Link: http://lkml.kernel.org/r/20161026094824.GA21397@krava
Signed-off-by: Ingo Molnar <mingo@kernel.org >
2016-10-28 11:06:25 +02:00
..
2016-10-12 11:01:37 -07:00
2016-10-05 10:11:24 -07:00
2016-09-22 10:01:21 +02:00
2016-10-03 16:13:50 +02:00
2016-05-09 16:18:37 +02:00
2016-09-15 21:15:40 +05:30
2016-09-10 16:48:46 +05:30
2016-09-01 14:23:39 -07:00
2016-10-11 15:06:33 -07:00
2016-06-28 00:38:53 +02:00
2016-04-14 14:03:25 +02:00
2016-09-14 20:42:03 +02:00
2016-07-15 14:50:53 -07:00
2016-09-12 20:32:42 +01:00
2016-07-28 09:34:47 +05:30
2016-10-07 08:35:35 -07:00
2016-10-09 17:04:33 -07:00
2016-10-13 10:13:24 -04:00
2016-10-05 11:34:53 -07:00
2016-10-08 20:56:54 -07:00
2016-09-12 19:59:39 +02:00
2016-07-03 10:55:07 +02:00
2016-10-03 19:43:08 -07:00
2016-09-10 17:31:39 +05:30
2016-06-23 11:18:56 +02:00
2016-10-11 13:22:22 -07:00
2016-09-21 02:08:04 +02:00
2016-10-03 23:22:47 -04:00
2016-10-07 09:45:43 -07:00
2016-09-30 09:13:58 -07:00
2016-07-08 16:23:11 +02:00
2016-08-23 15:46:33 -05:00
2016-09-30 09:14:10 -07:00
2016-10-13 21:28:20 -07:00
2016-09-14 20:37:50 +02:00
2016-08-31 10:06:03 +03:00
2016-09-12 20:32:40 +01:00
2016-10-14 12:50:05 -07:00
2016-09-20 14:35:59 -05:00
2016-06-20 12:47:09 -07:00
2016-09-05 12:41:46 +02:00
2016-04-09 03:12:58 +02:00
2016-08-25 11:26:48 -04:00
2016-07-08 17:01:14 +03:00
2016-09-27 12:54:03 +02:00
2016-07-07 09:16:20 +02:00
2016-06-29 15:18:47 -07:00
2016-10-11 15:06:31 -07:00
2016-10-11 15:06:31 -07:00
2016-08-04 14:19:16 -06:00
2016-08-04 14:19:16 -06:00
2016-05-04 23:41:14 +02:00
2016-07-26 16:19:19 -07:00
2016-05-13 14:01:43 +02:00
2016-07-25 16:51:49 +10:00
2016-09-22 07:48:03 -06:00
2016-09-09 12:09:24 +03:00
2016-08-18 10:44:20 +02:00
2016-10-07 18:46:26 -07:00
2016-09-14 09:18:06 -06:00
2016-10-14 12:18:50 -07:00
2016-09-15 08:42:03 -06:00
2016-10-09 17:32:20 -07:00
2016-09-14 11:48:34 -06:00
2016-06-07 13:41:38 -06:00
2016-09-15 18:29:06 -04:00
2016-10-07 18:46:28 -07:00
2016-09-29 01:35:35 -04:00
2016-09-29 01:35:35 -04:00
2016-07-26 15:03:07 -07:00
2016-09-09 12:09:24 +03:00
2016-08-11 09:41:35 -06:00
2016-08-02 17:31:41 -04:00
2016-08-09 18:47:16 +08:00
2016-08-22 14:05:49 -03:00
2016-08-22 14:00:51 -03:00
2016-04-25 15:45:14 -04:00
2016-10-14 12:18:50 -07:00
2016-09-23 14:44:03 -07:00
2016-07-30 11:20:02 -07:00
2016-04-19 16:54:26 -07:00
2016-06-28 10:19:35 +02:00
2016-10-07 18:46:29 -07:00
2016-09-27 21:20:53 -04:00
2016-10-10 14:51:45 -07:00
2016-10-15 10:03:15 -07:00
2016-06-25 09:04:48 -07:00
2016-10-07 18:46:30 -07:00
2016-08-02 16:11:27 -04:00
2016-05-03 14:59:30 -07:00
2016-08-31 13:05:43 +02:00
2016-10-07 18:46:30 -07:00
2016-10-12 21:01:18 +02:00
2016-10-06 11:19:10 -07:00
2016-07-21 23:29:38 +02:00
2016-08-02 19:35:24 -04:00
2016-05-19 19:12:14 -07:00
2016-05-13 14:01:59 +02:00
2016-10-07 18:46:30 -07:00
2016-07-18 17:35:46 +08:00
2016-10-11 15:06:30 -07:00
2016-09-19 11:24:50 +10:00
2016-09-16 12:44:20 +02:00
2016-09-21 12:13:31 +02:00
2016-07-26 16:19:19 -07:00
2016-04-15 11:20:32 -07:00
2016-09-06 13:08:40 +09:00
2016-05-03 11:20:07 +09:00
2016-09-14 13:56:38 -04:00
2016-09-16 09:34:15 +01:00
2016-06-05 10:36:01 -07:00
2016-06-07 13:41:38 -06:00
2016-06-20 22:26:37 +05:30
2016-09-26 22:16:41 +05:30
2016-09-16 09:34:22 +01:00
2016-10-11 15:06:32 -07:00
2016-08-08 08:11:42 +05:30
2016-06-13 21:43:05 -06:00
2016-06-13 21:43:05 -06:00
2016-06-13 21:43:08 -06:00
2016-08-04 08:50:07 -04:00
2016-09-13 20:21:55 +02:00
2016-07-20 21:35:12 -06:00
2016-05-27 16:03:22 -07:00
2016-05-17 15:48:12 -04:00
2016-07-01 16:37:06 +02:00
2016-04-18 14:45:08 -04:00
2016-10-14 14:26:58 -07:00
2016-10-06 09:07:44 -04:00
2016-08-04 10:16:56 +09:30
2016-09-16 08:53:41 +02:00
2016-09-30 10:05:46 -07:00
2016-10-03 09:11:14 -07:00
2016-05-02 16:24:49 +02:00
2016-10-15 10:03:15 -07:00
2016-08-11 15:33:23 +05:30
2016-08-21 17:43:32 +02:00
2016-05-02 19:49:28 -04:00
2016-09-09 19:36:04 -07:00
2016-08-02 19:35:10 -04:00
2016-07-26 16:19:19 -07:00
2016-10-14 17:23:33 -07:00
2016-06-01 10:29:39 +02:00
2016-10-07 15:15:33 -07:00
2016-04-19 22:04:53 +02:00
2016-10-07 18:46:26 -07:00
2016-09-16 12:44:20 +02:00
2016-09-02 12:47:55 -04:00
2016-10-06 11:48:41 -07:00
2016-10-10 14:51:45 -07:00
2016-05-10 15:43:09 -04:00
2016-07-28 16:07:41 -07:00
2016-05-20 17:58:30 -07:00
2016-05-28 15:48:31 -04:00
2016-08-21 20:12:32 +01:00
2016-09-29 10:40:13 +02:00
2016-08-24 15:58:57 +02:00
2016-07-15 10:41:37 +02:00
2016-10-07 18:46:28 -07:00
2016-05-20 17:58:30 -07:00
2016-05-19 19:12:14 -07:00
2016-10-07 18:46:29 -07:00
2016-08-24 21:04:48 +08:00
2016-09-08 21:34:15 -07:00
2016-10-05 10:11:24 -07:00
2016-09-05 13:52:38 +02:00
2016-08-25 22:11:02 +02:00
2016-07-22 09:07:02 +02:00
2016-09-24 10:48:18 +02:00
2016-07-27 14:20:09 -07:00
2016-06-18 22:11:39 -07:00
2016-06-30 12:06:20 +02:00
2016-07-08 13:23:12 +02:00
2016-09-01 22:48:33 -07:00
2016-05-03 16:00:54 -04:00
2016-09-24 08:01:26 -04:00
2016-10-07 23:50:39 -04:00
2016-09-08 17:10:28 -07:00
2016-05-01 09:23:52 -04:00
2016-09-08 16:13:09 -07:00
2016-09-16 09:18:54 +02:00
2016-10-15 10:03:15 -07:00
2016-07-13 17:27:24 -07:00
2016-09-14 22:11:09 +02:00
2016-05-03 18:23:02 +01:00
2016-05-03 18:23:02 +01:00
2016-08-24 09:43:49 +02:00
2016-10-03 09:53:59 +11:00
2016-09-16 09:34:15 +01:00
2016-05-16 15:12:02 -05:00
2016-09-14 09:18:09 -06:00
2016-04-20 15:42:24 -04:00
2016-08-08 14:42:03 -05:00
2016-07-27 10:24:38 -05:00
2016-09-30 01:54:28 -04:00
2016-09-20 23:20:32 +02:00
2016-05-11 22:37:54 +02:00
2016-09-14 15:28:15 +02:00
2016-07-04 12:26:05 +02:00
2016-06-17 20:47:11 -07:00
2016-05-16 11:14:29 -04:00
2016-06-30 11:40:54 -04:00
2016-10-07 18:46:26 -07:00
2016-10-03 13:22:39 -07:00
2016-05-20 17:58:30 -07:00
2016-10-16 11:02:31 +02:00
2016-06-20 22:42:32 +02:00
2016-07-28 16:07:41 -07:00
2016-10-09 12:23:38 -07:00
2016-07-06 10:34:48 +01:00
2016-10-07 18:46:30 -07:00
2016-08-10 11:23:44 -04:00
2016-10-11 15:06:33 -07:00
2016-04-11 22:44:15 +01:00
2016-04-11 22:44:15 +01:00
2016-07-26 16:19:19 -07:00
2016-10-11 15:06:33 -07:00
2016-07-26 16:19:19 -07:00
2016-10-11 15:06:33 -07:00
2016-10-05 10:11:24 -07:00
2016-09-16 16:57:47 +02:00
2016-07-18 08:46:09 +02:00
2016-06-20 09:43:33 +02:00
2016-09-15 16:49:39 +02:00
2016-09-22 11:50:29 -04:00
2016-09-30 19:13:42 -07:00
2016-09-21 07:57:31 -06:00
2016-09-14 12:57:43 -07:00
2016-08-18 23:41:55 +02:00
2016-09-24 10:48:32 +02:00
2016-09-19 13:42:38 -04:00
2016-09-19 12:27:10 +10:00
2016-09-15 21:13:50 +05:30
2016-06-26 01:20:08 +02:00
2016-09-27 12:33:47 +02:00
2016-06-10 23:24:53 -07:00
2016-04-11 21:15:48 -04:00
2016-10-07 18:46:28 -07:00
2016-10-07 18:46:29 -07:00
2016-07-26 16:19:19 -07:00
2016-09-01 17:52:01 -07:00
2016-05-19 19:12:14 -07:00
2016-07-28 16:07:41 -07:00
2016-07-15 11:53:02 -07:00
2016-07-26 16:19:19 -07:00
2016-08-31 14:12:35 +02:00
2016-07-28 16:07:41 -07:00
2016-10-07 18:46:27 -07:00
2016-10-07 18:46:30 -07:00
2016-08-02 19:35:02 -04:00
2016-07-26 16:19:19 -07:00
2016-04-28 11:44:19 +02:00
2016-09-01 17:52:01 -07:00
2016-06-26 17:14:03 -07:00
2016-08-04 10:16:55 +09:30
2016-09-30 12:46:48 -05:00
2016-07-01 23:45:18 +08:00
2016-09-25 23:41:39 -04:00
2016-09-25 23:41:39 -04:00
2016-09-14 22:11:08 +02:00
2016-07-29 12:17:52 -07:00
2016-10-07 09:20:53 -07:00
2016-08-28 23:32:41 -04:00
2016-06-03 19:37:21 -04:00
2016-09-25 23:34:19 +02:00
2016-09-25 14:38:48 +02:00
2016-09-25 23:34:19 +02:00
2016-09-27 14:34:01 -04:00
2016-09-22 15:54:27 -04:00
2016-07-05 19:11:05 -04:00
2016-09-19 13:11:13 -04:00
2016-04-25 15:09:11 -04:00
2016-10-07 18:46:30 -07:00
2016-05-19 19:12:14 -07:00
2016-07-08 08:38:49 -06:00
2016-08-19 12:00:44 +03:00
2016-06-25 07:42:55 -07:00
2016-05-01 14:01:00 -07:00
2016-05-12 07:07:42 -05:00
2016-09-28 17:43:15 +02:00
2016-10-03 23:38:11 +02:00
2016-05-02 09:00:56 -05:00
2016-06-23 14:57:40 -05:00
2016-07-16 21:32:58 -07:00
2016-09-16 09:34:14 +01:00
2016-07-08 18:14:03 -03:00
2016-09-15 08:33:01 -05:00
2016-09-28 08:53:14 +05:30
2016-08-29 11:00:23 +03:00
2016-04-26 10:19:38 +05:30
2016-10-07 18:46:28 -07:00
2016-09-19 21:44:30 +02:00
2016-10-07 18:46:27 -07:00
2016-06-03 15:06:22 -07:00
2016-10-07 18:46:27 -07:00
2016-06-21 09:43:04 +02:00
2016-07-26 16:19:19 -07:00
2016-10-11 15:06:34 -07:00
2016-04-08 11:08:12 -05:00
2016-06-10 18:27:59 -05:00
2016-06-10 15:41:08 -05:00
2016-10-07 11:46:37 -07:00
2016-05-03 10:35:49 -05:00
2016-06-03 12:06:11 +02:00
2016-09-22 15:25:54 +02:00
2016-05-20 17:58:30 -07:00
2016-10-28 11:06:25 +02:00
2016-06-24 11:39:29 -07:00
2016-09-22 08:21:21 -04:00
2016-08-08 14:42:01 -05:00
2016-10-05 18:24:00 -04:00
2016-10-14 11:36:59 -07:00
2016-04-09 03:10:50 +02:00
2016-06-28 00:42:10 +02:00
2016-09-13 02:49:34 +02:00
2016-05-05 01:38:44 +02:00
2016-04-22 01:32:37 +02:00
2016-04-22 01:32:37 +02:00
2016-07-12 19:25:38 -07:00
2016-04-22 10:29:05 +02:00
2016-05-19 19:12:14 -07:00
2016-09-27 21:52:00 -04:00
2016-10-08 11:06:08 -04:00
2016-07-01 22:44:34 +02:00
2016-10-09 12:23:38 -07:00
2016-09-22 19:59:41 -05:00
2016-09-30 15:26:52 -07:00
2016-04-25 23:47:44 +02:00
2016-09-08 15:01:10 -07:00
2016-09-08 15:01:10 -07:00
2016-09-22 02:18:33 -04:00
2016-07-01 05:32:17 -04:00
2016-09-05 16:45:39 +02:00
2016-09-12 20:01:43 +01:00
2016-06-24 22:53:50 -05:00
2016-07-29 15:54:19 -07:00
2016-10-11 15:06:30 -07:00
2016-10-15 10:03:15 -07:00
2016-08-02 19:35:06 -04:00
2016-07-06 10:51:14 +01:00
2016-07-06 10:51:14 +01:00
2016-08-18 15:36:59 +02:00
2016-04-14 21:14:03 -04:00
2016-04-23 18:51:33 -04:00
2016-08-22 09:36:57 -07:00
2016-07-15 10:41:44 +02:00
2016-07-15 10:41:44 +02:00
2016-09-16 12:06:24 +01:00
2016-10-11 15:06:32 -07:00
2016-10-02 22:50:21 -07:00
2016-05-31 22:12:43 +05:30
2016-05-30 09:37:47 +02:00
2016-06-29 23:39:52 +02:00
2016-09-20 04:43:36 -04:00
2016-08-02 19:35:38 -04:00
2016-08-02 19:35:37 -04:00
2016-08-02 19:35:37 -04:00
2016-07-26 16:19:19 -07:00
2016-09-08 22:15:25 -07:00
2016-09-01 16:56:15 -07:00
2016-04-13 10:42:20 +02:00
2016-06-08 15:16:42 +02:00
2016-06-22 09:10:00 +01:00
2016-09-17 08:39:12 -06:00
2016-04-15 16:53:14 -04:00
2016-10-07 18:46:28 -07:00
2016-06-21 10:15:56 +01:00
2016-08-08 12:51:58 -07:00
2016-06-14 10:54:40 -07:00
2016-09-19 12:27:10 +10:00
2016-04-30 09:26:55 -07:00
2016-10-11 15:06:33 -07:00
2016-10-07 18:46:30 -07:00
2016-06-03 08:37:25 +02:00
2016-08-31 15:36:01 +02:00
2016-09-28 17:46:46 +02:00
2016-07-27 14:20:09 -07:00
2016-07-13 09:24:51 +02:00
2016-07-26 16:19:19 -07:00
2016-05-23 17:04:14 -07:00
2016-07-01 05:32:17 -04:00
2016-10-07 15:36:58 -07:00
2016-07-28 16:07:41 -07:00
2016-09-06 18:30:20 +02:00
2016-07-28 16:07:41 -07:00
2016-08-28 23:44:55 -04:00
2016-09-05 13:52:39 +02:00
2016-06-28 09:08:51 -04:00
2016-05-08 23:46:14 -04:00
2016-06-14 11:55:15 +02:00
2016-10-05 18:23:36 -04:00
2016-05-03 14:59:30 -07:00
2016-06-28 08:54:23 -04:00
2016-04-21 10:47:26 +10:00
2016-05-19 19:12:14 -07:00
2016-06-11 14:57:56 -07:00
2016-09-13 02:17:19 +02:00
2016-10-07 18:46:27 -07:00
2016-08-04 08:50:07 -04:00
2016-08-11 15:39:38 +05:30
2016-10-17 09:50:56 -07:00
2016-10-06 09:52:23 -07:00
2016-09-15 09:51:14 -04:00
2016-09-21 00:23:00 -04:00
2016-09-27 14:35:21 +08:00
2016-09-24 09:35:06 +02:00
2016-07-17 19:59:26 +02:00
2016-08-31 14:43:35 -07:00
2016-06-20 12:47:15 -07:00
2016-09-22 17:02:55 +02:00
2016-07-15 10:41:42 +02:00
2016-07-28 16:07:41 -07:00
2016-08-22 10:10:12 -07:00
2016-07-19 17:43:38 +03:00
2016-05-18 18:55:19 -07:00
2016-04-26 15:47:32 -07:00
2016-05-20 20:57:27 -07:00
2016-05-23 17:04:14 -07:00
2016-09-30 11:46:40 +02:00
2016-08-08 13:02:01 -07:00
2016-04-07 16:53:29 -04:00
2016-06-30 18:04:36 -05:00
2016-10-10 13:38:49 -07:00
2016-09-13 08:08:24 +02:00
2016-05-03 14:32:07 -07:00
2016-09-22 20:00:36 -05:00
2016-07-26 16:19:19 -07:00
2016-08-08 14:42:02 -05:00
2016-05-20 17:58:30 -07:00
2016-04-06 16:14:24 +01:00
2016-05-31 13:15:57 +02:00
2016-08-16 18:49:56 +02:00
2016-08-01 21:44:52 +03:00
2016-06-10 23:03:55 -07:00
2016-08-02 02:57:29 +03:00
2016-07-28 16:07:41 -07:00
2016-05-23 11:48:48 -07:00
2016-08-31 13:20:15 +02:00
2016-07-28 16:07:41 -07:00
2016-06-25 09:04:48 -07:00
2016-07-14 10:42:35 +02:00
2016-09-30 10:54:03 +02:00
2016-10-08 10:27:10 +02:00
2016-09-21 00:22:59 -04:00
2016-08-29 08:13:21 -06:00
2016-10-07 18:46:27 -07:00
2016-08-04 08:50:07 -04:00
2016-10-07 21:48:36 -04:00
2016-05-20 17:58:30 -07:00