Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
[safe/jmp/linux-2.6] / arch / ia64 / kernel / ivt.S
index 23749ed..179fd12 100644 (file)
@@ -49,7 +49,6 @@
 
 #include <asm/asmmacro.h>
 #include <asm/break.h>
-#include <asm/ia32.h>
 #include <asm/kregs.h>
 #include <asm/asm-offsets.h>
 #include <asm/pgtable.h>
@@ -515,27 +514,6 @@ ENTRY(ikey_miss)
        FAULT(6)
 END(ikey_miss)
 
-       //-----------------------------------------------------------------------------------
-       // call do_page_fault (predicates are in r31, psr.dt may be off, r16 is faulting address)
-ENTRY(page_fault)
-       SSM_PSR_DT_AND_SRLZ_I
-       ;;
-       SAVE_MIN_WITH_COVER
-       alloc r15=ar.pfs,0,0,3,0
-       MOV_FROM_IFA(out0)
-       MOV_FROM_ISR(out1)
-       SSM_PSR_IC_AND_DEFAULT_BITS_AND_SRLZ_I(r14, r3)
-       adds r3=8,r2                            // set up second base pointer
-       SSM_PSR_I(p15, p15, r14)                // restore psr.i
-       movl r14=ia64_leave_kernel
-       ;;
-       SAVE_REST
-       mov rp=r14
-       ;;
-       adds out2=16,r12                        // out2 = pointer to pt_regs
-       br.call.sptk.many b6=ia64_do_page_fault // ignore return address
-END(page_fault)
-
        .org ia64_ivt+0x1c00
 /////////////////////////////////////////////////////////////////////////////////////////
 // 0x1c00 Entry 7 (size 64 bundles) Data Key Miss (12,51)
@@ -601,7 +579,7 @@ ENTRY(dirty_bit)
        mov b0=r29                              // restore b0
        ;;
        st8 [r17]=r18                           // store back updated PTE
-       itc.d r18                               // install updated PTE
+       ITC_D(p0, r18, r16)                     // install updated PTE
 #endif
        mov pr=r31,-1                           // restore pr
        RFI
@@ -667,7 +645,7 @@ ENTRY(iaccess_bit)
        mov b0=r29                              // restore b0
        ;;
        st8 [r17]=r18                           // store back updated PTE
-       itc.i r18                               // install updated PTE
+       ITC_I(p0, r18, r16)                     // install updated PTE
 #endif /* !CONFIG_SMP */
        mov pr=r31,-1
        RFI
@@ -719,7 +697,7 @@ ENTRY(daccess_bit)
        or r18=_PAGE_A,r18                      // set the accessed bit
        ;;
        st8 [r17]=r18                           // store back updated PTE
-       itc.d r18                               // install updated PTE
+       ITC_D(p0, r18, r16)                     // install updated PTE
 #endif
        mov b0=r29                              // restore b0
        mov pr=r31,-1
@@ -825,7 +803,7 @@ ENTRY(break_fault)
 ///////////////////////////////////////////////////////////////////////
        st1 [r16]=r0                            // M2|3 clear current->thread.on_ustack flag
 #ifdef CONFIG_VIRT_CPU_ACCOUNTING
-       mov.m r30=ar.itc                        // M    get cycle for accounting
+       MOV_FROM_ITC(p0, p14, r30, r18)         // M    get cycle for accounting
 #else
        mov b6=r30                              // I0   setup syscall handler branch reg early
 #endif
@@ -896,26 +874,8 @@ END(break_fault)
 /////////////////////////////////////////////////////////////////////////////////////////
 // 0x3000 Entry 12 (size 64 bundles) External Interrupt (4)
 ENTRY(interrupt)
