Merge branch 'master'
[sfrench/cifs-2.6.git] / arch / powerpc / kernel / head_64.S
index 3082684663428bffc0483a1995dc78b69cc3cc7d..9b65029dd2a32a4ea0ac17facfcbfda7eb8987d3 100644 (file)
@@ -139,7 +139,7 @@ _GLOBAL(__secondary_hold)
        ori     r24,r24,MSR_RI
        mtmsrd  r24                     /* RI on */
 
-       /* Grab our linux cpu number */
+       /* Grab our physical cpu number */
        mr      r24,r3
 
        /* Tell the master cpu we're here */
@@ -153,12 +153,7 @@ _GLOBAL(__secondary_hold)
        cmpdi   0,r4,1
        bne     100b
 
-#ifdef CONFIG_HMT
-       SET_REG_IMMEDIATE(r4, .hmt_init)
-       mtctr   r4
-       bctr
-#else
-#ifdef CONFIG_SMP
+#if defined(CONFIG_SMP) || defined(CONFIG_KEXEC)
        LOAD_REG_IMMEDIATE(r4, .pSeries_secondary_smp_init)
        mtctr   r4
        mr      r3,r24
@@ -166,7 +161,6 @@ _GLOBAL(__secondary_hold)
 #else
        BUG_OPCODE
 #endif
-#endif
 
 /* This value is used to mark exception frames on the stack. */
        .section ".toc","aw"
@@ -321,7 +315,6 @@ exception_marker:
 label##_pSeries:                                       \
        HMT_MEDIUM;                                     \
        mtspr   SPRN_SPRG1,r13;         /* save r13 */  \
-       RUNLATCH_ON(r13);                               \
        EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, label##_common)
 
 #define STD_EXCEPTION_ISERIES(n, label, area)          \
@@ -329,7 +322,6 @@ label##_pSeries:                                    \
 label##_iSeries:                                       \
        HMT_MEDIUM;                                     \
        mtspr   SPRN_SPRG1,r13;         /* save r13 */  \
-       RUNLATCH_ON(r13);                               \
        EXCEPTION_PROLOG_ISERIES_1(area);               \
        EXCEPTION_PROLOG_ISERIES_2;                     \
        b       label##_common
@@ -339,7 +331,6 @@ label##_iSeries:                                    \
 label##_iSeries:                                                       \
        HMT_MEDIUM;                                                     \
        mtspr   SPRN_SPRG1,r13;         /* save r13 */                  \
-       RUNLATCH_ON(r13);                                               \
        EXCEPTION_PROLOG_ISERIES_1(PACA_EXGEN);                         \
        lbz     r10,PACAPROCENABLED(r13);                               \
        cmpwi   0,r10,0;                                                \
@@ -392,6 +383,7 @@ label##_common:                                             \
 label##_common:                                                \
        EXCEPTION_PROLOG_COMMON(trap, PACA_EXGEN);      \
        DISABLE_INTS;                                   \
+       bl      .ppc64_runlatch_on;                     \
        addi    r3,r1,STACK_FRAME_OVERHEAD;             \
        bl      hdlr;                                   \
        b       .ret_from_except_lite
@@ -409,7 +401,6 @@ __start_interrupts:
 _machine_check_pSeries:
        HMT_MEDIUM
        mtspr   SPRN_SPRG1,r13          /* save r13 */
-       RUNLATCH_ON(r13)
        EXCEPTION_PROLOG_PSERIES(PACA_EXMC, machine_check_common)
 
        . = 0x300
@@ -436,7 +427,6 @@ END_FTR_SECTION_IFCLR(CPU_FTR_SLB)
 data_access_slb_pSeries:
        HMT_MEDIUM
        mtspr   SPRN_SPRG1,r13
-       RUNLATCH_ON(r13)
        mfspr   r13,SPRN_SPRG3          /* get paca address into r13 */
        std     r3,PACA_EXSLB+EX_R3(r13)
        mfspr   r3,SPRN_DAR
@@ -462,7 +452,6 @@ data_access_slb_pSeries:
 instruction_access_slb_pSeries:
        HMT_MEDIUM
        mtspr   SPRN_SPRG1,r13
-       RUNLATCH_ON(r13)
        mfspr   r13,SPRN_SPRG3          /* get paca address into r13 */
        std     r3,PACA_EXSLB+EX_R3(r13)
        mfspr   r3,SPRN_SRR0            /* SRR0 is faulting address */
@@ -493,7 +482,6 @@ instruction_access_slb_pSeries:
        .globl  system_call_pSeries
 system_call_pSeries:
        HMT_MEDIUM
-       RUNLATCH_ON(r9)
        mr      r9,r13
        mfmsr   r10
        mfspr   r13,SPRN_SPRG3
@@ -577,7 +565,6 @@ slb_miss_user_pseries:
 system_reset_fwnmi:
        HMT_MEDIUM
        mtspr   SPRN_SPRG1,r13          /* save r13 */
-       RUNLATCH_ON(r13)
        EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, system_reset_common)
 
        .globl machine_check_fwnmi
@@ -585,7 +572,6 @@ system_reset_fwnmi:
 machine_check_fwnmi:
        HMT_MEDIUM
        mtspr   SPRN_SPRG1,r13          /* save r13 */
-       RUNLATCH_ON(r13)
        EXCEPTION_PROLOG_PSERIES(PACA_EXMC, machine_check_common)
 
 #ifdef CONFIG_PPC_ISERIES
@@ -749,11 +735,12 @@ iSeries_secondary_smp_loop:
 
        .globl decrementer_iSeries_masked
 decrementer_iSeries_masked:
