linux-stable/arch/x86
Dapeng Mi e8df9d9f42 perf/x86/intel: Correct incorrect 'or' operation for PMU capabilities
When running perf-stat command on Intel hybrid platform, perf-stat
reports the following errors:

  sudo taskset -c 7 ./perf stat -vvvv -e cpu_atom/instructions/ sleep 1

  Opening: cpu/cycles/:HG
  ------------------------------------------------------------
  perf_event_attr:
    type                             0 (PERF_TYPE_HARDWARE)
    config                           0xa00000000
    disabled                         1
  ------------------------------------------------------------
  sys_perf_event_open: pid 0  cpu -1  group_fd -1  flags 0x8
  sys_perf_event_open failed, error -16

   Performance counter stats for 'sleep 1':

       <not counted>      cpu_atom/instructions/

It looks the cpu_atom/instructions/ event can't be enabled on atom PMU
even when the process is pinned on atom core. Investigation shows that
exclusive_event_init() helper always returns -EBUSY error in the perf
event creation. That's strange since the atom PMU should not be an
exclusive PMU.

Further investigation shows the issue was introduced by commit:

  97588df87b ("perf/x86/intel: Add common intel_pmu_init_hybrid()")

The commit originally intents to clear the bit PERF_PMU_CAP_AUX_OUTPUT
from PMU capabilities if intel_cap.pebs_output_pt_available is not set,
but it incorrectly uses 'or' operation and leads to all PMU capabilities
bits are set to 1 except bit PERF_PMU_CAP_AUX_OUTPUT.

Testing this fix on Intel hybrid platforms, the observed issues
disappear.

Fixes: 97588df87b ("perf/x86/intel: Add common intel_pmu_init_hybrid()")
Signed-off-by: Dapeng Mi <dapeng1.mi@linux.intel.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20231121014628.729989-1-dapeng1.mi@linux.intel.com
2023-11-21 13:44:36 +01:00
..
boot * Refactor and clean up TDX hypercall/module call infrastructure 2023-11-01 10:28:32 -10:00
coco configfs-tsm for v6.7 2023-11-04 15:58:13 -10:00
configs hardening updates for v6.7-rc1 2023-10-30 19:09:55 -10:00
crypto crypto: x86/nhpoly1305 - implement ->digest 2023-10-20 13:39:25 +08:00
entry Kbuild updates for v6.7 2023-11-04 08:07:19 -10:00
events perf/x86/intel: Correct incorrect 'or' operation for PMU capabilities 2023-11-21 13:44:36 +01:00
hyperv * Refactor and clean up TDX hypercall/module call infrastructure 2023-11-01 10:28:32 -10:00
ia32
include acpi/processor: sanitize _OSC/_PDC capabilities for Xen dom0 2023-11-13 07:22:00 +01:00
kernel - Ignore invalid x2APIC entries in order to not waste per-CPU data 2023-11-19 13:46:17 -08:00
kvm Many singleton patches against the MM code. The patch series which are 2023-11-02 19:38:47 -10:00
lib x86 assembly code improvements for v6.7 are: 2023-10-30 14:18:00 -10:00
math-emu
mm Many singleton patches against the MM code. The patch series which are 2023-11-02 19:38:47 -10:00
net
pci x86/PCI: Avoid PME from D3hot/D3cold for AMD Rembrandt and Phoenix USB4 2023-10-06 09:09:47 -05:00
platform x86/platform/uv: Annotate struct uv_rtc_timer_head with __counted_by 2023-09-24 12:02:58 +02:00
power
purgatory
ras
realmode
tools
um UML: remove unused cmd_vdso_install 2023-10-18 17:16:09 +09:00
video fbdev: Replace fb_pgprotect() with pgprot_framebuffer() 2023-10-12 09:20:46 +02:00
virt
xen X86 core code updates: 2023-10-30 17:37:47 -10:00
.gitignore
Kbuild
Kconfig Major microcode loader restructuring, cleanup and improvements by Thomas 2023-11-04 08:46:37 -10:00
Kconfig.assembler
Kconfig.cpu
Kconfig.debug
Makefile Kbuild updates for v6.7 2023-11-04 08:07:19 -10:00
Makefile.postlink kbuild: remove ARCH_POSTLINK from module builds 2023-10-28 21:10:08 +09:00
Makefile.um
Makefile_32.cpu