linux/arch
Frederic Weisbecker 625dbc3b8a x86: Save rbp in pt_regs on irq entry
From the x86_64 low level interrupt handlers, the frame pointer is
saved right after the partial pt_regs frame.

rbp is not supposed to be part of the irq partial saved registers,
but it only requires to extend the pt_regs frame by 8 bytes to
do so, plus a tiny stack offset fixup on irq exit.

This changes a bit the semantics or get_irq_entry() that is supposed
to provide only the value of caller saved registers and the cpu
saved frame. However it's a win for unwinders that can walk through
stack frames on top of get_irq_regs() snapshots.

A noticeable impact is that it makes perf events cpu-clock and
task-clock events based callchains working on x86_64.

Let's then save rbp into the irq pt_regs.

As a result with:

	perf record -e cpu-clock perf bench sched messaging
	perf report --stdio

Before:
    20.94%             perf  [kernel.kallsyms]        [k] lock_acquire
                       |
                       --- lock_acquire
                          |
                          |--44.01%-- __write_nocancel
                          |
                          |--43.18%-- __read
                          |
                          |--6.08%-- fork
                          |          create_worker
                          |
                          |--0.88%-- _dl_fixup
                          |
                          |--0.65%-- do_lookup_x
                          |
                          |--0.53%-- __GI___libc_read
                           --4.67%-- [...]

After:
    19.23%         perf  [kernel.kallsyms]    [k] __lock_acquire
                   |
                   --- __lock_acquire
                      |
                      |--97.74%-- lock_acquire
                      |          |
                      |          |--21.82%-- _raw_spin_lock
                      |          |          |
                      |          |          |--37.26%-- unix_stream_recvmsg
                      |          |          |          sock_aio_read
                      |          |          |          do_sync_read
                      |          |          |          vfs_read
                      |          |          |          sys_read
                      |          |          |          system_call
                      |          |          |          __read
                      |          |          |
                      |          |          |--24.09%-- unix_stream_sendmsg
                      |          |          |          sock_aio_write
                      |          |          |          do_sync_write
                      |          |          |          vfs_write
                      |          |          |          sys_write
                      |          |          |          system_call
                      |          |          |          __write_nocancel

v2: Fix cfi annotations.

Reported-by: Soeren Sandmann Pedersen <sandmann@redhat.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: H. Peter Anvin <hpa@zytor.com
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Jan Beulich <JBeulich@novell.com>
2011-01-07 17:40:56 +01:00
..
alpha perf: Dynamic pmu types 2010-12-16 11:36:43 +01:00
arm Merge commit 'v2.6.37' into perf/core 2011-01-05 14:22:10 +01:00
avr32 Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6 2010-10-28 16:16:39 -07:00
blackfin BKL: remove extraneous #include <smp_lock.h> 2010-11-17 08:59:32 -08:00
cris Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6 2010-10-28 16:16:39 -07:00
frv BKL: remove extraneous #include <smp_lock.h> 2010-11-17 08:59:32 -08:00
h8300 BKL: remove extraneous #include <smp_lock.h> 2010-11-17 08:59:32 -08:00
ia64 SCSI host lock push-down 2010-11-16 13:33:23 -08:00
m32r Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6 2010-10-28 16:16:39 -07:00
m68k BKL: remove extraneous #include <smp_lock.h> 2010-11-17 08:59:32 -08:00
m68knommu BKL: remove extraneous #include <smp_lock.h> 2010-11-17 08:59:32 -08:00
microblaze Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6 2010-10-28 16:16:39 -07:00
mips Merge commit 'v2.6.37-rc7' into perf/core 2010-12-22 11:53:23 +01:00
mn10300 arch/mn10300/kernel/irq.c: fix build 2011-01-03 16:36:33 -08:00
parisc parisc: convert the rest of the irq handlers to simple/percpu 2010-12-04 11:15:19 -05:00
powerpc Merge commit 'v2.6.37-rc8' into perf/core 2011-01-04 08:08:54 +01:00
s390 [S390] nohz/s390: fix arch_needs_cpu() return value on offline cpus 2010-12-01 10:08:17 +01:00
score Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6 2010-10-28 16:16:39 -07:00
sh Merge commit 'v2.6.37-rc8' into perf/core 2011-01-04 08:08:54 +01:00
sparc Merge commit 'v2.6.37-rc7' into perf/core 2010-12-22 11:53:23 +01:00
tile arch/tile: handle rt_sigreturn() more cleanly 2010-12-17 16:59:29 -05:00
um uml: disable winch irq before freeing handler data 2010-11-25 06:50:39 +09:00
x86 x86: Save rbp in pt_regs on irq entry 2011-01-07 17:40:56 +01:00
xtensa Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6 2010-10-28 16:16:39 -07:00
.gitignore
Kconfig jump label: Add work around to i386 gcc asm goto bug 2010-10-29 14:45:29 -04:00