linux/arch/x86/include/asm
Andi Kleen 86a04461a9 perf/x86: Revamp PEBS event selection
The basic idea is that it does not make sense to list all PEBS
events individually. The list is very long, sometimes outdated
and the hardware doesn't need it. If an event does not support
PEBS it will just not count, there is no security issue.

We need to only list events that something special, like
supporting load or store addresses.

This vastly simplifies the PEBS event selection. It also
speeds up the scheduling because the scheduler doesn't
have to walk as many constraints.

Bugs fixed:

 - We do not allow setting forbidden flags with PEBS anymore
   (SDM 18.9.4), except for the special cycle event.
   This is done using a new constraint macro that also
   matches on the event flags.

 - Correct DataLA and load/store/na flags reporting on Haswell
   [Requires a followon patch]

 - We did not allow all PEBS events on Haswell:
   We were missing some valid subevents in d1-d2 (MEM_LOAD_UOPS_RETIRED.*,
   MEM_LOAD_UOPS_RETIRED_L3_HIT_RETIRED.*)

This includes the changes proposed by Stephane earlier and obsoletes
his patchkit (except for some changes on pre Sandy Bridge/Silvermont
CPUs)

I only did Sandy Bridge and Silvermont and later so far, mostly because these
are the parts I could directly confirm the hardware behavior with hardware
architects. Also I do not believe the older CPUs have any
missing events in their PEBS list, so there's no pressing
need to change them.

I did not implement the flag proposed by Peter to allow
setting forbidden flags. If really needed this could
be implemented on to of this patch.

