From: Milton Miller <miltonm@bga.com>
To: <linuxppc-dev@ozlabs.org>, Paul Mackerras <paulus@samba.org>
Cc: fastboot@lists.osdl.org, Vivek Goyal <vgoyal@in.ibm.com>
Subject: [PATCH] kexec: send slaves to new kernel earlier
Date: Wed, 11 Apr 2007 03:32:17 -0500 (CDT) [thread overview]
Message-ID: <boot-4-misc-02.miltonm@bga.com> (raw)
In-Reply-To: <boot-4-00.miltonm@bga.com>
Copy the code and start the slaves on their journey to next
kernels spin loop as soon as we copy the kexec image into place.
The kernel doesn't know exactly which slaves are spinning in
kexec_wait. This allows us to pass more than max-cpus to the
next kernel. But it also means that we might leave some behind.
Moving the code here means they have the time it takes us to
clear the hash table to wake up and move on. Moving the code
any earlier would reuqire walking the image description to
search for the code, which could span multiple pages.
Signed-off-by: Milton Miller <miltonm@bga.com>
---
I applied this change while searching for the cause of lost cpus. The actual
cause was a sequence error causing the slaves to attempt to execute invalid
instructions, but it showed the result is bouncing off the kernels ISI
handler scribling on low memory.
Index: kernel/arch/powerpc/kernel/misc_64.S
===================================================================
--- kernel.orig/arch/powerpc/kernel/misc_64.S 2007-04-09 02:25:01.000000000 -0500
+++ kernel/arch/powerpc/kernel/misc_64.S 2007-04-09 02:32:05.000000000 -0500
@@ -606,6 +606,19 @@ _GLOBAL(kexec_sequence)
/* turn off mmu */
bl real_mode
+ /* copy 0x100 bytes starting at start to 0 */
+ li r3,0
+ mr r4,r30 /* start, aka phys mem offset */
+ li r5,0x100
+ li r6,0
+ bl .copy_and_flush /* (dest, src, copy limit, start offset) */
+1: /* assume normal blr return */
+
+ /* release other cpus to the new kernel secondary start at 0x60 */
+ mflr r5
+ li r6,1
+ stw r6,kexec_flag-1b(5)
+
/* clear out hardware hash page table and tlb */
ld r5,0(r27) /* deref function descriptor */
mtctr r5
@@ -636,19 +649,6 @@ _GLOBAL(kexec_sequence)
* are the boot cpu ?????
* other device tree differences (prop sizes, va vs pa, etc)...
*/
-
- /* copy 0x100 bytes starting at start to 0 */
- li r3,0
- mr r4,r30
- li r5,0x100
- li r6,0
- bl .copy_and_flush /* (dest, src, copy limit, start offset) */
-1: /* assume normal blr return */
-
- /* release other cpus to the new kernel secondary start at 0x60 */
- mflr r5
- li r6,1
- stw r6,kexec_flag-1b(5)
mr r3,r25 # my phys cpu
mr r4,r30 # start, aka phys mem offset
mtlr 4
next prev parent reply other threads:[~2007-04-11 8:32 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-11 8:28 [PATCH 0/3+2+8] powerpc zImage kexec Milton Miller
2007-04-11 8:29 ` [PATCH HACK kexec-tools-testing] malloc corruption hack Milton Miller
2007-04-11 8:30 ` [PATCH kexec-tools] ppc64: correct @ha relocation Milton Miller
2007-04-12 3:24 ` Simon Horman
2007-04-12 3:57 ` [Fastboot] " Simon Horman
2007-04-12 8:17 ` Mohan Kumar M
2007-04-13 1:35 ` Simon Horman
2007-04-11 8:30 ` [PATCH kexec-tools] ppc64: use kernels slave loop for purgatory Milton Miller
2007-04-13 1:34 ` Simon Horman
2007-04-11 8:31 ` [PATCH] export retained initrd in debugfs Milton Miller
2007-04-12 6:17 ` Michael Neuling
2007-04-11 8:32 ` Milton Miller [this message]
2007-04-11 8:32 ` [PATCH 1/8] boot: more verbose gunzip error message Milton Miller
2007-04-12 7:46 ` David Gibson
2007-04-11 8:32 ` [PATCH 2/8] bootwrapper: smp support code Milton Miller
2007-04-11 8:32 ` [PATCH 3/8] bootwrapper: occuppied memory ranges Milton Miller
2007-04-11 8:33 ` [PATCH 4/8] bootwrapper: help for 64 bit cpus Milton Miller
2007-04-12 7:43 ` Segher Boessenkool
2007-04-12 8:49 ` Benjamin Herrenschmidt
2007-04-11 8:33 ` [PATCH 5/8] bootwrapper: Add kexec callable zImage wrapper Milton Miller
2007-04-11 8:33 ` [PATCH 6/8] bootwrapper: convert flatdevtree to version 16 Milton Miller
2007-04-11 16:30 ` Scott Wood
2007-04-12 16:56 ` Milton Miller
2007-04-11 8:34 ` [PATCH 7/8] bootwrapper: rtas support Milton Miller
2007-04-11 8:34 ` [PATCH 8/8] bootwrapper: example sreset marshalling Milton Miller
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=boot-4-misc-02.miltonm@bga.com \
--to=miltonm@bga.com \
--cc=fastboot@lists.osdl.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=paulus@samba.org \
--cc=vgoyal@in.ibm.com \
/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).