linux/arch/x86/events/intel
Kan Liang acade63799 perf/x86/intel: Apply mid ACK for small core
A warning as below may be occasionally triggered in an ADL machine when
these conditions occur:

 - Two perf record commands run one by one. Both record a PEBS event.
 - Both runs on small cores.
 - They have different adaptive PEBS configuration (PEBS_DATA_CFG).

  [ ] WARNING: CPU: 4 PID: 9874 at arch/x86/events/intel/ds.c:1743 setup_pebs_adaptive_sample_data+0x55e/0x5b0
  [ ] RIP: 0010:setup_pebs_adaptive_sample_data+0x55e/0x5b0
  [ ] Call Trace:
  [ ]  <NMI>
  [ ]  intel_pmu_drain_pebs_icl+0x48b/0x810
  [ ]  perf_event_nmi_handler+0x41/0x80
  [ ]  </NMI>
  [ ]  __perf_event_task_sched_in+0x2c2/0x3a0

Different from the big core, the small core requires the ACK right
before re-enabling counters in the NMI handler, otherwise a stale PEBS
record may be dumped into the later NMI handler, which trigger the
warning.

Add a new mid_ack flag to track the case. Add all PMI handler bits in
the struct x86_hybrid_pmu to track the bits for different types of
PMUs.  Apply mid ACK for the small cores on an Alder Lake machine.

The existing hybrid() macro has a compile error when taking address of
a bit-field variable. Add a new macro hybrid_bit() to get the
bit-field value of a given PMU.

Fixes: f83d2f91d2 ("perf/x86/intel: Add Alder Lake Hybrid support")
Reported-by: Ammy Yi <ammy.yi@intel.com>
Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Tested-by: Ammy Yi <ammy.yi@intel.com>
Link: https://lkml.kernel.org/r/1627997128-57891-1-git-send-email-kan.liang@linux.intel.com
2021-08-06 14:25:15 +02:00
..
bts.c x86: Fix various typos in comments, take #2 2021-03-21 23:50:28 +01:00
core.c perf/x86/intel: Apply mid ACK for small core 2021-08-06 14:25:15 +02:00
cstate.c perf/x86/cstate: Add ICELAKE_X and ICELAKE_D support 2021-07-02 15:58:33 +02:00
ds.c perf/x86/intel: Fix PEBS-via-PT reload base value for Extended PEBS 2021-06-23 18:30:52 +02:00
knc.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
lbr.c Fixes and improvements for FPU handling on x86: 2021-07-07 11:12:01 -07:00
Makefile perf/x86/intel/uncore: Parse uncore discovery tables 2021-04-02 10:04:54 +02:00
p4.c Perf events changes in this cycle were: 2021-04-28 13:03:44 -07:00
p6.c x86/cpu: Rename cpu_data.x86_mask to cpu_data.x86_stepping 2018-02-15 01:15:52 +01:00
pt.c x86: Fix various typos in comments 2021-03-18 15:31:53 +01:00
pt.h perf/x86/intel/pt: Prevent redundant WRMSRs 2019-11-13 11:06:18 +01:00
uncore_discovery.c perf/x86/intel/uncore: Generic support for the MMIO type of uncore blocks 2021-04-02 10:04:55 +02:00
uncore_discovery.h perf/x86/intel/uncore: Generic support for the MMIO type of uncore blocks 2021-04-02 10:04:55 +02:00
uncore_nhmex.c perf/x86/intel/uncore: Correct fixed counter index check for NHM 2018-05-31 12:36:28 +02:00
uncore_snb.c perf/x86/intel/uncore: Add Alder Lake support 2021-04-19 20:03:29 +02:00
uncore_snbep.c A fix and a hardware-enablement addition: 2021-07-11 11:10:48 -07:00
uncore.c perf/x86/intel/uncore: Drop unnecessary NULL checks after container_of() 2021-05-12 10:44:21 +02:00
uncore.h perf/x86/intel/uncore: Generalize I/O stacks to PMON mapping procedure 2021-05-18 12:53:56 +02:00