perf/x86/intel: Properly save/restore the PMU state in the NMI handler
commit82d71ed0277efc45360828af8c4e4d40e1b45352
authorKan Liang <kan.liang@linux.intel.com>
Tue, 20 Feb 2018 10:11:50 +0000 (20 02:11 -0800)
committerIngo Molnar <mingo@kernel.org>
Fri, 9 Mar 2018 07:22:18 +0000 (9 08:22 +0100)
tree20ae4204e2db11401885a18458f13059cc2b6838
parentf605cfca8c39ffa2b98c06d2b9f30ba64f1e54e3
perf/x86/intel: Properly save/restore the PMU state in the NMI handler

The PMU is disabled in intel_pmu_handle_irq(), but cpuc->enabled is not updated
accordingly.

This is fine in current usage because no-one checks it - but fix it
for future code: for example, the drain_pebs() will be modified to
fix an auto-reload bug.

Properly save/restore the old PMU state.

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>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Cc: acme@kernel.org
Cc: kernel test robot <fengguang.wu@intel.com>
Link: http://lkml.kernel.org/r/6f44ee84-56f8-79f1-559b-08e371eaeb78@linux.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/events/intel/core.c