-       DBG_FAULT(12)
-       mov r31=pr              // prepare to save predicates
-       ;;
-       SAVE_MIN_WITH_COVER     // uses r31; defines r2 and r3
-       SSM_PSR_IC_AND_DEFAULT_BITS_AND_SRLZ_I(r3, r14)
-                               // ensure everybody knows psr.ic is back on
-       adds r3=8,r2            // set up second base pointer for SAVE_REST
-       ;;
-       SAVE_REST
-       ;;
-       MCA_RECOVER_RANGE(interrupt)
-       alloc r14=ar.pfs,0,0,2,0 // must be first in an insn group
-       MOV_FROM_IVR(out0, r8)  // pass cr.ivr as first arg
-       add out1=16,sp          // pass pointer to pt_regs as second arg
-       ;;
-       srlz.d                  // make sure we see the effect of cr.ivr
-       movl r14=ia64_leave_kernel
-       ;;
-       mov rp=r14
-       br.call.sptk.many b6=ia64_handle_irq
+       /* interrupt handler has become too big to fit this area. */
+       br.sptk.many __interrupt
 END(interrupt)
 
        .org ia64_ivt+0x3400
@@ -1125,105 +1085,18 @@ END(account_sys_enter)
        DBG_FAULT(17)
        FAULT(17)
 
-ENTRY(non_syscall)
-       mov ar.rsc=r27                  // restore ar.rsc before SAVE_MIN_WITH_COVER
-       ;;
-       SAVE_MIN_WITH_COVER
-
-       // There is no particular reason for this code to be here, other than that
-       // there happens to be space here that would go unused otherwise.  If this
-       // fault ever gets "unreserved", simply moved the following code to a more
-       // suitable spot...
-
-       alloc r14=ar.pfs,0,0,2,0
-       MOV_FROM_IIM(out0)
-       add out1=16,sp
-       adds r3=8,r2                    // set up second base pointer for SAVE_REST
-
-       SSM_PSR_IC_AND_DEFAULT_BITS_AND_SRLZ_I(r15, r24)
-                                       // guarantee that interruption collection is on
-       SSM_PSR_I(p15, p15, r15)        // restore psr.i
-       movl r15=ia64_leave_kernel
-       ;;
-       SAVE_REST
-       mov rp=r15
-       ;;
-       br.call.sptk.many b6=ia64_bad_break     // avoid WAW on CFM and ignore return addr
-END(non_syscall)
-
        .org ia64_ivt+0x4800
 /////////////////////////////////////////////////////////////////////////////////////////
 // 0x4800 Entry 18 (size 64 bundles) Reserved
        DBG_FAULT(18)
        FAULT(18)
 
-       /*
-        * There is no particular reason for this code to be here, other than that
-        * there happens to be space here that would go unused otherwise.  If this
-        * fault ever gets "unreserved", simply moved the following code to a more
-        * suitable spot...
-        */
-
-ENTRY(dispatch_unaligned_handler)
-       SAVE_MIN_WITH_COVER
-       ;;
-       alloc r14=ar.pfs,0,0,2,0                // now it's safe (must be first in insn group!)
-       MOV_FROM_IFA(out0)
-       adds out1=16,sp
-
-       SSM_PSR_IC_AND_DEFAULT_BITS_AND_SRLZ_I(r3, r24)
-                                               // guarantee that interruption collection is on
-       SSM_PSR_I(p15, p15, r3)                 // restore psr.i
-       adds r3=8,r2                            // set up second base pointer
-       ;;
-       SAVE_REST
-       movl r14=ia64_leave_kernel
-       ;;
-       mov rp=r14
-       br.sptk.many ia64_prepare_handle_unaligned
-END(dispatch_unaligned_handler)
-
        .org ia64_ivt+0x4c00
 /////////////////////////////////////////////////////////////////////////////////////////
 // 0x4c00 Entry 19 (size 64 bundles) Reserved
        DBG_FAULT(19)
        FAULT(19)
 
-       /*
-        * There is no particular reason for this code to be here, other than that
-        * there happens to be space here that would go unused otherwise.  If this
-        * fault ever gets "unreserved", simply moved the following code to a more
-        * suitable spot...
-        */
-
-ENTRY(dispatch_to_fault_handler)
-       /*
-        * Input:
-        *      psr.ic: off
-        *      r19:    fault vector number (e.g., 24 for General Exception)
-        *      r31:    contains saved predicates (pr)
-        */
-       SAVE_MIN_WITH_COVER_R19
-       alloc r14=ar.pfs,0,0,5,0
-       MOV_FROM_ISR(out1)
-       MOV_FROM_IFA(out2)
-       MOV_FROM_IIM(out3)
-       MOV_FROM_ITIR(out4)
-       ;;
-       SSM_PSR_IC_AND_DEFAULT_BITS_AND_SRLZ_I(r3, out0)
-                                               // guarantee that interruption collection is on
-       mov out0=r15
-       ;;
-       SSM_PSR_I(p15, p15, r3)                 // restore psr.i
-       adds r3=8,r2                            // set up second base pointer for SAVE_REST
-       ;;
-       SAVE_REST
-       movl r14=ia64_leave_kernel
-       ;;
-       mov rp=r14
-       br.call.sptk.many b6=ia64_fault
-END(dispatch_to_fault_handler)
-
 //
 // --- End of long entries, Beginning of short entries
 //
