linux/arch/x86
Matt Fleming 9371773db4 perf/x86/amd: Make HW_CACHE_REFERENCES and HW_CACHE_MISSES measure L2
commit 080fe0b790 upstream.

While the Intel PMU monitors the LLC when perf enables the
HW_CACHE_REFERENCES and HW_CACHE_MISSES events, these events monitor
L1 instruction cache fetches (0x0080) and instruction cache misses
(0x0081) on the AMD PMU.

This is extremely confusing when monitoring the same workload across
Intel and AMD machines, since parameters like,

  $ perf stat -e cache-references,cache-misses

measure completely different things.

Instead, make the AMD PMU measure instruction/data cache and TLB fill
requests to the L2 and instruction/data cache and TLB misses in the L2
when HW_CACHE_REFERENCES and HW_CACHE_MISSES are enabled,
respectively. That way the events measure unified caches on both
platforms.

Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1472044328-21302-1-git-send-email-matt@codeblueprint.co.uk
Signed-off-by: Ingo Molnar <mingo@kernel.org>
[bwh: Backported to 3.16:
 - Drop KVM PMU changes
 - Adjust filename]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2016-11-20 01:17:30 +00:00
..
boot efi/libstub: Allocate headspace in efi_get_memory_map() 2016-11-20 01:17:23 +00:00
configs USB: remove CONFIG_USB_DEBUG from defconfig files 2014-05-28 09:40:45 -07:00
crypto crypto: ghash-clmulni: specify context size for ghash async algorithm 2015-09-29 16:44:46 +01:00
ia32 x86/entry/compat: Add missing CLAC to entry_INT80_32 2016-03-08 12:15:09 +00:00
include x86/mm: Disable preemption during CR3 read+write 2016-11-20 01:17:08 +00:00
kernel perf/x86/amd: Make HW_CACHE_REFERENCES and HW_CACHE_MISSES measure L2 2016-11-20 01:17:30 +00:00
kvm KVM: nVMX: postpone VMCS changes on MSR_IA32_APICBASE write 2016-11-20 01:17:12 +00:00
lguest asmlinkage, x86: Add explicit __visible to arch/x86/* 2014-05-05 16:07:44 -07:00
lib perf/x86: Fix copy_from_user_nmi() return if range is not ok 2015-09-30 13:20:53 +01:00
math-emu x86/ldt: Further fix FPU emulation 2015-09-03 13:29:55 +01:00
mm x86/mm/32: Enable full randomization on i386 and X86_32 2016-05-01 00:06:10 +02:00
net x86: bpf_jit: fix compilation of large bpf programs 2015-06-03 14:30:07 +01:00
oprofile x86, oprofile, nmi: Fix CPU hotplug callback registration 2014-03-20 13:43:43 +01:00
pci x86/PCI: Mark Broadwell-EP Home Agent 1 as having non-compliant BARs 2016-08-22 22:38:00 +01:00
platform efi: Disable interrupts around EFI calls, not in the epilog/prolog calls 2016-01-25 10:43:30 +00:00
power x86/power/64: Fix kernel text mapping corruption during image restoration 2016-08-22 22:38:25 +01:00
realmode x86/build: Supress realmode.bin is up to date message 2014-04-16 15:17:24 +02:00
syscalls x86/syscalls/64: Add compat_sys_keyctl for 32-bit userspace 2016-11-20 01:17:03 +00:00
tools x86, build: replace Perl script with Shell script 2015-02-04 10:58:18 +00:00
um um: Fix build error and kconfig for i386 2016-02-02 19:50:28 +00:00
vdso x86/vdso: Fix 'make bzImage' on older distros 2015-05-28 10:00:02 +01:00
video x86: Use vga_default_device() when determining whether an fb is primary 2012-04-24 09:50:17 +01:00
xen x86/iopl/64: Properly context-switch IOPL on Xen PV 2016-04-11 09:54:23 +01:00
.gitignore x86/kprobes: Add arch/x86/tools/insn_sanity to .gitignore 2012-01-16 08:21:59 +01:00
Kbuild x86, realmode: realmode.bin infrastructure 2012-05-08 11:41:48 -07:00
Kconfig x86/iosf: Add Kconfig prompt for IOSF_MBI selection 2015-07-15 10:01:31 +01:00
Kconfig.cpu Merge branch 'x86-nuke-platforms-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2014-04-02 13:15:58 -07:00
Kconfig.debug x86/efi: Dump the EFI page table 2014-03-04 16:17:17 +00:00
Makefile x86-64, build: Fix stack protector Makefile breakage with 32-bit userland 2014-05-07 14:14:44 -07:00
Makefile.um um: fix linker script generation 2012-04-09 13:59:00 -04:00
Makefile_32.cpu x86, 386 removal: Remove CONFIG_M386 from Kconfig 2012-11-29 13:23:01 -08:00