From: Geoff Levand <geoffrey.levand@am.sony.com>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [PATCH 3/3] zImage: Cleanup and improve zImage entry point
Date: Mon, 19 Feb 2007 07:14:08 -0800 [thread overview]
Message-ID: <45D9BEC0.1060909@am.sony.com> (raw)
In-Reply-To: <20070218072310.GB1859@localhost.localdomain>
David Gibson wrote:
> On Sat, Feb 17, 2007 at 05:22:24PM -0800, Geoff Levand wrote:
>> David Gibson wrote:
>> > Index: working-2.6/arch/powerpc/boot/crt0.S
>> > @@ -59,6 +60,29 @@ _zimage_start:
>> > sync
>> > isync
>> >
>> > - mr r6,r1
>> > - b start
>> > + /* Possibly set up a custom stack */
>> > +.weak _platform_stack_top
>> > + lis r8,_platform_stack_top@ha
>> > + addi r8,r8,_platform_stack_top@l
>> > + cmpwi r8,0
>> > + beq 5f
>> > + lwz r1,0(r8)
>>
>> > +5:
>> > +
>> > + /* Clear the BSS */
>> > + lis r9,__bss_start@ha
>> > + addi r9,r9,__bss_start@l
>> > + lis r8,_end@ha
>> > + addi r8,r8,_end@l
>> > + li r0,0
>> > +6: stw r0,0(r9)
>> > + addi r9,r9,4
>> > + cmplw cr0,r9,r8
>> > + blt 6b
>>
>>
>> This messed me up a bit since I had two stacks in the bss, one for each
>> processor thread. By the time this was called on the primary thread the
>> secondary thread could already be using its stack. I changed the secondary
>> thread to use a small stack in the data section, so this seems OK.
>
> Hrm... if you're entering with multiple threads and stacks, you're
> probably a prime candidate for providing your own zimage_start,
> instead of using this code.
I think the better idea is to make the generic bootwrapper code support
SMP. I don't see any fundamental reason why it can't. The trouble here
is that your BSS stack is really not a proper way, that's why it doesn't
work.
I'll put something together that provides generic (SMP) stack support
for the bootwrapper. I'll be away the end of this week and next week,
so I don't know when I'll be able to post it.
-Geoff
next prev parent reply other threads:[~2007-02-19 15:14 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-16 6:24 [0/3] RFC: Cleanups and improvements to the zImage wrapper David Gibson
2007-02-16 6:27 ` [PATCH 3/3] zImage: Cleanup and improve zImage entry point David Gibson
2007-02-18 1:22 ` Geoff Levand
2007-02-18 7:23 ` David Gibson
2007-02-19 0:26 ` Paul Mackerras
2007-02-19 0:48 ` David Gibson
2007-02-19 15:14 ` Geoff Levand [this message]
2007-02-19 19:59 ` Benjamin Herrenschmidt
2007-02-19 19:57 ` Benjamin Herrenschmidt
2007-02-19 20:37 ` Geoff Levand
2007-02-19 20:50 ` Benjamin Herrenschmidt
2007-02-19 21:14 ` Geoff Levand
2007-02-16 6:27 ` [PATCH 1/3] zImage: Add more flexible gunzip convenience functions David Gibson
2007-02-16 6:27 ` [PATCH 2/3] zImage: Cleanup and improve prep_kernel() David Gibson
2007-02-18 1:22 ` Geoff Levand
2007-02-18 7:21 ` David Gibson
2007-02-16 16:47 ` [0/3] RFC: Cleanups and improvements to the zImage wrapper Geoff Levand
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=45D9BEC0.1060909@am.sony.com \
--to=geoffrey.levand@am.sony.com \
--cc=david@gibson.dropbear.id.au \
--cc=linuxppc-dev@ozlabs.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.