kernel-hacking-2024-linux-s.../arch/x86
Steven Rostedt 8115f3f0c9 ftrace: use a real variable for ftrace_nop in x86
Impact: avoid section mismatch warning, clean up

The dynamic ftrace determines which nop is safe to use at start up.
When it finds a safe nop for patching, it sets a pointer called ftrace_nop
to point to the code. All call sites are then patched to this nop.

Later, when tracing is turned on, this ftrace_nop variable is again used
to compare the location to make sure it is a nop before we update it to
an mcount call. If this fails just once, a warning is printed and ftrace
is disabled.

Rakib Mullick noted that the code that sets up the nop is a .init section
where as the nop itself is in the .text section. This is needed because
the nop is used later on after boot up. The problem is that the test of the
nop jumps back to the setup code and causes a "section mismatch" warning.

Rakib first recommended to convert the nop to .init.text, but as stated
above, this would fail since that text is used later.

The real solution is to extend Rabik's patch, and to make the ftrace_nop
into an array, and just save the code from the assembly to this array.

Now the section can stay as an init section, and we have a nop to use
later on.

Reported-by: Rakib Mullick <rakib.mullick@gmail.com>
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-10-27 16:52:01 +01:00
..
boot Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2008-10-23 12:38:39 -07:00
configs x86: remove irqbalance in kernel for 32 bit 2008-10-16 16:52:52 +02:00
crypto
ia32 compat: generic compat get/settimeofday 2008-10-16 11:21:33 -07:00
include/asm Merge commit 'v2.6.28-rc2' into tracing/urgent 2008-10-27 10:50:54 +01:00
kernel ftrace: use a real variable for ftrace_nop in x86 2008-10-27 16:52:01 +01:00
kvm Merge commit 'linus/master' into merge-linus 2008-10-17 09:20:26 -07:00
lguest x86: make 32bit support per_cpu vector 2008-10-16 16:52:53 +02:00
lib
mach-default
mach-generic x86: make 32bit support per_cpu vector 2008-10-16 16:52:53 +02:00
mach-rdc321x
mach-voyager
math-emu
mm Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2008-10-23 12:38:39 -07:00
oprofile oprofile: fixing whitespaces in arch/x86/oprofile/* 2008-10-16 17:17:46 +02:00
pci x86/PCI: irq and pci_ids patch for Intel Ibex Peak DeviceIDs 2008-10-20 10:53:48 -07:00
power
vdso
video
xen Merge branch 'tracing/ftrace' into tracing/urgent 2008-10-22 09:08:14 +02:00
Kconfig Merge commit 'v2.6.28-rc2' into tracing/urgent 2008-10-27 10:50:54 +01:00
Kconfig.cpu
Kconfig.debug
Makefile x86, um: ... and asm-x86 move 2008-10-22 22:55:20 -07:00
Makefile_32.cpu