Kan Liang
e321d02db8
perf/x86: Disable extended registers for non-supported PMUs
The perf fuzzer caused Skylake machine to crash:
[ 9680.085831] Call Trace:
[ 9680.088301] <IRQ>
[ 9680.090363] perf_output_sample_regs+0x43/0xa0
[ 9680.094928] perf_output_sample+0x3aa/0x7a0
[ 9680.099181] perf_event_output_forward+0x53/0x80
[ 9680.103917] __perf_event_overflow+0x52/0xf0
[ 9680.108266] ? perf_trace_run_bpf_submit+0xc0/0xc0
[ 9680.113108] perf_swevent_hrtimer+0xe2/0x150
[ 9680.117475] ? check_preempt_wakeup+0x181/0x230
[ 9680.122091] ? check_preempt_curr+0x62/0x90
[ 9680.126361] ? ttwu_do_wakeup+0x19/0x140
[ 9680.130355] ? try_to_wake_up+0x54/0x460
[ 9680.134366] ? reweight_entity+0x15b/0x1a0
[ 9680.138559] ? __queue_work+0x103/0x3f0
[ 9680.142472] ? update_dl_rq_load_avg+0x1cd/0x270
[ 9680.147194] ? timerqueue_del+0x1e/0x40
[ 9680.151092] ? __remove_hrtimer+0x35/0x70
[ 9680.155191] __hrtimer_run_queues+0x100/0x280
[ 9680.159658] hrtimer_interrupt+0x100/0x220
[ 9680.163835] smp_apic_timer_interrupt+0x6a/0x140
[ 9680.168555] apic_timer_interrupt+0xf/0x20
[ 9680.172756] </IRQ>
The XMM registers can only be collected by PEBS hardware events on the
platforms with PEBS baseline support, e.g. Icelake, not software/probe
events.
Add capabilities flag PERF_PMU_CAP_EXTENDED_REGS to indicate the PMU
which support extended registers. For X86, the extended registers are
XMM registers.
Add has_extended_regs() to check if extended registers are applied.
The generic code define the mask of extended registers as 0 if arch
headers haven't overridden it.
Originally-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reported-by: Vince Weaver <vincent.weaver@maine.edu>
Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
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: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Fixes: 878068ea27 ("perf/x86: Support outputting XMM registers")
Link: https://lkml.kernel.org/r/1559081314-9714-1-git-send-email-kan.liang@linux.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2019-06-24 19:19:23 +02:00
..
2019-06-05 17:37:09 +02:00
2019-06-14 17:46:14 -10:00
2018-10-24 20:55:56 -04:00
2019-05-21 10:50:46 +02:00
2019-06-05 17:37:06 +02:00
2019-06-24 19:19:23 +02:00
2019-05-21 10:50:46 +02:00
2019-05-21 10:50:46 +02:00
2019-06-15 07:24:11 -10:00
2019-06-05 17:37:17 +02:00
2019-06-08 12:52:42 -07:00
2019-05-21 11:28:45 +02:00
2019-05-21 10:50:46 +02:00
2019-06-05 17:37:17 +02:00
2019-06-14 11:51:44 +02:00
2019-06-15 07:24:11 -10:00
2019-04-29 16:48:03 +02:00
2019-04-04 21:04:13 -04:00
2019-06-05 17:37:17 +02:00
2019-05-30 11:26:37 -07:00
2019-04-26 13:51:03 -04:00
2019-05-30 11:26:35 -07:00
2019-05-30 11:26:35 -07:00
2019-05-30 11:26:35 -07:00
2019-05-30 11:26:35 -07:00
2019-05-07 20:03:32 -07:00
2019-06-05 17:37:17 +02:00
2018-10-31 08:54:14 -07:00
2019-01-25 11:22:43 -08:00
2019-05-15 08:16:14 -07:00
2019-03-07 18:32:02 -08:00
2019-05-21 10:50:45 +02:00
2019-06-05 17:36:37 +02:00
2019-06-03 12:02:03 +02:00
2019-03-05 21:07:14 -08:00
2019-05-21 10:50:45 +02:00
2019-06-11 15:44:45 -10:00
2019-05-21 11:52:39 +02:00
2018-05-16 07:23:35 +02:00
2018-05-16 07:23:35 +02:00
2019-05-31 10:38:57 -07:00
2019-05-30 11:26:35 -07:00
2019-04-09 14:19:06 +02:00
2019-06-01 15:51:31 -07:00
2019-05-21 10:50:45 +02:00
2019-05-30 11:26:35 -07:00
2019-05-24 20:16:01 +02:00
2019-05-21 10:50:45 +02:00
2019-04-19 12:59:36 +02:00
2019-05-21 10:50:45 +02:00
2019-05-21 10:50:45 +02:00
2019-05-21 10:50:45 +02:00
2019-05-21 10:50:46 +02:00
2019-05-21 10:50:46 +02:00
2019-05-21 10:50:46 +02:00
2019-05-21 10:50:46 +02:00
2019-03-07 18:32:02 -08:00
2019-05-03 19:42:41 +02:00
2019-05-14 09:47:50 -07:00
2018-07-16 12:31:57 -07:00
2019-05-24 20:16:01 +02:00
2019-05-30 11:26:35 -07:00
2019-05-30 11:26:39 -07:00
2019-05-21 10:50:45 +02:00
2019-06-05 17:37:17 +02:00
2019-05-24 20:16:01 +02:00
2019-06-13 17:34:56 -10:00
2019-05-24 17:27:11 +02:00
2019-05-24 17:27:11 +02:00
2019-05-30 11:26:35 -07:00
2019-05-21 10:50:45 +02:00
2019-06-05 17:37:17 +02:00
2019-04-25 22:06:11 +02:00
2019-05-21 10:50:45 +02:00
2019-05-30 11:26:35 -07:00
2019-05-21 10:50:45 +02:00
2019-05-21 10:50:45 +02:00
2019-05-21 10:50:45 +02:00
2019-06-11 15:44:45 -10:00
2019-05-21 10:50:45 +02:00
2019-03-12 13:27:20 -07:00
2019-05-21 10:50:45 +02:00
2019-04-19 12:39:32 +02:00
2019-05-07 19:06:04 -07:00
2019-06-05 15:06:07 +02:00
2019-05-21 10:50:45 +02:00
2019-05-21 10:50:45 +02:00
2019-06-05 17:37:16 +02:00
2018-12-05 19:31:44 -08:00
2019-06-02 11:04:42 -07:00
2019-05-24 17:27:11 +02:00
2019-05-07 14:31:03 +02:00
2019-06-01 15:51:31 -07:00
2019-01-04 13:13:47 -08:00
2019-05-21 10:50:45 +02:00
2019-05-30 11:26:37 -07:00
2019-05-21 11:52:39 +02:00
2019-03-26 14:42:53 -07:00
2019-05-30 11:26:35 -07:00
2019-05-30 11:26:37 -07:00
2019-06-05 17:37:17 +02:00
2018-04-02 20:15:59 +02:00
2018-04-02 20:15:30 +02:00
2019-05-21 10:50:45 +02:00
2019-05-21 10:50:45 +02:00
2019-06-05 17:37:17 +02:00
2019-05-21 10:50:45 +02:00
2019-05-21 10:50:45 +02:00
2019-06-05 17:37:17 +02:00
2019-06-05 17:37:17 +02:00
2019-04-19 09:46:05 -07:00
2019-04-18 14:05:51 +02:00
2019-04-16 16:55:15 +02:00
2019-05-21 10:50:45 +02:00