linux-stable-rt/arch/ppc/boot/common
Paul Janzen aed9c6ccb8 [PATCH] ppc32: Put cache flush routines back into .relocate_code section
In 2.6.14, we had the following definition of _GLOBAL() in
include/asm-ppc/processor.h:

#define _GLOBAL(n)\
        .stabs __stringify(n:F-1),N_FUN,0,0,n;\
        .globl n;\
n:

In 2.6.15, as part of the great powerpc merge, we moved this definition to
include/asm-powerpc/ppc_asm.h, where it appears (to 32-bit code) as:

#define _GLOBAL(n)      \
        .text;          \
        .stabs __stringify(n:F-1),N_FUN,0,0,n;\
        .globl n;       \
n:

Mostly, this is fine.  However, we also have the following, in
arch/ppc/boot/common/util.S:

        .section ".relocate_code","xa"
[...]
_GLOBAL(flush_instruction_cache)
[...]
_GLOBAL(flush_data_cache)
[...]

The addition of the .text section definition in the definition of
_GLOBAL overrides the .relocate_code section definition.  As a result,
these two functions don't end up in .relocate_code, so they don't get
relocated correctly, and the boot fails.

There's another suspicious-looking usage at kernel/swsusp.S:37 that
someone should look into.  I did not exhaustively search the source
tree, though.

The following is the minimal patch that fixes the immediate problem.
I could easily be convinced that the _GLOBAL definition should be
modified to remove the ".text;" line either instead of, or in addition
to, this fix.

Signed-off-by: Paul Janzen <pcj@linux.sez.to>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 15:47:08 +11:00
..
Makefile Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
bootinfo.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
crt0.S Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
misc-common.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
ns16550.c [PATCH] ppc32: In the boot code, don't rely on BASE_BAUD directly 2005-09-09 13:57:29 -07:00
serial_stub.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
string.S Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
util.S [PATCH] ppc32: Put cache flush routines back into .relocate_code section 2006-01-09 15:47:08 +11:00