v2: Fix broken store events on SNB/IVB (Stephane Eranian)
v3: More fixes. Rename some arguments (Stephane Eranian)
v4: List most Haswell events individually again to report
memory operation type correctly.
Add new flags to describe load/store/na for datala.
Update description.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Reviewed-by: Stephane Eranian <eranian@google.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1407785233-32193-2-git-send-email-eranian@google.com
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Kan Liang <kan.liang@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Maria Dimakopoulou <maria.n.dimakopoulou@gmail.com>
Cc: Mark Davies <junk@eslaf.co.uk>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Yan, Zheng <zheng.z.yan@intel.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2014-08-13 07:51:13 +02:00
..
crypto crypto: move x86 to the generic version of ablk_helper 2013-09-24 06:02:24 +10:00
numachip
trace ftrace, perf: Avoid infinite event generation loop 2013-11-19 16:57:40 +01:00
uv x86/uv: Update the UV3 TLB shootdown logic 2014-06-05 14:17:20 +02:00
xen arm: xen: implement multicall hypercall support. 2014-04-24 13:09:46 +01:00
a.out-core.h
acenv.h ACPICA: Clean up redudant definitions already defined elsewhere 2014-05-27 18:13:08 +02:00
acpi.h ACPICA: Linux headers: Add <asm/acenv.h> to remove mis-ordered inclusion of <asm/acpi.h> 2014-05-27 18:13:07 +02:00
agp.h
alternative-asm.h
alternative.h kprobes/x86: Call out into INT3 handler directly instead of using notifier 2013-07-23 10:12:57 +02:00
amd_nb.h x86/AMD/NB: Fix amd_set_subcaches() parameter type 2014-01-25 08:50:09 +01:00
apb_timer.h
apic_flat_64.h
apic.h x86, cpufeature: Convert more "features" to bugs 2014-06-18 15:27:04 -07:00
apicdef.h
apm.h
arch_hweight.h
archrandom.h random: Add arch_has_random[_seed]() 2014-03-19 22:24:08 -04:00
asm-offsets.h
asm.h kprobes: Introduce NOKPROBE_SYMBOL() macro to maintain kprobes blacklist 2014-04-24 10:02:56 +02:00
atomic64_32.h
atomic64_64.h x86, bitops: Correct the assembly constraints to testing bitops 2013-12-04 14:31:28 -08:00
atomic.h arch,x86: Convert smp_mb__*() 2014-04-18 14:20:46 +02:00
barrier.h x86, locking: Use no more OOSTORE nonsense 2014-06-18 18:41:22 +02:00
bios_ebda.h
bitops.h arch,x86: Convert smp_mb__*() 2014-04-18 14:20:46 +02:00
boot.h
bootparam_utils.h x86: Don't clear olpc_ofw_header when sentinel is detected 2013-08-09 15:29:48 -07:00
bug.h x86: always define BUG() and HAVE_ARCH_BUG, even with !CONFIG_BUG 2014-04-07 16:36:10 -07:00
bugs.h
cache.h
cacheflush.h
calgary.h
calling.h sched, x86: Optimize the preempt_schedule() call 2013-09-25 14:23:07 +02:00
ce4100.h
checksum_32.h x86, smap: Handle csum_partial_copy_*_user() 2013-09-01 14:09:48 -07:00
checksum_64.h net: Change x86_64 add32_with_carry to allow memory operand 2014-05-05 15:26:29 -04:00
checksum.h
clocksource.h x86, vdso: Make vsyscall_gtod_data handling x86 generic 2014-03-18 12:51:52 -07:00
cmdline.h x86, boot: Carve out early cmdline parsing function 2014-05-20 20:21:24 -07:00
cmpxchg_32.h x86: Simplify __HAVE_ARCH_CMPXCHG tests 2014-07-11 17:28:51 -07:00
cmpxchg_64.h x86: Simplify __HAVE_ARCH_CMPXCHG tests 2014-07-11 17:28:51 -07:00
cmpxchg.h x86: Simplify __HAVE_ARCH_CMPXCHG tests 2014-07-11 17:28:51 -07:00
compat.h
context_tracking.h context_tracking: Move exception handling to generic code 2013-03-07 17:09:25 +01:00
cpu_device_id.h
cpu.h x86: delete __cpuinit usage from all x86 files 2013-07-14 19:36:56 -04:00
cpufeature.h x86, cpu: Kill cpu_has_mp 2014-07-14 12:21:40 -07:00
cpumask.h
current.h
debugreg.h
delay.h
desc_defs.h
desc.h x86, trace: Delete __trace_alloc_intr_gate() 2013-11-08 14:15:47 -08:00
device.h
div64.h
dma-contiguous.h drivers: dma-contiguous: clean source code and prepare for device tree 2013-08-27 09:18:29 +02:00
dma-mapping.h
dma.h
dmi.h firmware/dmi_scan: generalize for use by other archs 2014-01-23 16:36:57 -08:00
dwarf2.h
e820.h x86: avoid remapping data in parse_setup_data() 2013-08-13 23:29:19 -07:00
edac.h
efi.h x86/reboot: Add EFI reboot quirk for ACPI Hardware Reduced flag 2014-07-18 21:23:52 +01:00
elf.h x86, vdso: Move the 32-bit vdso special pages after the text 2014-05-05 13:18:56 -07:00
emergency-restart.h reboot: move arch/x86 reboot= handling to generic kernel 2013-07-09 10:33:29 -07:00
entry_arch.h x86, trace: Add irq vector tracepoints 2013-06-20 22:25:34 -07:00
espfix.h x86, espfix: Fix broken header guard 2014-05-02 11:34:17 -07:00
exec.h
fb.h
fixmap.h x86, vdso: Move the vvar and hpet mappings next to the 64-bit vDSO 2014-05-05 13:19:01 -07:00
floppy.h x86: Remove deprecated IRQF_DISABLED 2014-03-04 21:47:51 +01:00
fpu-internal.h x86, cpufeature: Convert more "features" to bugs 2014-06-18 15:27:04 -07:00
frame.h
ftrace.h ftrace/x86: Have function graph tracer use its own trampoline 2014-07-17 09:44:37 -04:00
futex.h x86: replace futex_atomic_cmpxchg_inatomic() with user_atomic_cmpxchg_inatomic 2013-12-16 09:08:13 -08:00
gart.h
genapic.h
geode.h
gpio.h
hardirq.h x86: hardirq: Make irq_hv_callback_count available for CONFIG_HYPERV=m as well 2014-03-06 12:08:37 +01:00
hash.h lib: introduce arch optimized hash library 2013-12-17 14:27:17 -05:00
highmem.h
hpet.h x86/hpet: Make boot_hpet_disable extern 2014-05-08 08:15:34 +02:00
hugetlb.h x86, mm, hugetlb: Add missing TLB page invalidation for hugetlb_cow() 2014-05-13 16:34:09 -07:00
hw_breakpoint.h
hw_irq.h x86/irq: Clean up VECTOR_UNDEFINED and VECTOR_RETRIGGERED definition 2014-04-14 13:42:05 +02:00
hypertransport.h
hypervisor.h x86: Correctly detect hypervisor 2013-08-05 06:35:33 -07:00
i387.h
i8259.h
ia32_unistd.h
ia32.h x86: switch to generic old sigaction 2013-02-03 18:16:27 -05:00
idle.h
inat_types.h
inat.h
init.h x86, 64bit, mm: Add generic kernel/ident mapping helper 2013-01-29 15:12:25 -08:00
insn.h
inst.h x86, crc32-pclmul: Fix build with older binutils 2013-05-30 16:36:23 -07:00
intel_mid_vrtc.h intel_mid: Renamed *mrst* to *intel_mid* 2013-10-17 16:40:36 -07:00
intel_scu_ipc.h
intel-mid.h x86, intel-mid: Add Merrifield platform support 2014-01-15 14:38:58 -08:00
io_apic.h x86: Get rid of get_nr_irqs_gsi() 2014-05-16 14:05:19 +02:00
io.h x86: use generic early_ioremap 2014-04-07 16:36:15 -07:00
iomap.h
iommu_table.h
iommu.h
iosf_mbi.h x86, iosf: Added Quark MBI identifiers 2014-05-09 14:57:08 -07:00
ipi.h
irq_regs.h
irq_remapping.h iommu: dmar: Provide arch specific irq allocation 2014-05-16 14:05:19 +02:00
irq_vectors.h KVM: VMX: Register a new IPI for posted interrupt 2013-04-16 16:32:39 -03:00
irq.h nmi: provide the option to issue an NMI back trace to every cpu but current 2014-06-23 16:47:44 -07:00
irqflags.h x86_64/entry/xen: Do not invoke espfix64 on Xen 2014-07-28 15:25:40 -07:00
ist.h
jump_label.h compiler/gcc4: Add quirk for 'asm goto' miscompilation bug 2013-10-11 07:39:14 +02:00
kbdleds.h
Kbuild x86: use generic early_ioremap 2014-04-07 16:36:15 -07:00
kdebug.h x86/dumpstack: Fix printk_address for direct addresses 2013-11-12 21:06:06 +01:00
kexec.h x86, kexec: Remove 1024G limitation for kexec buffer on 64bit 2013-01-29 15:26:23 -08:00
kgdb.h
kmap_types.h
kmemcheck.h
kprobes.h kprobes/x86: Call exception handlers directly from do_int3/do_debug 2014-04-24 10:02:59 +02:00
kvm_emulate.h KVM: emulate: put pointers in the fetch_cache 2014-07-11 09:14:03 +02:00
kvm_guest.h
kvm_host.h These are the x86, MIPS and s390 changes; PPC and ARM will come in a 2014-08-04 12:16:46 -07:00
kvm_para.h x86, kvm: correctly access the KVM_CPUID_FEATURES leaf at 0x40000101 2014-01-29 18:11:55 +01:00
lguest_hcall.h
lguest.h lguest: map Switcher below fixmap. 2013-04-22 15:45:03 +09:30
linkage.h ix86: Tighten asmlinkage_protect() constraints 2013-01-24 11:25:59 +01:00
local64.h
local.h x86, bitops: Correct the assembly constraints to testing bitops 2013-12-04 14:31:28 -08:00
mach_timer.h
mach_traps.h
math_emu.h
mc146818rtc.h x86: Simplify __HAVE_ARCH_CMPXCHG tests 2014-07-11 17:28:51 -07:00
mce.h hwpoison: remove unused global variable in do_machine_check() 2014-06-04 16:54:11 -07:00
microcode_amd.h x86, microcode, AMD: Fix early ucode loading 2014-01-13 19:59:38 +01:00
microcode_intel.h x86: delete __cpuinit usage from all x86 files 2013-07-14 19:36:56 -04:00
microcode.h x86, microcode: Add a disable chicken bit 2014-05-20 20:21:27 -07:00
misc.h x86: Improve the printout of the SMP bootup CPU table 2013-09-28 10:10:26 +02:00
mmconfig.h x86: delete __cpuinit usage from all x86 files 2013-07-14 19:36:56 -04:00
mmu_context.h x86/mm: Add tracepoints for TLB flushes 2014-07-31 08:48:51 -07:00
mmu.h x86, vdso: Reimplement vdso.so preparation in build-time C 2014-05-05 13:18:51 -07:00
mmx.h
mmzone_32.h x86, platforms: Remove NUMAQ 2014-02-27 08:07:39 -08:00
mmzone_64.h
mmzone.h
module.h
mpspec_def.h
mpspec.h x86, platforms: Remove NUMAQ 2014-02-27 08:07:39 -08:00
mshyperv.h x86: hyperv: Fixup the (brain) damage caused by the irq cleanup 2014-03-05 13:42:14 +01:00
msidef.h
msr.h x86: Add another set of MSR accessor functions 2014-03-13 15:34:45 -07:00
mtrr.h Add arch_phys_wc_{add, del} to manipulate WC MTRRs if needed 2013-05-31 13:02:52 +10:00
mutex_32.h x86: Simplify __HAVE_ARCH_CMPXCHG tests 2014-07-11 17:28:51 -07:00
mutex_64.h compiler/gcc4: Add quirk for 'asm goto' miscompilation bug 2013-10-11 07:39:14 +02:00
mutex.h
mwait.h x86, cpufeature: Convert more "features" to bugs 2014-06-18 15:27:04 -07:00
nmi.h x86/nmi: Push duration printk() to irq context 2014-02-09 13:17:22 +01:00
nops.h
numa_32.h
numa.h x86: delete __cpuinit usage from all x86 files 2013-07-14 19:36:56 -04:00
olpc_ofw.h
olpc.h
page_32_types.h x86, relocs: Move ELF relocation handling to C 2013-08-07 21:00:04 -07:00
page_32.h x86/mm: Implement ASLR for hugetlb mappings 2013-11-19 14:24:50 +01:00
page_64_types.h x86_64: expand kernel stack to 16K 2014-05-30 11:52:51 -07:00
page_64.h
page_types.h x86: revert wrong memblock current limit setting 2014-01-27 21:02:38 -08:00
page.h x86/mm: Implement ASLR for hugetlb mappings 2013-11-19 14:24:50 +01:00
paravirt_types.h x86, asmlinkage, paravirt: Don't rely on local assembler labels 2014-01-29 22:17:17 -08:00
paravirt.h x86, asmlinkage, paravirt: Make paravirt thunks global 2014-01-29 22:17:17 -08:00
parport.h X86: drivers: remove __dev* attributes. 2013-01-03 15:57:04 -08:00
pat.h
pci_64.h
pci_x86.h PCI changes for the v3.9 merge window: 2013-02-25 21:18:18 -08:00
pci-direct.h
pci-functions.h
pci.h PCI: Turn pcibios_penalize_isa_irq() into a weak function 2014-05-27 16:23:58 -06:00
percpu.h percpu: invoke __verify_pcpu_ptr() from the generic part of accessors and operations 2014-06-17 19:12:40 -04:00
perf_event_p4.h perf/x86/intel/P4: Robistify P4 PMU types 2013-04-26 09:31:41 +02:00
perf_event.h perf/x86: Revamp PEBS event selection 2014-08-13 07:51:13 +02:00
pgalloc.h x86, mm: enable split page table lock for PMD level 2013-11-15 09:32:15 +09:00
pgtable_32_types.h
pgtable_32.h x86/mm: Convert update_mmu_cache() and update_mmu_cache_pmd() to functions 2013-01-24 16:12:13 +01:00
pgtable_64_types.h x86-64, espfix: Don't leak bits 31:16 of %esp returning to 16-bit stack 2014-04-30 14:14:28 -07:00
pgtable_64.h mm: x86 pgtable: drop unneeded preprocessor ifdef 2014-06-04 16:54:05 -07:00
pgtable_types.h x86: define _PAGE_NUMA by reusing software bits on the PMD and PTE levels 2014-06-04 16:53:55 -07:00
pgtable-2level_types.h
pgtable-2level.h mm: x86 pgtable: require X86_64 for soft-dirty tracker 2014-06-04 16:54:05 -07:00
pgtable-3level_types.h
pgtable-3level.h mm: save soft-dirty bits on file pages 2013-08-13 17:57:48 -07:00
pgtable.h mm: x86 pgtable: require X86_64 for soft-dirty tracker 2014-06-04 16:54:05 -07:00
pmc_atom.h x86/pmc_atom: Expose PMC device state and platform sleep state 2014-07-25 14:12:14 -07:00
posix_types.h
preempt.h percpu: add raw_cpu_ops 2014-04-07 16:36:13 -07:00
probe_roms.h
processor-cyrix.h
processor-flags.h
processor.h Merge branch 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2014-08-04 17:15:45 -07:00
prom.h of: remove HAVE_ARCH_DEVTREE_FIXUPS 2013-10-09 20:04:08 -05:00
proto.h x86, vdso: Move syscall and sysenter setup into kernel/cpu/common.c 2014-05-05 13:18:47 -07:00
ptrace.h ptrace,x86: force IRET path after a ptrace_stop() 2014-07-03 17:27:23 -07:00
pvclock-abi.h
pvclock.h pvclock: detect watchdog reset at pvclock read 2013-11-06 09:48:43 +02:00
qrwlock.h x86, locking: Use no more OOSTORE nonsense 2014-06-18 18:41:22 +02:00
realmode.h x86, realmode: Separate real_mode reserve and setup 2013-01-29 15:13:24 -08:00
reboot_fixups.h
reboot.h
required-features.h x86: Require MOVBE feature in cpuid when we use it 2013-01-28 16:59:55 -08:00
resume-trace.h
rio.h
rmwcc.h x86, bitops: Correct the assembly constraints to testing bitops 2013-12-04 14:31:28 -08:00
rtc.h
rwlock.h
rwsem.h x86 rwsem: avoid taking slow path when stealing write lock 2013-05-07 07:20:17 -07:00
scatterlist.h
seccomp_32.h
seccomp_64.h
seccomp.h
sections.h
segment.h x86, trace: Register exception handler to trace IDT 2013-11-08 14:15:45 -08:00
serial.h
setup_arch.h
setup.h x86, espfix: Move espfix definitions into a separate header file 2014-05-01 14:16:15 -07:00
shmparam.h
sigcontext.h
sigframe.h
sighandling.h x86/signals: Propagate RF EFLAGS bit through the signal restore call 2013-05-28 08:46:50 +02:00
signal.h signals: kill sigfindinword() 2014-06-06 16:08:11 -07:00
simd.h crypto: move x86 to the generic version of ablk_helper 2013-09-24 06:02:24 +10:00
smap.h
smp.h x86: Delete non-required instances of include <linux/init.h> 2014-01-06 21:25:18 -08:00
smpboot_hooks.h
sparsemem.h
special_insns.h x86: Add support for the clflushopt instruction 2014-02-27 08:23:28 -08:00
spinlock_types.h x86, locking/rwlocks: Enable qrwlocks on x86 2014-06-06 07:58:29 +02:00
spinlock.h x86, locking/rwlocks: Enable qrwlocks on x86 2014-06-06 07:58:29 +02:00
sta2x11.h
stackprotector.h
stacktrace.h
string_32.h
string_64.h
string.h
suspend_32.h x86, gdt, hibernate: Store/load GDT for hibernate path. 2013-05-02 11:27:35 -07:00
suspend_64.h x86, gdt, hibernate: Store/load GDT for hibernate path. 2013-05-02 11:27:35 -07:00
suspend.h
svm.h
swiotlb.h x86: enable DMA CMA with swiotlb 2014-06-04 16:53:57 -07:00
switch_to.h x86, asmlinkage: Make 32bit/64bit __switch_to visible 2013-08-06 14:18:30 -07:00
sync_bitops.h arch,x86: Convert smp_mb__*() 2014-04-18 14:20:46 +02:00
sys_ia32.h unify compat fanotify_mark(2), switch to COMPAT_SYSCALL_DEFINE 2013-05-09 13:46:38 -04:00
syscall.h audit: use uapi/linux/audit.h for AUDIT_ARCH declarations 2014-03-20 10:11:59 -04:00
syscalls.h x86, asmlinkage: Make various syscalls asmlinkage 2013-08-06 14:18:33 -07:00
sysfb.h x86: sysfb: move EFI quirks from efifb to sysfb 2013-08-02 16:17:47 -07:00
tce.h
thread_info.h sched/idle, x86: Switch from TS_POLLING to TIF_POLLING_NRFLAG 2014-05-08 09:16:56 +02:00
time.h
timer.h Merge branch 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2014-01-20 12:03:57 -08:00
timex.h
tlb.h x86-32: Fix possible incomplete TLB invalidate with PAE pagetables 2013-04-12 16:56:47 -07:00
tlbflush.h mm, x86: Account for TLB flushes only when debugging 2014-01-25 09:10:41 +01:00
topology.h PCI changes for the v3.15 merge window: 2014-04-01 15:14:04 -07:00
trace_clock.h
traps.h Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2014-06-12 19:18:49 -07:00
tsc.h x86, tsc: Fallback to normal calibration if fast MSR calibration fails 2014-02-19 17:12:24 +01:00
uaccess_32.h x86: Unify copy_to_user() and add size checking to it 2013-10-26 12:27:37 +02:00
uaccess_64.h x86, sparse: Do not force removal of __user when calling copy_to/from_user_nocheck() 2014-01-04 13:54:50 -08:00
uaccess.h Merge branch 'x86/mpx' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2014-01-20 14:46:32 -08:00
unaligned.h
unistd.h sys_sgetmask/sys_ssetmask: add CONFIG_SGETMASK_SYSCALL 2014-06-04 16:54:14 -07:00
uprobes.h uprobes/x86: Rename arch_uprobe->def to ->defparam, minor comment updates 2014-06-05 16:21:57 +02:00
user32.h
user_32.h
user_64.h
user.h
vdso.h x86, vdso: Move the vvar area before the vdso text 2014-07-11 16:57:51 -07:00
vga.h x86, ia64: Move EFI_FB vga_default_device() initialization to pci_vga_fixup() 2014-07-10 16:48:48 -06:00
vgtod.h x86, vdso: Add 32 bit VDSO time support for 64 bit kernel 2014-03-18 12:52:41 -07:00
virtext.h
vm86.h
vmx.h KVM: nVMX: Fix returned value of MSR_IA32_VMX_PROCBASED_CTLS 2014-06-19 12:52:12 +02:00
vsyscall.h
vvar.h x86, vdso: Move the vvar and hpet mappings next to the 64-bit vDSO 2014-05-05 13:19:01 -07:00
word-at-a-time.h
x2apic.h
x86_init.h PCI: Drop "irq" param from *_restore_msi_irqs() 2013-12-13 08:44:30 -07:00
xcr.h
xor_32.h x86/xor: Add alternative SSE implementation only prefetching once per 64-byte line 2013-01-25 09:23:50 +01:00
xor_64.h x86/xor: Add alternative SSE implementation only prefetching once per 64-byte line 2013-01-25 09:23:50 +01:00
xor_avx.h crypto: xor - Check for osxsave as well as avx in crypto/xor 2013-08-21 21:08:35 +10:00
xor.h x86/xor: Add alternative SSE implementation only prefetching once per 64-byte line 2013-01-25 09:23:50 +01:00
xsave.h Merge tag 'kvm-3.15-1' of git://git.kernel.org/pub/scm/virt/kvm/kvm 2014-04-02 14:50:10 -07:00