@@ -1369,11 +1242,11 @@ ENTRY(speculation_vector)
 
        add r17=r17,r18                 // now add the offset
        ;;
-       MOV_FROM_IIP(r17)
+       MOV_TO_IIP(r17, r19)
        dep r16=0,r16,41,2              // clear EI
        ;;
 
-       MOV_FROM_IPSR(p0, r16)
+       MOV_TO_IPSR(p0, r16, r19)
        ;;
 
        RFI
@@ -1512,28 +1385,6 @@ END(ia32_exception)
 // 0x6a00 Entry 46 (size 16 bundles) IA-32 Intercept  (30,31,59,70,71)
 ENTRY(ia32_intercept)
        DBG_FAULT(46)
-#ifdef CONFIG_IA32_SUPPORT
-       mov r31=pr
-       MOV_FROM_ISR(r16)
-       ;;
-       extr.u r17=r16,16,8     // get ISR.code
-       mov r18=ar.eflag
-       MOV_FROM_IIM(r19)       // old eflag value
-       ;;
-       cmp.ne p6,p0=2,r17
-(p6)   br.cond.spnt 1f         // not a system flag fault
-       xor r16=r18,r19
-       ;;
-       extr.u r17=r16,18,1     // get the eflags.ac bit
-       ;;
-       cmp.eq p6,p0=0,r17
-(p6)   br.cond.spnt 1f         // eflags.ac bit didn't change
-       ;;
-       mov pr=r31,-1           // restore predicate registers
-       RFI
-
-1:
-#endif // CONFIG_IA32_SUPPORT
        FAULT(46)
 END(ia32_intercept)
 
@@ -1542,12 +1393,7 @@ END(ia32_intercept)
 // 0x6b00 Entry 47 (size 16 bundles) IA-32 Interrupt  (74)
 ENTRY(ia32_interrupt)
        DBG_FAULT(47)
-#ifdef CONFIG_IA32_SUPPORT
-       mov r31=pr
-       br.sptk.many dispatch_to_ia32_handler
-#else
        FAULT(47)
-#endif
 END(ia32_interrupt)
 
        .org ia64_ivt+0x6c00
@@ -1670,6 +1516,137 @@ END(ia32_interrupt)
        DBG_FAULT(67)
        FAULT(67)
 
