android_kernel_motorola_sm6225/arch/x86
Peter Zijlstra d07bdfd322 perf/x86: Fix USER/KERNEL tagging of samples properly
Some PMUs don't provide a full register set for their sample,
specifically 'advanced' PMUs like AMD IBS and Intel PEBS which provide
'better' than regular interrupt accuracy.

In this case we use the interrupt regs as basis and over-write some
fields (typically IP) with different information.

The perf core however uses user_mode() to distinguish user/kernel
samples, user_mode() relies on regs->cs. If the interrupt skid pushed
us over a boundary the new IP might not be in the same domain as the
interrupt.

Commit ce5c1fe9a9 ("perf/x86: Fix USER/KERNEL tagging of samples")
tried to fix this by making the perf core use kernel_ip(). This
however is wrong (TM), as pointed out by Linus, since it doesn't allow
for VM86 and non-zero based segments in IA32 mode.

Therefore, provide a new helper to set the regs->ip field,
set_linear_ip(), which massages the regs into a suitable state
assuming the provided IP is in fact a linear address.

Also modify perf_instruction_pointer() and perf_callchain_user() to
deal with segments base offsets.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1341910954.3462.102.camel@twins
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2012-07-31 17:02:04 +02:00
..
boot x86, efi stub: Add .reloc section back into image 2012-06-07 09:52:33 -07:00
configs
crypto crypto: aesni-intel - fix unaligned cbc decrypt for x86-32 2012-05-31 20:53:22 +10:00
ia32 x86, compat: Use test_thread_flag(TIF_IA32) in compat signal delivery 2012-06-14 18:16:04 -07:00
include/asm perf/x86: Fix USER/KERNEL tagging of samples properly 2012-07-31 17:02:04 +02:00
kernel perf/x86: Fix USER/KERNEL tagging of samples properly 2012-07-31 17:02:04 +02:00
kvm Merge branch 'linus' into perf/core 2012-07-18 11:17:17 +02:00
lguest
lib Merge branch 'x86/cpu' into perf/core 2012-07-05 21:12:11 +02:00
math-emu
mm x86/mm: Mark free_initrd_mem() as __init 2012-06-20 14:33:47 +02:00
net
oprofile perf/x86/amd: Unify AMD's generic and family 15h pmus 2012-07-05 21:19:41 +02:00
pci Features: 2012-05-24 16:02:08 -07:00
platform Merge branch 'x86-uv-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2012-07-22 12:37:15 -07:00
power
realmode x86-64, reboot: Be more paranoid in 64-bit reboot=bios 2012-06-21 10:25:03 -07:00
syscalls syscalls, x86: add __NR_kcmp syscall 2012-05-31 17:49:32 -07:00
tools x86/decoder: Fix bsr/bsf/jmpe decoding with operand-size prefix 2012-06-06 08:54:18 +02:00
um x86, um: Correct syscall table type attributes breaking gcc 4.8 2012-06-09 12:51:09 -07:00
vdso x86, cpu: Rename checking_wrmsrl() to wrmsrl_safe() 2012-06-07 13:32:04 -07:00
video
xen Merge branch 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2012-07-22 11:22:15 -07:00
.gitignore
Kbuild x86, realmode: realmode.bin infrastructure 2012-05-08 11:41:48 -07:00
Kconfig x86, efi: Add EFI boot stub documentation 2012-06-01 09:11:41 -07:00
Kconfig.cpu
Kconfig.debug
Makefile x86-64, gcc: Use -mpreferred-stack-boundary=3 if supported 2012-06-23 19:25:22 -07:00
Makefile.um
Makefile_32.cpu