From: Tom Rini <trini@kernel.crashing.org>
To: Paul Janzen <pcj@linux.sez.to>
Cc: paulus@samba.org, linuxppc-embedded@ozlabs.org
Subject: Re: [PATCH] boot/common/util.S: Put flush_{instruction, data}_cache back in .relocate_code section
Date: Thu, 5 Jan 2006 08:05:49 -0700 [thread overview]
Message-ID: <20060105150548.GC27215@smtp.west.cox.net> (raw)
In-Reply-To: <oqbqyrp6zj.fsf@merlin.sez.to>
On Wed, Jan 04, 2006 at 09:40:48PM -0800, Paul Janzen wrote:
> 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>
Thanks for tracking this one down. Paul, can you please make sure this
gets to Linus and the stable team? Thanks.
Acked-by: Tom Rini <trini@kernel.crashing.org>
> --- arch/ppc/boot/common/util.S~ 2005-12-24 15:47:48.000000000 -0800
> +++ arch/ppc/boot/common/util.S 2006-01-04 14:07:12.000000000 -0800
> @@ -234,7 +234,8 @@ udelay:
> * First, flush the data cache in case it was enabled and may be
> * holding instructions for copy back.
> */
> -_GLOBAL(flush_instruction_cache)
> + .globl flush_instruction_cache
> +flush_instruction_cache:
> mflr r6
> bl flush_data_cache
>
> @@ -279,7 +280,8 @@ _GLOBAL(flush_instruction_cache)
> * Flush data cache
> * Do this by just reading lots of stuff into the cache.
> */
> -_GLOBAL(flush_data_cache)
> + .globl flush_data_cache
> +flush_data_cache:
> lis r3,cache_flush_buffer@h
> ori r3,r3,cache_flush_buffer@l
> li r4,NUM_CACHE_LINES
>
> -- Paul
--
Tom Rini
http://gate.crashing.org/~trini/
prev parent reply other threads:[~2006-01-05 15:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-05 5:40 [PATCH] boot/common/util.S: Put flush_{instruction, data}_cache back in .relocate_code section Paul Janzen
2006-01-05 15:05 ` Tom Rini [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060105150548.GC27215@smtp.west.cox.net \
--to=trini@kernel.crashing.org \
--cc=linuxppc-embedded@ozlabs.org \
--cc=paulus@samba.org \
--cc=pcj@linux.sez.to \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).