powerpc/64s: Consolidate FP Unavailable 0x800 interrupt
authorNicholas Piggin <npiggin@gmail.com>
Wed, 21 Sep 2016 07:43:39 +0000 (17:43 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 4 Oct 2016 02:07:01 +0000 (13:07 +1100)
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kernel/exceptions-64s.S

index 1df0283a5b3ea12e4501ff3bd8167873b8ab9c68..ac727633cbb1fa2b6e118baf411a264f3c9e8f21 100644 (file)
@@ -804,8 +804,37 @@ EXC_COMMON_BEGIN(program_check_common)
 
 
 EXC_REAL(fp_unavailable, 0x800, 0x900)
-
+EXC_VIRT(fp_unavailable, 0x4800, 0x4900, 0x800)
 TRAMP_KVM(PACA_EXGEN, 0x800)
+EXC_COMMON_BEGIN(fp_unavailable_common)
+       EXCEPTION_PROLOG_COMMON(0x800, PACA_EXGEN)
+       bne     1f                      /* if from user, just load it up */
+       bl      save_nvgprs
+       RECONCILE_IRQ_STATE(r10, r11)
+       addi    r3,r1,STACK_FRAME_OVERHEAD
+       bl      kernel_fp_unavailable_exception
+       BUG_OPCODE
+1:
+#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
+BEGIN_FTR_SECTION
+       /* Test if 2 TM state bits are zero.  If non-zero (ie. userspace was in
+        * transaction), go do TM stuff
+        */
+       rldicl. r0, r12, (64-MSR_TS_LG), (64-2)
+       bne-    2f
+END_FTR_SECTION_IFSET(CPU_FTR_TM)
+#endif
+       bl      load_up_fpu
+       b       fast_exception_return
+#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
+2:     /* User process was in a transaction */
+       bl      save_nvgprs
+       RECONCILE_IRQ_STATE(r10, r11)
+       addi    r3,r1,STACK_FRAME_OVERHEAD
+       bl      fp_unavailable_tm
+       b       ret_from_except
+#endif
+
 
 EXC_REAL_MASKABLE(decrementer, 0x900, 0x980)
 
@@ -1205,7 +1234,6 @@ EXC_COMMON(altivec_assist_common, 0x1700, unknown_exception)
         * come here.
         */
 
-EXC_VIRT(fp_unavailable, 0x4800, 0x4900, 0x800)
 EXC_VIRT_MASKABLE(decrementer, 0x4900, 0x4980, 0x900)
 EXC_VIRT_HV(hdecrementer, 0x4980, 0x4a00, 0x980)
 EXC_VIRT_MASKABLE(doorbell_super, 0x4a00, 0x4b00, 0xa00)
@@ -1288,35 +1316,6 @@ EXC_COMMON_BEGIN(h_data_storage_common)
 
 EXC_COMMON(h_instr_storage_common, 0xe20, unknown_exception)
 
-EXC_COMMON_BEGIN(fp_unavailable_common)
-       EXCEPTION_PROLOG_COMMON(0x800, PACA_EXGEN)
-       bne     1f                      /* if from user, just load it up */
-       bl      save_nvgprs
-       RECONCILE_IRQ_STATE(r10, r11)
-       addi    r3,r1,STACK_FRAME_OVERHEAD
-       bl      kernel_fp_unavailable_exception
-       BUG_OPCODE
-1:
-#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
-BEGIN_FTR_SECTION
-       /* Test if 2 TM state bits are zero.  If non-zero (ie. userspace was in
-        * transaction), go do TM stuff
-        */
-       rldicl. r0, r12, (64-MSR_TS_LG), (64-2)
-       bne-    2f
-END_FTR_SECTION_IFSET(CPU_FTR_TM)
-#endif
-       bl      load_up_fpu
-       b       fast_exception_return
-#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
-2:     /* User process was in a transaction */
-       bl      save_nvgprs
-       RECONCILE_IRQ_STATE(r10, r11)
-       addi    r3,r1,STACK_FRAME_OVERHEAD
-       bl      fp_unavailable_tm
-       b       ret_from_except
-#endif
-
 EXC_COMMON_BEGIN(altivec_unavailable_common)
        EXCEPTION_PROLOG_COMMON(0xf20, PACA_EXGEN)
 #ifdef CONFIG_ALTIVEC