+       /* We may not have a valid TOC pointer in here. */
        li      r11,1
        ld      r12,PACALPPACAPTR(r13)
        stb     r11,LPPACADECRINT(r12)
-       LOAD_REG_ADDRBASE(r12,tb_ticks_per_jiffy)
-       lwz     r12,ADDROFF(tb_ticks_per_jiffy)(r12)
+       LOAD_REG_IMMEDIATE(r12, tb_ticks_per_jiffy)
+       lwz     r12,0(r12)
        mtspr   SPRN_DEC,r12
        /* fall through */
 
@@ -895,7 +882,6 @@ unrecov_fer:
        .align  7
        .globl data_access_common
 data_access_common:
-       RUNLATCH_ON(r10)                /* It wont fit in the 0x300 handler */
        mfspr   r10,SPRN_DAR
        std     r10,PACA_EXGEN+EX_DAR(r13)
        mfspr   r10,SPRN_DSISR
@@ -1043,6 +1029,7 @@ hardware_interrupt_common:
        EXCEPTION_PROLOG_COMMON(0x500, PACA_EXGEN)
 hardware_interrupt_entry:
        DISABLE_INTS
+       bl      .ppc64_runlatch_on
        addi    r3,r1,STACK_FRAME_OVERHEAD
        bl      .do_IRQ
        b       .ret_from_except_lite
@@ -1550,6 +1537,9 @@ _STATIC(__boot_from_prom)
        mr      r28,r6
        mr      r27,r7
 
+       /* Align the stack to 16-byte boundary for broken yaboot */
+       rldicr  r1,r1,0,59
+
        /* Make sure we are running in 64 bits mode */
        bl      .enable_64b_mode
 
@@ -1817,22 +1807,6 @@ _STATIC(start_here_multiplatform)
        ori     r6,r6,MSR_RI
        mtmsrd  r6                      /* RI on */
 
-#ifdef CONFIG_HMT
-       /* Start up the second thread on cpu 0 */
-       mfspr   r3,SPRN_PVR
-       srwi    r3,r3,16
-       cmpwi   r3,0x34                 /* Pulsar  */
-       beq     90f
-       cmpwi   r3,0x36                 /* Icestar */
-       beq     90f
-       cmpwi   r3,0x37                 /* SStar   */
-       beq     90f
-       b       91f                     /* HMT not supported */
-90:    li      r3,0
-       bl      .hmt_start_secondary
-91:
-#endif
-
        /* The following gets the stack and TOC set up with the regs */
        /* pointing to the real addr of the kernel stack.  This is   */
        /* all done to support the C function call below which sets  */
@@ -1946,77 +1920,8 @@ _STATIC(start_here_common)
 
        bl .start_kernel
 
-_GLOBAL(hmt_init)
-#ifdef CONFIG_HMT
-       LOAD_REG_IMMEDIATE(r5, hmt_thread_data)
-       mfspr   r7,SPRN_PVR
-       srwi    r7,r7,16
-       cmpwi   r7,0x34                 /* Pulsar  */
-       beq     90f
-       cmpwi   r7,0x36                 /* Icestar */
-       beq     91f
-       cmpwi   r7,0x37                 /* SStar   */
-       beq     91f
-       b       101f
-90:    mfspr   r6,SPRN_PIR
-       andi.   r6,r6,0x1f
-       b       92f
-91:    mfspr   r6,SPRN_PIR
-       andi.   r6,r6,0x3ff
-92:    sldi    r4,r24,3
-       stwx    r6,r5,r4
-       bl      .hmt_start_secondary
-       b       101f
-
-__hmt_secondary_hold:
-       LOAD_REG_IMMEDIATE(r5, hmt_thread_data)
-       clrldi  r5,r5,4
-       li      r7,0
-       mfspr   r6,SPRN_PIR
-       mfspr   r8,SPRN_PVR
-       srwi    r8,r8,16
-       cmpwi   r8,0x34
-       bne     93f
-       andi.   r6,r6,0x1f
-       b       103f
-93:    andi.   r6,r6,0x3f
-
-103:   lwzx    r8,r5,r7
-       cmpw    r8,r6
-       beq     104f
-       addi    r7,r7,8
-       b       103b
-
-104:   addi    r7,r7,4
-       lwzx    r9,r5,r7
-       mr      r24,r9
-101:
-#endif
-       mr      r3,r24
-       b       .pSeries_secondary_smp_init
-
-#ifdef CONFIG_HMT
-_GLOBAL(hmt_start_secondary)
-       LOAD_REG_IMMEDIATE(r4,__hmt_secondary_hold)
-       clrldi  r4,r4,4
-       mtspr   SPRN_NIADORM, r4
-       mfspr   r4, SPRN_MSRDORM
-       li      r5, -65
-       and     r4, r4, r5
-       mtspr   SPRN_MSRDORM, r4
-       lis     r4,0xffef
-       ori     r4,r4,0x7403
-       mtspr   SPRN_TSC, r4
-       li      r4,0x1f4
-       mtspr   SPRN_TST, r4
-       mfspr   r4, SPRN_HID0
-       ori     r4, r4, 0x1
-       mtspr   SPRN_HID0, r4
-       mfspr   r4, SPRN_CTRLF
-       oris    r4, r4, 0x40
-       mtspr   SPRN_CTRLT, r4
-       blr
-#endif
+       /* Not reached */
+       BUG_OPCODE
 
 /*
  * We put a few things here that have to be page-aligned.