[POWERPC] Skip the "copy down" of the kernel if it is already at zero.
authorJimi Xenidis <jimix@watson.ibm.com>
Mon, 26 Jun 2006 08:56:58 +0000 (04:56 -0400)
committerPaul Mackerras <paulus@samba.org>
Wed, 28 Jun 2006 05:18:53 +0000 (15:18 +1000)
This patch allows the kernel to recognized that it was loaded at zero
and the copy down of the image is unnecessary.  This is useful for
Simulators and kexec models.
On a typical 3.8 MiB vmlinux.strip this saves about 2.3 million instructions.

Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/kernel/head_64.S

index da09242934964a34a3c5f2f1789c20bf026c5a62..f2fab687a01c52b7014d6a951032b24733ef7527 100644 (file)
@@ -1664,6 +1664,9 @@ _STATIC(__after_prom_start)
                                        /*   i.e. where we are running   */
                                        /*      the source addr          */
 
+       cmpdi   r4,0                    /* In some cases the loader may  */
+       beq     .start_here_multiplatform /* have already put us at zero */
+                                       /* so we can skip the copy.      */
        LOAD_REG_IMMEDIATE(r5,copy_to_here) /* # bytes of memory to copy */
        sub     r5,r5,r27