aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64
diff options
context:
space:
mode:
authorDavid Mosberger-Tang <davidm@hpl.hp.com>2005-04-28 00:17:44 -0400
committerTony Luck <tony.luck@intel.com>2005-04-28 00:17:44 -0400
commit87e522a0f7f8a7a5a1a880517989835c4f09c63e (patch)
tree72a20dd374169677a3b151f1f1168e2654cecc08 /arch/ia64
parent060561ff79b01eea58e6d72abfb8e7580ff21f2a (diff)
[IA64] Schedule ia64_leave_syscall() to read ar.bsp earlier
Reschedule code to read ar.bsp as early as possible. To enable this, don't bother clearing some of the registers when we're returning to kernel stacks. Also, instead of trying to support the pNonSys case (which makes no sense), do a bugcheck instead (with break 0). Finally, remove a clear of r14 which is a left-over from the previous patch. Signed-off-by: David Mosberger-Tang <davidm@hpl.hp.com> Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch/ia64')
-rw-r--r--arch/ia64/kernel/entry.S43
1 files changed, 19 insertions, 24 deletions
diff --git a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S
index 6359d7ffbb7c..d97a07c77a43 100644
--- a/arch/ia64/kernel/entry.S
+++ b/arch/ia64/kernel/entry.S
@@ -694,22 +694,22 @@ ENTRY(ia64_leave_syscall)
694 ld8 r19=[r2],PT(B6)-PT(LOADRS) // load ar.rsc value for "loadrs" 694 ld8 r19=[r2],PT(B6)-PT(LOADRS) // load ar.rsc value for "loadrs"
695 nop.i 0 695 nop.i 0
696 ;; 696 ;;
697 ld8 r23=[r3],PT(R11)-PT(AR_BSPSTORE) // load ar.bspstore (may be garbage) 697 mov r16=ar.bsp // M2 get existing backing store pointer
698 ld8 r18=[r2],PT(R9)-PT(B6) // load b6 698 ld8 r18=[r2],PT(R9)-PT(B6) // load b6
699(p6) and r15=TIF_WORK_MASK,r31 // any work other than TIF_SYSCALL_TRACE? 699(p6) and r15=TIF_WORK_MASK,r31 // any work other than TIF_SYSCALL_TRACE?
700 ;; 700 ;;
701 mov r16=ar.bsp // M2 get existing backing store pointer 701 ld8 r23=[r3],PT(R11)-PT(AR_BSPSTORE) // load ar.bspstore (may be garbage)
702(p6) cmp4.ne.unc p6,p0=r15, r0 // any special work pending? 702(p6) cmp4.ne.unc p6,p0=r15, r0 // any special work pending?
703(p6) br.cond.spnt .work_pending_syscall 703(p6) br.cond.spnt .work_pending_syscall
704 ;; 704 ;;
705 // start restoring the state saved on the kernel stack (struct pt_regs): 705 // start restoring the state saved on the kernel stack (struct pt_regs):
706 ld8 r9=[r2],PT(CR_IPSR)-PT(R9) 706 ld8 r9=[r2],PT(CR_IPSR)-PT(R9)
707 ld8 r11=[r3],PT(CR_IIP)-PT(R11) 707 ld8 r11=[r3],PT(CR_IIP)-PT(R11)
708 nop.i 0 708(pNonSys) break 0 // bug check: we shouldn't be here if pNonSys is TRUE!
709 ;; 709 ;;
710 invala // M0|1 invalidate ALAT 710 invala // M0|1 invalidate ALAT
711 rsm psr.i | psr.ic // M2 initiate turning off of interrupt and interruption collection 711 rsm psr.i | psr.ic // M2 initiate turning off of interrupt and interruption collection
712 nop.i 0 712 cmp.eq p9,p0=r0,r0 // set p9 to indicate that we should restore cr.ifs
713 713
714 ld8 r29=[r2],16 // load cr.ipsr 714 ld8 r29=[r2],16 // load cr.ipsr
715 ld8 r28=[r3],16 // load cr.iip 715 ld8 r28=[r3],16 // load cr.iip
@@ -717,11 +717,11 @@ ENTRY(ia64_leave_syscall)
717 ;; 717 ;;
718 ld8 r30=[r2],16 // M0|1 load cr.ifs 718 ld8 r30=[r2],16 // M0|1 load cr.ifs
719 ld8 r25=[r3],16 // M0|1 load ar.unat 719 ld8 r25=[r3],16 // M0|1 load ar.unat
720 cmp.eq p9,p0=r0,r0 // set p9 to indicate that we should restore cr.ifs 720(pUStk) add r14=IA64_TASK_THREAD_ON_USTACK_OFFSET,r13
721 ;; 721 ;;
722 ld8 r26=[r2],PT(B0)-PT(AR_PFS) // M0|1 load ar.pfs 722 ld8 r26=[r2],PT(B0)-PT(AR_PFS) // M0|1 load ar.pfs
723(pKStk) mov r22=psr // M2 read PSR now that interrupts are disabled 723(pKStk) mov r22=psr // M2 read PSR now that interrupts are disabled
724(pUStk) add r14=IA64_TASK_THREAD_ON_USTACK_OFFSET,r13 724 nop 0
725 ;; 725 ;;
726 ld8 r21=[r2],PT(AR_RNAT)-PT(B0) // load b0 726 ld8 r21=[r2],PT(AR_RNAT)-PT(B0) // load b0
727 ld8 r27=[r3],PT(PR)-PT(AR_RSC) // load ar.rsc 727 ld8 r27=[r3],PT(PR)-PT(AR_RSC) // load ar.rsc
@@ -735,40 +735,35 @@ ENTRY(ia64_leave_syscall)
735 ld8.fill r1=[r3],16 // load r1 735 ld8.fill r1=[r3],16 // load r1
736(pUStk) mov r17=1 736(pUStk) mov r17=1
737 ;; 737 ;;
738 srlz.d // M0 ensure interruption collection is off 738(pUStk) st1 [r14]=r17
739 ld8.fill r13=[r3],16 739 ld8.fill r13=[r3],16
740 mov f8=f0 // clear f8 740 mov f8=f0 // clear f8
741 ;; 741 ;;
742 ld8.fill r12=[r2] // restore r12 (sp) 742 ld8.fill r12=[r2] // restore r12 (sp)
743 mov.m ar.ssd=r0 // M2 clear ar.ssd 743 ld8.fill r15=[r3] // restore r15
744 mov b6=r18 // I0 restore b6 744 mov b6=r18 // I0 restore b6
745 745
746 nop.m 0 746 addl r17=THIS_CPU(ia64_phys_stacked_size_p8),r0
747 mov f9=f0 // clear f9 747 mov f9=f0 // clear f9
748(pKStk) br.cond.dpnt.many skip_rbs_switch
749
750 srlz.d // M0 ensure interruption collection is off
748 shr.u r18=r19,16 // I0|1 get byte size of existing "dirty" partition 751 shr.u r18=r19,16 // I0|1 get byte size of existing "dirty" partition
752 cover // B add current frame into dirty partition and set cr.ifs
749 ;; 753 ;;
750 ld8.fill r15=[r3] // restore r15 754(pUStk) ld4 r17=[r17] // r17 = cpu_data->phys_stacked_size_p8
751(pUStk) st1 [r14]=r17 755 mov r19=ar.bsp // M2 get new backing store pointer
752 addl r3=THIS_CPU(ia64_phys_stacked_size_p8),r0
753 ;;
754(pUStk) ld4 r17=[r3] // r17 = cpu_data->phys_stacked_size_p8
755 mov.m ar.csd=r0 // M2 clear ar.csd
756 mov f10=f0 // clear f10 756 mov f10=f0 // clear f10
757 757
758 nop.m 0 758 nop.m 0
759 movl r14=__kernel_syscall_via_epc // X 759 movl r14=__kernel_syscall_via_epc // X
760 ;; 760 ;;
761 nop.m 0 761 mov.m ar.csd=r0 // M2 clear ar.csd
762 nop.m 0 762 mov.m ar.ccv=r0 // clear ar.ccv
763 mov b7=r14 // I0 clear b7 (hint with __kernel_syscall_via_epc) 763 mov b7=r14 // I0 clear b7 (hint with __kernel_syscall_via_epc)
764 764
765 mov r14=r0 // clear r14 765 mov.m ar.ssd=r0 // M2 clear ar.ssd
766 mov f11=f0 // clear f11 766 mov f11=f0 // clear f11
767(pKStk) br.cond.dpnt.many skip_rbs_switch
768
769
770 mov.m ar.ccv=r0 // clear ar.ccv
771(pNonSys) br.cond.dpnt.many dont_preserve_current_frame
772 br.cond.sptk.many rbs_switch 767 br.cond.sptk.many rbs_switch
773END(ia64_leave_syscall) 768END(ia64_leave_syscall)
774 769
@@ -946,10 +941,10 @@ GLOBAL_ENTRY(ia64_leave_kernel)
946 */ 941 */
947(pNonSys) br.cond.dpnt dont_preserve_current_frame 942(pNonSys) br.cond.dpnt dont_preserve_current_frame
948 943
949rbs_switch:
950 cover // add current frame into dirty partition and set cr.ifs 944 cover // add current frame into dirty partition and set cr.ifs
951 ;; 945 ;;
952 mov r19=ar.bsp // get new backing store pointer 946 mov r19=ar.bsp // get new backing store pointer
947rbs_switch:
953 sub r16=r16,r18 // krbs = old bsp - size of dirty partition 948 sub r16=r16,r18 // krbs = old bsp - size of dirty partition
954 cmp.ne p9,p0=r0,r0 // clear p9 to skip restore of cr.ifs 949 cmp.ne p9,p0=r0,r0 // clear p9 to skip restore of cr.ifs
955 ;; 950 ;;