Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
[cascardo/linux.git] / arch / powerpc / kernel / misc_64.S
index 8b52684..4f17867 100644 (file)
@@ -67,7 +67,7 @@ PPC64_CACHES:
  *   flush all bytes from start through stop-1 inclusive
  */
 
-_KPROBE(flush_icache_range)
+_GLOBAL(flush_icache_range)
 BEGIN_FTR_SECTION
        PURGE_PREFETCHED_INS
        blr
@@ -110,8 +110,9 @@ END_FTR_SECTION_IFSET(CPU_FTR_COHERENT_ICACHE)
        bdnz    2b
        isync
        blr
-       .previous .text
+_ASM_NOKPROBE_SYMBOL(flush_icache_range)
 EXPORT_SYMBOL(flush_icache_range)
+
 /*
  * Like above, but only do the D-cache.
  *
@@ -595,7 +596,8 @@ real_mode:  /* assume normal blr return */
 #endif
 
 /*
- * kexec_sequence(newstack, start, image, control, clear_all())
+ * kexec_sequence(newstack, start, image, control, clear_all(),
+                 copy_with_mmu_off)
  *
  * does the grungy work with stack switching and real mode switches
  * also does simple calls to other code
@@ -631,7 +633,7 @@ _GLOBAL(kexec_sequence)
        mr      r29,r5                  /* image (virt) */
        mr      r28,r6                  /* control, unused */
        mr      r27,r7                  /* clear_all() fn desc */
-       mr      r26,r8                  /* spare */
+       mr      r26,r8                  /* copy_with_mmu_off */
        lhz     r25,PACAHWCPUID(r13)    /* get our phys cpu from paca */
 
        /* disable interrupts, we are overwriting kernel data next */
@@ -643,15 +645,24 @@ _GLOBAL(kexec_sequence)
        mtmsrd  r3,1
 #endif
 
+       /* We need to turn the MMU off unless we are in hash mode
+        * under a hypervisor
+        */
+       cmpdi   r26,0
+       beq     1f
+       bl      real_mode
+1:
        /* copy dest pages, flush whole dest image */
        mr      r3,r29
        bl      kexec_copy_flush        /* (image) */
 
-       /* turn off mmu */
+       /* turn off mmu now if not done earlier */
+       cmpdi   r26,0
+       bne     1f
        bl      real_mode
 
        /* copy  0x100 bytes starting at start to 0 */
-       li      r3,0
+1:     li      r3,0
        mr      r4,r30          /* start, aka phys mem offset */
        li      r5,0x100
        li      r6,0
@@ -663,7 +674,9 @@ _GLOBAL(kexec_sequence)
        li      r6,1
        stw     r6,kexec_flag-1b(5)
 
-#ifndef CONFIG_PPC_BOOK3E
+       cmpdi   r27,0
+       beq     1f
+
        /* clear out hardware hash page table and tlb */
 #ifdef PPC64_ELF_ABI_v1
        ld      r12,0(r27)              /* deref function descriptor */
@@ -672,7 +685,6 @@ _GLOBAL(kexec_sequence)
 #endif
        mtctr   r12
        bctrl                           /* mmu_hash_ops.hpte_clear_all(void); */
-#endif /* !CONFIG_PPC_BOOK3E */
 
 /*
  *   kexec image calling is:
@@ -699,7 +711,7 @@ _GLOBAL(kexec_sequence)
  *    are the boot cpu ?????
  *    other device tree differences (prop sizes, va vs pa, etc)...
  */
-       mr      r3,r25  # my phys cpu
+1:     mr      r3,r25  # my phys cpu
        mr      r4,r30  # start, aka phys mem offset
        mtlr    4
        li      r5,0