+       //-----------------------------------------------------------------------------------
+       // call do_page_fault (predicates are in r31, psr.dt may be off, r16 is faulting address)
+ENTRY(page_fault)
+       SSM_PSR_DT_AND_SRLZ_I
+       ;;
+       SAVE_MIN_WITH_COVER
+       alloc r15=ar.pfs,0,0,3,0
+       MOV_FROM_IFA(out0)
+       MOV_FROM_ISR(out1)
+       SSM_PSR_IC_AND_DEFAULT_BITS_AND_SRLZ_I(r14, r3)
+       adds r3=8,r2                            // set up second base pointer
+       SSM_PSR_I(p15, p15, r14)                // restore psr.i
+       movl r14=ia64_leave_kernel
+       ;;
+       SAVE_REST
+       mov rp=r14
+       ;;
+       adds out2=16,r12                        // out2 = pointer to pt_regs
+       br.call.sptk.many b6=ia64_do_page_fault // ignore return address
+END(page_fault)
+
+ENTRY(non_syscall)
+       mov ar.rsc=r27                  // restore ar.rsc before SAVE_MIN_WITH_COVER
+       ;;
+       SAVE_MIN_WITH_COVER
+
+       // There is no particular reason for this code to be here, other than that
+       // there happens to be space here that would go unused otherwise.  If this
+       // fault ever gets "unreserved", simply moved the following code to a more
+       // suitable spot...
+
+       alloc r14=ar.pfs,0,0,2,0
+       MOV_FROM_IIM(out0)
+       add out1=16,sp
+       adds r3=8,r2                    // set up second base pointer for SAVE_REST
+
+       SSM_PSR_IC_AND_DEFAULT_BITS_AND_SRLZ_I(r15, r24)
+                                       // guarantee that interruption collection is on
+       SSM_PSR_I(p15, p15, r15)        // restore psr.i
+       movl r15=ia64_leave_kernel
+       ;;
+       SAVE_REST
+       mov rp=r15
+       ;;
+       br.call.sptk.many b6=ia64_bad_break     // avoid WAW on CFM and ignore return addr
+END(non_syscall)
+
+ENTRY(__interrupt)
+       DBG_FAULT(12)
+       mov r31=pr              // prepare to save predicates
+       ;;
+       SAVE_MIN_WITH_COVER     // uses r31; defines r2 and r3
+       SSM_PSR_IC_AND_DEFAULT_BITS_AND_SRLZ_I(r3, r14)
+                               // ensure everybody knows psr.ic is back on
+       adds r3=8,r2            // set up second base pointer for SAVE_REST
+       ;;
+       SAVE_REST
+       ;;
+       MCA_RECOVER_RANGE(interrupt)
+       alloc r14=ar.pfs,0,0,2,0 // must be first in an insn group
+       MOV_FROM_IVR(out0, r8)  // pass cr.ivr as first arg
+       add out1=16,sp          // pass pointer to pt_regs as second arg
+       ;;
+       srlz.d                  // make sure we see the effect of cr.ivr
+       movl r14=ia64_leave_kernel
+       ;;
+       mov rp=r14
+       br.call.sptk.many b6=ia64_handle_irq
+END(__interrupt)
+
+       /*
+        * There is no particular reason for this code to be here, other than that
+        * there happens to be space here that would go unused otherwise.  If this
+        * fault ever gets "unreserved", simply moved the following code to a more
+        * suitable spot...
+        */
+
+ENTRY(dispatch_unaligned_handler)
+       SAVE_MIN_WITH_COVER
+       ;;
+       alloc r14=ar.pfs,0,0,2,0                // now it's safe (must be first in insn group!)
+       MOV_FROM_IFA(out0)
+       adds out1=16,sp
+
+       SSM_PSR_IC_AND_DEFAULT_BITS_AND_SRLZ_I(r3, r24)
+                                               // guarantee that interruption collection is on
+       SSM_PSR_I(p15, p15, r3)                 // restore psr.i
+       adds r3=8,r2                            // set up second base pointer
+       ;;
+       SAVE_REST
+       movl r14=ia64_leave_kernel
+       ;;
+       mov rp=r14
+       br.sptk.many ia64_prepare_handle_unaligned
+END(dispatch_unaligned_handler)
+
+       /*
+        * There is no particular reason for this code to be here, other than that
+        * there happens to be space here that would go unused otherwise.  If this
+        * fault ever gets "unreserved", simply moved the following code to a more
+        * suitable spot...
+        */
+
+ENTRY(dispatch_to_fault_handler)
+       /*
+        * Input:
+        *      psr.ic: off
+        *      r19:    fault vector number (e.g., 24 for General Exception)
+        *      r31:    contains saved predicates (pr)
+        */
+       SAVE_MIN_WITH_COVER_R19
+       alloc r14=ar.pfs,0,0,5,0
+       MOV_FROM_ISR(out1)
+       MOV_FROM_IFA(out2)
+       MOV_FROM_IIM(out3)
+       MOV_FROM_ITIR(out4)
+       ;;
+       SSM_PSR_IC_AND_DEFAULT_BITS_AND_SRLZ_I(r3, out0)
+                                               // guarantee that interruption collection is on
+       mov out0=r15
+       ;;
+       SSM_PSR_I(p15, p15, r3)                 // restore psr.i
+       adds r3=8,r2                            // set up second base pointer for SAVE_REST
+       ;;
+       SAVE_REST
+       movl r14=ia64_leave_kernel
+       ;;
+       mov rp=r14
+       br.call.sptk.many b6=ia64_fault
+END(dispatch_to_fault_handler)
+
        /*
         * Squatting in this space ...
         *
@@ -1710,89 +1687,3 @@ ENTRY(dispatch_illegal_op_fault)
 (p6)   br.call.dpnt.many b6=b6         // call returns to ia64_leave_kernel
        br.sptk.many ia64_leave_kernel
 END(dispatch_illegal_op_fault)
-
-#ifdef CONFIG_IA32_SUPPORT
-
-       /*
-        * There is no particular reason for this code to be here, other than that
-        * there happens to be space here that would go unused otherwise.  If this
-        * fault ever gets "unreserved", simply moved the following code to a more
-        * suitable spot...
-        */
-
-       // IA32 interrupt entry point
-
-ENTRY(dispatch_to_ia32_handler)
-       SAVE_MIN
-       ;;
-       MOV_FROM_ISR(r14)
-       SSM_PSR_IC_AND_DEFAULT_BITS_AND_SRLZ_I(r3, r24)
-                               // guarantee that interruption collection is on
-       ;;
-       SSM_PSR_I(p15, p15, r3)
-       adds r3=8,r2            // Base pointer for SAVE_REST
-       ;;
-       SAVE_REST
-       ;;
-       mov r15=0x80
-       shr r14=r14,16          // Get interrupt number
-       ;;
-       cmp.ne p6,p0=r14,r15
-(p6)   br.call.dpnt.many b6=non_ia32_syscall
-
-       adds r14=IA64_PT_REGS_R8_OFFSET + 16,sp // 16 byte hole per SW conventions
-       adds r15=IA64_PT_REGS_R1_OFFSET + 16,sp
-       ;;
-       cmp.eq pSys,pNonSys=r0,r0 // set pSys=1, pNonSys=0
-       ld8 r8=[r14]            // get r8
-       ;;
-       st8 [r15]=r8            // save original EAX in r1 (IA32 procs don't use the GP)
-       ;;
-       alloc r15=ar.pfs,0,0,6,0        // must first in an insn group
-       ;;
-       ld4 r8=[r14],8          // r8 == eax (syscall number)
-       mov r15=IA32_NR_syscalls
-       ;;
-       cmp.ltu.unc p6,p7=r8,r15
-       ld4 out1=[r14],8        // r9 == ecx
-       ;;
-       ld4 out2=[r14],8        // r10 == edx
-       ;;
-       ld4 out0=[r14]          // r11 == ebx
-       adds r14=(IA64_PT_REGS_R13_OFFSET) + 16,sp
-       ;;
-       ld4 out5=[r14],PT(R14)-PT(R13)  // r13 == ebp
-       ;;
-       ld4 out3=[r14],PT(R15)-PT(R14)  // r14 == esi
-       adds r2=TI_FLAGS+IA64_TASK_SIZE,r13
-       ;;
-       ld4 out4=[r14]          // r15 == edi
-       movl r16=ia32_syscall_table
-       ;;
-(p6)   shladd r16=r8,3,r16     // force ni_syscall if not valid syscall number
-       ld4 r2=[r2]             // r2 = current_thread_info()->flags
-       ;;
-       ld8 r16=[r16]
-       and r2=_TIF_SYSCALL_TRACEAUDIT,r2       // mask trace or audit
-       ;;
-       mov b6=r16
-       movl r15=ia32_ret_from_syscall
-       cmp.eq p8,p0=r2,r0
-       ;;
-       mov rp=r15
-(p8)   br.call.sptk.many b6=b6
-       br.cond.sptk ia32_trace_syscall
-
-non_ia32_syscall:
-       alloc r15=ar.pfs,0,0,2,0
-       mov out0=r14                            // interrupt #
-       add out1=16,sp                          // pointer to pt_regs
-       ;;                      // avoid WAW on CFM
-       br.call.sptk.many rp=ia32_bad_interrupt
-.ret1: movl r15=ia64_leave_kernel
-       ;;
-       mov rp=r15
-       br.ret.sptk.many rp
-END(dispatch_to_ia32_handler)
-
-#endif /* CONFIG_IA32_SUPPORT */