android_kernel_xiaomi_sm8350/arch/ppc/boot
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
..
common [PATCH] ppc32: Put cache flush routines back into .relocate_code section 2006-01-09 15:47:08 +11:00
images [PATCH] powerpc: Fix suboptimal uImage target 2006-01-09 14:50:25 +11:00
include ppc/powerpc: workarounds for old Open Firmware versions 2005-11-10 12:00:55 +11:00
lib Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
of1275 ppc/powerpc: workarounds for old Open Firmware versions 2005-11-10 12:00:55 +11:00
openfirmware [PATCH] powerpc: Consolidate asm compatibility macros 2005-11-10 13:10:38 +11:00
simple [PATCH] ppc32: Re-add embed_config.c to ml300/ep405 2006-01-06 08:33:31 -08:00
utils [PATCH] Remove NACA fixed address constraint 2005-08-29 10:53:33 +10:00
ld.script [PATCH] ppc32 ld.script fix for building on ppc64 2005-09-29 08:46:27 -07:00
Makefile Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00