소스 검색

[POWERPC] Skip the "copy down" of the kernel if it is already at zero.

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>
Jimi Xenidis 19 년 전
부모
커밋
d0b79c54fc
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      arch/powerpc/kernel/head_64.S

+ 3 - 0
arch/powerpc/kernel/head_64.S

@@ -1664,6 +1664,9 @@ _STATIC(__after_prom_start)
 					/*   i.e. where we are running	 */
 					/*   i.e. where we are running	 */
 					/*	the source addr		 */
 					/*	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 */
 	LOAD_REG_IMMEDIATE(r5,copy_to_here) /* # bytes of memory to copy */
 	sub	r5,r5,r27
 	sub	r5,r5,r27