2005-04-17 02:20:36 +04:00
/ *
* arch/ i a64 / k e r n e l / i v t . S
*
2005-04-28 08:17:03 +04:00
* Copyright ( C ) 1 9 9 8 - 2 0 0 1 , 2 0 0 3 , 2 0 0 5 H e w l e t t - P a c k a r d C o
2005-04-17 02:20:36 +04:00
* Stephane E r a n i a n < e r a n i a n @hpl.hp.com>
* David M o s b e r g e r < d a v i d m @hpl.hp.com>
* Copyright ( C ) 2 0 0 0 , 2 0 0 2 - 2 0 0 3 I n t e l C o
* Asit M a l l i c k < a s i t . k . m a l l i c k @intel.com>
* Suresh S i d d h a < s u r e s h . b . s i d d h a @intel.com>
* Kenneth C h e n < k e n n e t h . w . c h e n @intel.com>
* Fenghua Y u < f e n g h u a . y u @intel.com>
*
* 0 0 / 0 8 / 2 3 Asit M a l l i c k < a s i t . k . m a l l i c k @intel.com> TLB handling for SMP
* 0 0 / 1 2 / 2 0 David M o s b e r g e r - T a n g < d a v i d m @hpl.hp.com> DTLB/ITLB handler now uses virtual PT.
2008-05-19 17:13:38 +04:00
*
* Copyright ( C ) 2 0 0 5 H e w l e t t - P a c k a r d C o
* Dan M a g e n h e i m e r < d a n . m a g e n h e i m e r @hp.com>
* Xen p a r a v i r t u a l i z a t i o n
* Copyright ( c ) 2 0 0 8 I s a k u Y a m a h a t a < y a m a h a t a a t v a l i n u x c o j p >
* VA L i n u x S y s t e m s J a p a n K . K .
* pv_ o p s .
* Yaozu ( E d d i e ) D o n g < e d d i e . d o n g @intel.com>
2005-04-17 02:20:36 +04:00
* /
/ *
* This f i l e d e f i n e s t h e i n t e r r u p t i o n v e c t o r t a b l e u s e d b y t h e C P U .
* It d o e s n o t i n c l u d e o n e e n t r y p e r p o s s i b l e c a u s e o f i n t e r r u p t i o n .
*
* The f i r s t 2 0 e n t r i e s o f t h e t a b l e c o n t a i n 6 4 b u n d l e s e a c h w h i l e t h e
* remaining 4 8 e n t r i e s c o n t a i n o n l y 1 6 b u n d l e s e a c h .
*
* The 6 4 b u n d l e s a r e u s e d t o a l l o w i n l i n i n g t h e w h o l e h a n d l e r f o r c r i t i c a l
* interruptions l i k e T L B m i s s e s .
*
* For e a c h e n t r y , t h e c o m m e n t i s a s f o l l o w s :
*
* / / 0 x1 c00 E n t r y 7 ( s i z e 6 4 b u n d l e s ) D a t a K e y M i s s ( 1 2 ,5 1 )
* entry o f f s e t - - - - / / / / /
* entry n u m b e r - - - - - - - - - / / / /
* size o f t h e e n t r y - - - - - - - - - - - - - / / /
* vector n a m e - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - / /
* interruptions t r i g g e r i n g t h i s v e c t o r - - - - - - - - - - - - - - - - - - - - - - /
*
* The t a b l e i s 3 2 K B i n s i z e a n d m u s t b e a l i g n e d o n 3 2 K B b o u n d a r y .
* ( The C P U i g n o r e s t h e 1 5 l o w e r b i t s o f t h e a d d r e s s )
*
* Table i s b a s e d u p o n E A S 2 . 6 ( O c t 1 9 9 9 )
* /
# include < a s m / a s m m a c r o . h >
# include < a s m / b r e a k . h >
# include < a s m / i a32 . h >
# include < a s m / k r e g s . h >
2005-09-10 00:03:13 +04:00
# include < a s m / a s m - o f f s e t s . h >
2005-04-17 02:20:36 +04:00
# include < a s m / p g t a b l e . h >
# include < a s m / p r o c e s s o r . h >
# include < a s m / p t r a c e . h >
# include < a s m / s y s t e m . h >
# include < a s m / t h r e a d _ i n f o . h >
# include < a s m / u n i s t d . h >
# include < a s m / e r r n o . h >
# if 1
# define P S R _ D E F A U L T _ B I T S p s r . a c
# else
# define P S R _ D E F A U L T _ B I T S 0
# endif
# if 0
/ *
* This l e t s y o u t r a c k t h e l a s t e i g h t f a u l t s t h a t o c c u r r e d o n t h e C P U . M a k e s u r e a r . k 2 i s n ' t
* needed f o r s o m e t h i n g e l s e b e f o r e e n a b l i n g t h i s . . .
* /
# define D B G _ F A U L T ( i ) m o v r16 =ar . k 2 ;; shl r16=r16,8;; add r16=(i),r16;;mov ar.k2=r16
# else
# define D B G _ F A U L T ( i )
# endif
# include " m i n s t a t e . h "
# define F A U L T ( n ) \
mov r31 =pr ; \
mov r19 =n ;; /* prepare to save predicates */ \
br. s p t k . m a n y d i s p a t c h _ t o _ f a u l t _ h a n d l e r
.section .text .ivt , " ax"
.align 32768 / / align o n 3 2 K B b o u n d a r y
.global ia64_ivt
ia64_ivt :
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x0 0 0 0 E n t r y 0 ( s i z e 6 4 b u n d l e s ) V H P T T r a n s l a t i o n ( 8 ,2 0 ,4 7 )
ENTRY( v h p t _ m i s s )
DBG_ F A U L T ( 0 )
/ *
* The V H P T v e c t o r i s i n v o k e d w h e n t h e T L B e n t r y f o r t h e v i r t u a l p a g e t a b l e
* is m i s s i n g . T h i s h a p p e n s o n l y a s a r e s u l t o f a p r e v i o u s
* ( the " o r i g i n a l " ) T L B m i s s , w h i c h m a y e i t h e r b e c a u s e d b y a n i n s t r u c t i o n
* fetch o r a d a t a a c c e s s ( o r n o n - a c c e s s ) .
*
[IA64] polish comments for tlb fault handler in ivt.S
Polish the comments specifically in vhpt_miss and nested_dtlb_miss
handlers. I think it's better to explicitly name each page table
level with its name instead of numerically name them. i.e., use
pgd, pud, pmd, and pte instead of referring as L1, L2, L3 etc.
Along the line, remove some magic number in the comments like:
"PTA + (((IFA(61,63) << 7) | IFA(33,39))*8)". No code change at
all, pure comment update. Feel free to shoot anything you have,
darts or tomahawk cruise missile. I will duck behind a bunker ;-)
Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
Acked-by: Robin Holt <holt@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2005-11-17 12:55:34 +03:00
* What w e d o h e r e i s n o r m a l T L B m i s s h a n d i n g f o r t h e _ o r i g i n a l _ m i s s ,
* followed b y i n s e r t i n g t h e T L B e n t r y f o r t h e v i r t u a l p a g e t a b l e p a g e
* that t h e V H P T w a l k e r w a s a t t e m p t i n g t o a c c e s s . T h e l a t t e r g e t s
* inserted a s l o n g a s p a g e t a b l e e n t r y a b o v e p t e l e v e l h a v e v a l i d
* mappings f o r t h e f a u l t i n g a d d r e s s . T h e T L B e n t r y f o r t h e o r i g i n a l
* miss g e t s i n s e r t e d o n l y i f t h e p t e e n t r y i n d i c a t e s t h a t t h e p a g e i s
* present.
2005-04-17 02:20:36 +04:00
*
* do_ p a g e _ f a u l t g e t s i n v o k e d i n t h e f o l l o w i n g c a s e s :
* - the f a u l t i n g v i r t u a l a d d r e s s u s e s u n i m p l e m e n t e d a d d r e s s b i t s
[IA64] polish comments for tlb fault handler in ivt.S
Polish the comments specifically in vhpt_miss and nested_dtlb_miss
handlers. I think it's better to explicitly name each page table
level with its name instead of numerically name them. i.e., use
pgd, pud, pmd, and pte instead of referring as L1, L2, L3 etc.
Along the line, remove some magic number in the comments like:
"PTA + (((IFA(61,63) << 7) | IFA(33,39))*8)". No code change at
all, pure comment update. Feel free to shoot anything you have,
darts or tomahawk cruise missile. I will duck behind a bunker ;-)
Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
Acked-by: Robin Holt <holt@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2005-11-17 12:55:34 +03:00
* - the f a u l t i n g v i r t u a l a d d r e s s h a s n o v a l i d p a g e t a b l e m a p p i n g
2005-04-17 02:20:36 +04:00
* /
2008-05-19 17:13:38 +04:00
MOV_ F R O M _ I F A ( r16 ) / / g e t a d d r e s s t h a t c a u s e d t h e T L B m i s s
2005-04-17 02:20:36 +04:00
# ifdef C O N F I G _ H U G E T L B _ P A G E
movl r18 =PAGE_SHIFT
2008-05-19 17:13:38 +04:00
MOV_ F R O M _ I T I R ( r25 )
2005-04-17 02:20:36 +04:00
# endif
;;
2008-05-19 17:13:38 +04:00
RSM_ P S R _ D T / / u s e p h y s i c a l a d d r e s s i n g f o r d a t a
2005-04-17 02:20:36 +04:00
mov r31 =pr / / s a v e t h e p r e d i c a t e r e g i s t e r s
mov r19 =IA64_KR ( P T _ B A S E ) / / g e t p a g e t a b l e b a s e a d d r e s s
shl r21 =r16 ,3 / / s h i f t b i t 6 0 i n t o s i g n b i t
shr. u r17 =r16 ,6 1 / / g e t t h e r e g i o n n u m b e r i n t o r17
;;
2005-11-11 18:35:43 +03:00
shr. u r22 =r21 ,3
2005-04-17 02:20:36 +04:00
# ifdef C O N F I G _ H U G E T L B _ P A G E
extr. u r26 =r25 ,2 ,6
;;
cmp. n e p8 ,p0 =r18 ,r26
sub r27 =r26 ,r18
;;
( p8 ) d e p r25 =r18 ,r25 ,2 ,6
( p8 ) s h r r22 =r22 ,r27
# endif
;;
cmp. e q p6 ,p7 =5 ,r17 / / i s I F A p o i n t i n g i n t o t o r e g i o n 5 ?
[IA64] polish comments for tlb fault handler in ivt.S
Polish the comments specifically in vhpt_miss and nested_dtlb_miss
handlers. I think it's better to explicitly name each page table
level with its name instead of numerically name them. i.e., use
pgd, pud, pmd, and pte instead of referring as L1, L2, L3 etc.
Along the line, remove some magic number in the comments like:
"PTA + (((IFA(61,63) << 7) | IFA(33,39))*8)". No code change at
all, pure comment update. Feel free to shoot anything you have,
darts or tomahawk cruise missile. I will duck behind a bunker ;-)
Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
Acked-by: Robin Holt <holt@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2005-11-17 12:55:34 +03:00
shr. u r18 =r22 ,P G D I R _ S H I F T / / g e t b o t t o m p o r t i o n o f p g d i n d e x b i t
2005-04-17 02:20:36 +04:00
;;
( p7 ) d e p r17 =r17 ,r19 ,( P A G E _ S H I F T - 3 ) ,3 / / p u t r e g i o n n u m b e r b i t s i n p l a c e
srlz. d
LOAD_ P H Y S I C A L ( p6 , r19 , s w a p p e r _ p g _ d i r ) / / r e g i o n 5 i s r o o t e d a t s w a p p e r _ p g _ d i r
.pred .rel " mutex" , p6 , p7
( p6 ) s h r . u r21 =r21 ,P G D I R _ S H I F T + P A G E _ S H I F T
( p7 ) s h r . u r21 =r21 ,P G D I R _ S H I F T + P A G E _ S H I F T - 3
;;
[IA64] polish comments for tlb fault handler in ivt.S
Polish the comments specifically in vhpt_miss and nested_dtlb_miss
handlers. I think it's better to explicitly name each page table
level with its name instead of numerically name them. i.e., use
pgd, pud, pmd, and pte instead of referring as L1, L2, L3 etc.
Along the line, remove some magic number in the comments like:
"PTA + (((IFA(61,63) << 7) | IFA(33,39))*8)". No code change at
all, pure comment update. Feel free to shoot anything you have,
darts or tomahawk cruise missile. I will duck behind a bunker ;-)
Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
Acked-by: Robin Holt <holt@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2005-11-17 12:55:34 +03:00
( p6 ) d e p r17 =r18 ,r19 ,3 ,( P A G E _ S H I F T - 3 ) / / r17 =pgd_offset f o r r e g i o n 5
( p7 ) d e p r17 =r18 ,r17 ,3 ,( P A G E _ S H I F T - 6 ) / / r17 =pgd_offset f o r r e g i o n [ 0 - 4 ]
2005-04-17 02:20:36 +04:00
cmp. e q p7 ,p6 =0 ,r21 / / u n u s e d a d d r e s s b i t s a l l z e r o e s ?
2005-11-11 18:35:43 +03:00
# ifdef C O N F I G _ P G T A B L E _ 4
[IA64] polish comments for tlb fault handler in ivt.S
Polish the comments specifically in vhpt_miss and nested_dtlb_miss
handlers. I think it's better to explicitly name each page table
level with its name instead of numerically name them. i.e., use
pgd, pud, pmd, and pte instead of referring as L1, L2, L3 etc.
Along the line, remove some magic number in the comments like:
"PTA + (((IFA(61,63) << 7) | IFA(33,39))*8)". No code change at
all, pure comment update. Feel free to shoot anything you have,
darts or tomahawk cruise missile. I will duck behind a bunker ;-)
Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
Acked-by: Robin Holt <holt@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2005-11-17 12:55:34 +03:00
shr. u r28 =r22 ,P U D _ S H I F T / / s h i f t p u d i n d e x i n t o p o s i t i o n
2005-11-11 18:35:43 +03:00
# else
[IA64] polish comments for tlb fault handler in ivt.S
Polish the comments specifically in vhpt_miss and nested_dtlb_miss
handlers. I think it's better to explicitly name each page table
level with its name instead of numerically name them. i.e., use
pgd, pud, pmd, and pte instead of referring as L1, L2, L3 etc.
Along the line, remove some magic number in the comments like:
"PTA + (((IFA(61,63) << 7) | IFA(33,39))*8)". No code change at
all, pure comment update. Feel free to shoot anything you have,
darts or tomahawk cruise missile. I will duck behind a bunker ;-)
Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
Acked-by: Robin Holt <holt@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2005-11-17 12:55:34 +03:00
shr. u r18 =r22 ,P M D _ S H I F T / / s h i f t p m d i n d e x i n t o p o s i t i o n
2005-11-11 18:35:43 +03:00
# endif
2005-04-17 02:20:36 +04:00
;;
[IA64] polish comments for tlb fault handler in ivt.S
Polish the comments specifically in vhpt_miss and nested_dtlb_miss
handlers. I think it's better to explicitly name each page table
level with its name instead of numerically name them. i.e., use
pgd, pud, pmd, and pte instead of referring as L1, L2, L3 etc.
Along the line, remove some magic number in the comments like:
"PTA + (((IFA(61,63) << 7) | IFA(33,39))*8)". No code change at
all, pure comment update. Feel free to shoot anything you have,
darts or tomahawk cruise missile. I will duck behind a bunker ;-)
Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
Acked-by: Robin Holt <holt@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2005-11-17 12:55:34 +03:00
ld8 r17 = [ r17 ] / / g e t * p g d ( m a y b e 0 )
2005-04-17 02:20:36 +04:00
;;
[IA64] polish comments for tlb fault handler in ivt.S
Polish the comments specifically in vhpt_miss and nested_dtlb_miss
handlers. I think it's better to explicitly name each page table
level with its name instead of numerically name them. i.e., use
pgd, pud, pmd, and pte instead of referring as L1, L2, L3 etc.
Along the line, remove some magic number in the comments like:
"PTA + (((IFA(61,63) << 7) | IFA(33,39))*8)". No code change at
all, pure comment update. Feel free to shoot anything you have,
darts or tomahawk cruise missile. I will duck behind a bunker ;-)
Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
Acked-by: Robin Holt <holt@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2005-11-17 12:55:34 +03:00
( p7 ) c m p . e q p6 ,p7 =r17 ,r0 / / w a s p g d _ p r e s e n t ( * p g d ) = = N U L L ?
2005-11-11 18:35:43 +03:00
# ifdef C O N F I G _ P G T A B L E _ 4
[IA64] polish comments for tlb fault handler in ivt.S
Polish the comments specifically in vhpt_miss and nested_dtlb_miss
handlers. I think it's better to explicitly name each page table
level with its name instead of numerically name them. i.e., use
pgd, pud, pmd, and pte instead of referring as L1, L2, L3 etc.
Along the line, remove some magic number in the comments like:
"PTA + (((IFA(61,63) << 7) | IFA(33,39))*8)". No code change at
all, pure comment update. Feel free to shoot anything you have,
darts or tomahawk cruise missile. I will duck behind a bunker ;-)
Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
Acked-by: Robin Holt <holt@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2005-11-17 12:55:34 +03:00
dep r28 =r28 ,r17 ,3 ,( P A G E _ S H I F T - 3 ) / / r28 =pud_offset ( p g d ,a d d r )
2005-11-11 18:35:43 +03:00
;;
[IA64] polish comments for tlb fault handler in ivt.S
Polish the comments specifically in vhpt_miss and nested_dtlb_miss
handlers. I think it's better to explicitly name each page table
level with its name instead of numerically name them. i.e., use
pgd, pud, pmd, and pte instead of referring as L1, L2, L3 etc.
Along the line, remove some magic number in the comments like:
"PTA + (((IFA(61,63) << 7) | IFA(33,39))*8)". No code change at
all, pure comment update. Feel free to shoot anything you have,
darts or tomahawk cruise missile. I will duck behind a bunker ;-)
Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
Acked-by: Robin Holt <holt@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2005-11-17 12:55:34 +03:00
shr. u r18 =r22 ,P M D _ S H I F T / / s h i f t p m d i n d e x i n t o p o s i t i o n
( p7 ) l d8 r29 = [ r28 ] / / g e t * p u d ( m a y b e 0 )
2005-04-17 02:20:36 +04:00
;;
[IA64] polish comments for tlb fault handler in ivt.S
Polish the comments specifically in vhpt_miss and nested_dtlb_miss
handlers. I think it's better to explicitly name each page table
level with its name instead of numerically name them. i.e., use
pgd, pud, pmd, and pte instead of referring as L1, L2, L3 etc.
Along the line, remove some magic number in the comments like:
"PTA + (((IFA(61,63) << 7) | IFA(33,39))*8)". No code change at
all, pure comment update. Feel free to shoot anything you have,
darts or tomahawk cruise missile. I will duck behind a bunker ;-)
Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
Acked-by: Robin Holt <holt@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2005-11-17 12:55:34 +03:00
( p7 ) c m p . e q . o r . a n d c m p6 ,p7 =r29 ,r0 / / w a s p u d _ p r e s e n t ( * p u d ) = = N U L L ?
dep r17 =r18 ,r29 ,3 ,( P A G E _ S H I F T - 3 ) / / r17 =pmd_offset ( p u d ,a d d r )
2005-11-11 18:35:43 +03:00
# else
[IA64] polish comments for tlb fault handler in ivt.S
Polish the comments specifically in vhpt_miss and nested_dtlb_miss
handlers. I think it's better to explicitly name each page table
level with its name instead of numerically name them. i.e., use
pgd, pud, pmd, and pte instead of referring as L1, L2, L3 etc.
Along the line, remove some magic number in the comments like:
"PTA + (((IFA(61,63) << 7) | IFA(33,39))*8)". No code change at
all, pure comment update. Feel free to shoot anything you have,
darts or tomahawk cruise missile. I will duck behind a bunker ;-)
Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
Acked-by: Robin Holt <holt@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2005-11-17 12:55:34 +03:00
dep r17 =r18 ,r17 ,3 ,( P A G E _ S H I F T - 3 ) / / r17 =pmd_offset ( p g d ,a d d r )
2005-11-11 18:35:43 +03:00
# endif
2005-04-17 02:20:36 +04:00
;;
[IA64] polish comments for tlb fault handler in ivt.S
Polish the comments specifically in vhpt_miss and nested_dtlb_miss
handlers. I think it's better to explicitly name each page table
level with its name instead of numerically name them. i.e., use
pgd, pud, pmd, and pte instead of referring as L1, L2, L3 etc.
Along the line, remove some magic number in the comments like:
"PTA + (((IFA(61,63) << 7) | IFA(33,39))*8)". No code change at
all, pure comment update. Feel free to shoot anything you have,
darts or tomahawk cruise missile. I will duck behind a bunker ;-)
Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
Acked-by: Robin Holt <holt@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2005-11-17 12:55:34 +03:00
( p7 ) l d8 r20 = [ r17 ] / / g e t * p m d ( m a y b e 0 )
shr. u r19 =r22 ,P A G E _ S H I F T / / s h i f t p t e i n d e x i n t o p o s i t i o n
2005-04-17 02:20:36 +04:00
;;
[IA64] polish comments for tlb fault handler in ivt.S
Polish the comments specifically in vhpt_miss and nested_dtlb_miss
handlers. I think it's better to explicitly name each page table
level with its name instead of numerically name them. i.e., use
pgd, pud, pmd, and pte instead of referring as L1, L2, L3 etc.
Along the line, remove some magic number in the comments like:
"PTA + (((IFA(61,63) << 7) | IFA(33,39))*8)". No code change at
all, pure comment update. Feel free to shoot anything you have,
darts or tomahawk cruise missile. I will duck behind a bunker ;-)
Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
Acked-by: Robin Holt <holt@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2005-11-17 12:55:34 +03:00
( p7 ) c m p . e q . o r . a n d c m p6 ,p7 =r20 ,r0 / / w a s p m d _ p r e s e n t ( * p m d ) = = N U L L ?
dep r21 =r19 ,r20 ,3 ,( P A G E _ S H I F T - 3 ) / / r21 =pte_offset ( p m d ,a d d r )
2005-11-11 18:35:43 +03:00
;;
[IA64] polish comments for tlb fault handler in ivt.S
Polish the comments specifically in vhpt_miss and nested_dtlb_miss
handlers. I think it's better to explicitly name each page table
level with its name instead of numerically name them. i.e., use
pgd, pud, pmd, and pte instead of referring as L1, L2, L3 etc.
Along the line, remove some magic number in the comments like:
"PTA + (((IFA(61,63) << 7) | IFA(33,39))*8)". No code change at
all, pure comment update. Feel free to shoot anything you have,
darts or tomahawk cruise missile. I will duck behind a bunker ;-)
Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
Acked-by: Robin Holt <holt@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2005-11-17 12:55:34 +03:00
( p7 ) l d8 r18 = [ r21 ] / / r e a d * p t e
2008-05-19 17:13:38 +04:00
MOV_ F R O M _ I S R ( r19 ) / / c r . i s r b i t 3 2 t e l l s u s i f t h i s i s a n i n s n m i s s
2005-04-17 02:20:36 +04:00
;;
( p7 ) t b i t . z p6 ,p7 =r18 ,_ P A G E _ P _ B I T / / p a g e p r e s e n t b i t c l e a r e d ?
2008-05-19 17:13:38 +04:00
MOV_ F R O M _ I H A ( r22 ) / / g e t t h e V H P T a d d r e s s t h a t c a u s e d t h e T L B m i s s
2005-04-17 02:20:36 +04:00
;; // avoid RAW on p7
( p7 ) t b i t . n z . u n c p10 ,p11 =r19 ,3 2 / / i s i t a n i n s t r u c t i o n T L B m i s s ?
dep r23 =0 ,r20 ,0 ,P A G E _ S H I F T / / c l e a r l o w b i t s t o g e t p a g e a d d r e s s
;;
2008-05-19 17:13:38 +04:00
ITC_ I _ A N D _ D ( p10 , p11 , r18 , r24 ) / / i n s e r t t h e i n s t r u c t i o n T L B e n t r y a n d
/ / insert t h e d a t a T L B e n t r y
2005-04-17 02:20:36 +04:00
( p6 ) b r . c o n d . s p n t . m a n y p a g e _ f a u l t / / h a n d l e b a d a d d r e s s / p a g e n o t p r e s e n t ( p a g e f a u l t )
2008-05-19 17:13:38 +04:00
MOV_ T O _ I F A ( r22 , r24 )
2005-04-17 02:20:36 +04:00
# ifdef C O N F I G _ H U G E T L B _ P A G E
2008-05-19 17:13:38 +04:00
MOV_ T O _ I T I R ( p8 , r25 , r24 ) / / c h a n g e t o d e f a u l t p a g e - s i z e f o r V H P T
2005-04-17 02:20:36 +04:00
# endif
/ *
* Now c o m p u t e a n d i n s e r t t h e T L B e n t r y f o r t h e v i r t u a l p a g e t a b l e . W e n e v e r
* execute i n a p a g e t a b l e p a g e s o t h e r e i s n o n e e d t o s e t t h e e x c e p t i o n d e f e r r a l
* bit.
* /
adds r24 =__DIRTY_BITS_NO_ED | _ P A G E _ P L _ 0 | _ P A G E _ A R _ R W ,r23
;;
2008-05-19 17:13:38 +04:00
ITC_ D ( p7 , r24 , r25 )
2005-04-17 02:20:36 +04:00
;;
# ifdef C O N F I G _ S M P
/ *
* Tell t h e a s s e m b l e r s d e p e n d e n c y - v i o l a t i o n c h e c k e r t h a t t h e a b o v e " i t c " i n s t r u c t i o n s
* cannot p o s s i b l y a f f e c t t h e f o l l o w i n g l o a d s :
* /
dv_ s e r i a l i z e _ d a t a
/ *
[IA64] polish comments for tlb fault handler in ivt.S
Polish the comments specifically in vhpt_miss and nested_dtlb_miss
handlers. I think it's better to explicitly name each page table
level with its name instead of numerically name them. i.e., use
pgd, pud, pmd, and pte instead of referring as L1, L2, L3 etc.
Along the line, remove some magic number in the comments like:
"PTA + (((IFA(61,63) << 7) | IFA(33,39))*8)". No code change at
all, pure comment update. Feel free to shoot anything you have,
darts or tomahawk cruise missile. I will duck behind a bunker ;-)
Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
Acked-by: Robin Holt <holt@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2005-11-17 12:55:34 +03:00
* Re- c h e c k p a g e t a b l e e n t r y . I f t h e y c h a n g e d , w e m a y h a v e r e c e i v e d a p t c . g
2005-04-17 02:20:36 +04:00
* between r e a d i n g t h e p a g e t a b l e a n d t h e " i t c " . I f s o , f l u s h t h e e n t r y w e
[IA64] polish comments for tlb fault handler in ivt.S
Polish the comments specifically in vhpt_miss and nested_dtlb_miss
handlers. I think it's better to explicitly name each page table
level with its name instead of numerically name them. i.e., use
pgd, pud, pmd, and pte instead of referring as L1, L2, L3 etc.
Along the line, remove some magic number in the comments like:
"PTA + (((IFA(61,63) << 7) | IFA(33,39))*8)". No code change at
all, pure comment update. Feel free to shoot anything you have,
darts or tomahawk cruise missile. I will duck behind a bunker ;-)
Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
Acked-by: Robin Holt <holt@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2005-11-17 12:55:34 +03:00
* inserted a n d r e t r y . A t t h i s p o i n t , w e h a v e :
*
* r2 8 = e q u i v a l e n t o f p u d _ o f f s e t ( p g d , i f a )
* r1 7 = e q u i v a l e n t o f p m d _ o f f s e t ( p u d , i f a )
* r2 1 = e q u i v a l e n t o f p t e _ o f f s e t ( p m d , i f a )
*
* r2 9 = * p u d
* r2 0 = * p m d
* r1 8 = * p t e
2005-04-17 02:20:36 +04:00
* /
[IA64] polish comments for tlb fault handler in ivt.S
Polish the comments specifically in vhpt_miss and nested_dtlb_miss
handlers. I think it's better to explicitly name each page table
level with its name instead of numerically name them. i.e., use
pgd, pud, pmd, and pte instead of referring as L1, L2, L3 etc.
Along the line, remove some magic number in the comments like:
"PTA + (((IFA(61,63) << 7) | IFA(33,39))*8)". No code change at
all, pure comment update. Feel free to shoot anything you have,
darts or tomahawk cruise missile. I will duck behind a bunker ;-)
Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
Acked-by: Robin Holt <holt@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2005-11-17 12:55:34 +03:00
ld8 r25 = [ r21 ] / / r e a d * p t e a g a i n
ld8 r26 = [ r17 ] / / r e a d * p m d a g a i n
2005-11-11 18:35:43 +03:00
# ifdef C O N F I G _ P G T A B L E _ 4
[IA64] polish comments for tlb fault handler in ivt.S
Polish the comments specifically in vhpt_miss and nested_dtlb_miss
handlers. I think it's better to explicitly name each page table
level with its name instead of numerically name them. i.e., use
pgd, pud, pmd, and pte instead of referring as L1, L2, L3 etc.
Along the line, remove some magic number in the comments like:
"PTA + (((IFA(61,63) << 7) | IFA(33,39))*8)". No code change at
all, pure comment update. Feel free to shoot anything you have,
darts or tomahawk cruise missile. I will duck behind a bunker ;-)
Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
Acked-by: Robin Holt <holt@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2005-11-17 12:55:34 +03:00
ld8 r19 = [ r28 ] / / r e a d * p u d a g a i n
2005-11-11 18:35:43 +03:00
# endif
cmp. n e p6 ,p7 =r0 ,r0
2005-04-17 02:20:36 +04:00
;;
[IA64] polish comments for tlb fault handler in ivt.S
Polish the comments specifically in vhpt_miss and nested_dtlb_miss
handlers. I think it's better to explicitly name each page table
level with its name instead of numerically name them. i.e., use
pgd, pud, pmd, and pte instead of referring as L1, L2, L3 etc.
Along the line, remove some magic number in the comments like:
"PTA + (((IFA(61,63) << 7) | IFA(33,39))*8)". No code change at
all, pure comment update. Feel free to shoot anything you have,
darts or tomahawk cruise missile. I will duck behind a bunker ;-)
Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
Acked-by: Robin Holt <holt@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2005-11-17 12:55:34 +03:00
cmp. n e . o r . a n d c m p6 ,p7 =r26 ,r20 / / d i d * p m d c h a n g e
2005-11-11 18:35:43 +03:00
# ifdef C O N F I G _ P G T A B L E _ 4
[IA64] polish comments for tlb fault handler in ivt.S
Polish the comments specifically in vhpt_miss and nested_dtlb_miss
handlers. I think it's better to explicitly name each page table
level with its name instead of numerically name them. i.e., use
pgd, pud, pmd, and pte instead of referring as L1, L2, L3 etc.
Along the line, remove some magic number in the comments like:
"PTA + (((IFA(61,63) << 7) | IFA(33,39))*8)". No code change at
all, pure comment update. Feel free to shoot anything you have,
darts or tomahawk cruise missile. I will duck behind a bunker ;-)
Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
Acked-by: Robin Holt <holt@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2005-11-17 12:55:34 +03:00
cmp. n e . o r . a n d c m p6 ,p7 =r19 ,r29 / / d i d * p u d c h a n g e
2005-11-11 18:35:43 +03:00
# endif
2005-04-17 02:20:36 +04:00
mov r27 =PAGE_SHIFT < < 2
;;
( p6 ) p t c . l r22 ,r27 / / p u r g e P T E p a g e t r a n s l a t i o n
[IA64] polish comments for tlb fault handler in ivt.S
Polish the comments specifically in vhpt_miss and nested_dtlb_miss
handlers. I think it's better to explicitly name each page table
level with its name instead of numerically name them. i.e., use
pgd, pud, pmd, and pte instead of referring as L1, L2, L3 etc.
Along the line, remove some magic number in the comments like:
"PTA + (((IFA(61,63) << 7) | IFA(33,39))*8)". No code change at
all, pure comment update. Feel free to shoot anything you have,
darts or tomahawk cruise missile. I will duck behind a bunker ;-)
Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
Acked-by: Robin Holt <holt@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2005-11-17 12:55:34 +03:00
( p7 ) c m p . n e . o r . a n d c m p6 ,p7 =r25 ,r18 / / d i d * p t e c h a n g e
2005-04-17 02:20:36 +04:00
;;
( p6 ) p t c . l r16 ,r27 / / p u r g e t r a n s l a t i o n
# endif
mov p r =r31 ,- 1 / / r e s t o r e p r e d i c a t e r e g i s t e r s
2008-05-19 17:13:38 +04:00
RFI
2005-04-17 02:20:36 +04:00
END( v h p t _ m i s s )
.org ia6 4 _ i v t + 0 x40 0
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x0 4 0 0 E n t r y 1 ( s i z e 6 4 b u n d l e s ) I T L B ( 2 1 )
ENTRY( i t l b _ m i s s )
DBG_ F A U L T ( 1 )
/ *
[IA64] polish comments for tlb fault handler in ivt.S
Polish the comments specifically in vhpt_miss and nested_dtlb_miss
handlers. I think it's better to explicitly name each page table
level with its name instead of numerically name them. i.e., use
pgd, pud, pmd, and pte instead of referring as L1, L2, L3 etc.
Along the line, remove some magic number in the comments like:
"PTA + (((IFA(61,63) << 7) | IFA(33,39))*8)". No code change at
all, pure comment update. Feel free to shoot anything you have,
darts or tomahawk cruise missile. I will duck behind a bunker ;-)
Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
Acked-by: Robin Holt <holt@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2005-11-17 12:55:34 +03:00
* The I T L B h a n d l e r a c c e s s e s t h e P T E v i a t h e v i r t u a l l y m a p p e d l i n e a r
2005-04-17 02:20:36 +04:00
* page t a b l e . I f a n e s t e d T L B m i s s o c c u r s , w e s w i t c h i n t o p h y s i c a l
[IA64] polish comments for tlb fault handler in ivt.S
Polish the comments specifically in vhpt_miss and nested_dtlb_miss
handlers. I think it's better to explicitly name each page table
level with its name instead of numerically name them. i.e., use
pgd, pud, pmd, and pte instead of referring as L1, L2, L3 etc.
Along the line, remove some magic number in the comments like:
"PTA + (((IFA(61,63) << 7) | IFA(33,39))*8)". No code change at
all, pure comment update. Feel free to shoot anything you have,
darts or tomahawk cruise missile. I will duck behind a bunker ;-)
Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
Acked-by: Robin Holt <holt@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2005-11-17 12:55:34 +03:00
* mode, w a l k t h e p a g e t a b l e , a n d t h e n r e - e x e c u t e t h e P T E r e a d a n d
* go o n n o r m a l l y a f t e r t h a t .
2005-04-17 02:20:36 +04:00
* /
2008-05-19 17:13:38 +04:00
MOV_ F R O M _ I F A ( r16 ) / / g e t v i r t u a l a d d r e s s
2005-04-17 02:20:36 +04:00
mov r29 =b0 / / s a v e b0
mov r31 =pr / / s a v e p r e d i c a t e s
.itlb_fault :
2008-05-19 17:13:38 +04:00
MOV_ F R O M _ I H A ( r17 ) / / g e t v i r t u a l a d d r e s s o f P T E
2005-04-17 02:20:36 +04:00
movl r30 =1f / / l o a d n e s t e d f a u l t c o n t i n u a t i o n p o i n t
;;
[IA64] polish comments for tlb fault handler in ivt.S
Polish the comments specifically in vhpt_miss and nested_dtlb_miss
handlers. I think it's better to explicitly name each page table
level with its name instead of numerically name them. i.e., use
pgd, pud, pmd, and pte instead of referring as L1, L2, L3 etc.
Along the line, remove some magic number in the comments like:
"PTA + (((IFA(61,63) << 7) | IFA(33,39))*8)". No code change at
all, pure comment update. Feel free to shoot anything you have,
darts or tomahawk cruise missile. I will duck behind a bunker ;-)
Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
Acked-by: Robin Holt <holt@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2005-11-17 12:55:34 +03:00
1 : ld8 r18 = [ r17 ] / / r e a d * p t e
2005-04-17 02:20:36 +04:00
;;
mov b0 =r29
tbit. z p6 ,p0 =r18 ,_ P A G E _ P _ B I T / / p a g e p r e s e n t b i t c l e a r e d ?
( p6 ) b r . c o n d . s p n t p a g e _ f a u l t
;;
2008-05-19 17:13:38 +04:00
ITC_ I ( p0 , r18 , r19 )
2005-04-17 02:20:36 +04:00
;;
# ifdef C O N F I G _ S M P
/ *
* Tell t h e a s s e m b l e r s d e p e n d e n c y - v i o l a t i o n c h e c k e r t h a t t h e a b o v e " i t c " i n s t r u c t i o n s
* cannot p o s s i b l y a f f e c t t h e f o l l o w i n g l o a d s :
* /
dv_ s e r i a l i z e _ d a t a
[IA64] polish comments for tlb fault handler in ivt.S
Polish the comments specifically in vhpt_miss and nested_dtlb_miss
handlers. I think it's better to explicitly name each page table
level with its name instead of numerically name them. i.e., use
pgd, pud, pmd, and pte instead of referring as L1, L2, L3 etc.
Along the line, remove some magic number in the comments like:
"PTA + (((IFA(61,63) << 7) | IFA(33,39))*8)". No code change at
all, pure comment update. Feel free to shoot anything you have,
darts or tomahawk cruise missile. I will duck behind a bunker ;-)
Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
Acked-by: Robin Holt <holt@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2005-11-17 12:55:34 +03:00
ld8 r19 = [ r17 ] / / r e a d * p t e a g a i n a n d s e e i f s a m e
2005-04-17 02:20:36 +04:00
mov r20 =PAGE_SHIFT < < 2 / / s e t u p p a g e s i z e f o r p u r g e
;;
cmp. n e p7 ,p0 =r18 ,r19
;;
( p7 ) p t c . l r16 ,r20
# endif
mov p r =r31 ,- 1
2008-05-19 17:13:38 +04:00
RFI
2005-04-17 02:20:36 +04:00
END( i t l b _ m i s s )
.org ia6 4 _ i v t + 0 x08 0 0
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x0 8 0 0 E n t r y 2 ( s i z e 6 4 b u n d l e s ) D T L B ( 9 ,4 8 )
ENTRY( d t l b _ m i s s )
DBG_ F A U L T ( 2 )
/ *
[IA64] polish comments for tlb fault handler in ivt.S
Polish the comments specifically in vhpt_miss and nested_dtlb_miss
handlers. I think it's better to explicitly name each page table
level with its name instead of numerically name them. i.e., use
pgd, pud, pmd, and pte instead of referring as L1, L2, L3 etc.
Along the line, remove some magic number in the comments like:
"PTA + (((IFA(61,63) << 7) | IFA(33,39))*8)". No code change at
all, pure comment update. Feel free to shoot anything you have,
darts or tomahawk cruise missile. I will duck behind a bunker ;-)
Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
Acked-by: Robin Holt <holt@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2005-11-17 12:55:34 +03:00
* The D T L B h a n d l e r a c c e s s e s t h e P T E v i a t h e v i r t u a l l y m a p p e d l i n e a r
2005-04-17 02:20:36 +04:00
* page t a b l e . I f a n e s t e d T L B m i s s o c c u r s , w e s w i t c h i n t o p h y s i c a l
[IA64] polish comments for tlb fault handler in ivt.S
Polish the comments specifically in vhpt_miss and nested_dtlb_miss
handlers. I think it's better to explicitly name each page table
level with its name instead of numerically name them. i.e., use
pgd, pud, pmd, and pte instead of referring as L1, L2, L3 etc.
Along the line, remove some magic number in the comments like:
"PTA + (((IFA(61,63) << 7) | IFA(33,39))*8)". No code change at
all, pure comment update. Feel free to shoot anything you have,
darts or tomahawk cruise missile. I will duck behind a bunker ;-)
Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
Acked-by: Robin Holt <holt@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2005-11-17 12:55:34 +03:00
* mode, w a l k t h e p a g e t a b l e , a n d t h e n r e - e x e c u t e t h e P T E r e a d a n d
* go o n n o r m a l l y a f t e r t h a t .
2005-04-17 02:20:36 +04:00
* /
2008-05-19 17:13:38 +04:00
MOV_ F R O M _ I F A ( r16 ) / / g e t v i r t u a l a d d r e s s
2005-04-17 02:20:36 +04:00
mov r29 =b0 / / s a v e b0
mov r31 =pr / / s a v e p r e d i c a t e s
dtlb_fault :
2008-05-19 17:13:38 +04:00
MOV_ F R O M _ I H A ( r17 ) / / g e t v i r t u a l a d d r e s s o f P T E
2005-04-17 02:20:36 +04:00
movl r30 =1f / / l o a d n e s t e d f a u l t c o n t i n u a t i o n p o i n t
;;
[IA64] polish comments for tlb fault handler in ivt.S
Polish the comments specifically in vhpt_miss and nested_dtlb_miss
handlers. I think it's better to explicitly name each page table
level with its name instead of numerically name them. i.e., use
pgd, pud, pmd, and pte instead of referring as L1, L2, L3 etc.
Along the line, remove some magic number in the comments like:
"PTA + (((IFA(61,63) << 7) | IFA(33,39))*8)". No code change at
all, pure comment update. Feel free to shoot anything you have,
darts or tomahawk cruise missile. I will duck behind a bunker ;-)
Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
Acked-by: Robin Holt <holt@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2005-11-17 12:55:34 +03:00
1 : ld8 r18 = [ r17 ] / / r e a d * p t e
2005-04-17 02:20:36 +04:00
;;
mov b0 =r29
tbit. z p6 ,p0 =r18 ,_ P A G E _ P _ B I T / / p a g e p r e s e n t b i t c l e a r e d ?
( p6 ) b r . c o n d . s p n t p a g e _ f a u l t
;;
2008-05-19 17:13:38 +04:00
ITC_ D ( p0 , r18 , r19 )
2005-04-17 02:20:36 +04:00
;;
# ifdef C O N F I G _ S M P
/ *
* Tell t h e a s s e m b l e r s d e p e n d e n c y - v i o l a t i o n c h e c k e r t h a t t h e a b o v e " i t c " i n s t r u c t i o n s
* cannot p o s s i b l y a f f e c t t h e f o l l o w i n g l o a d s :
* /
dv_ s e r i a l i z e _ d a t a
[IA64] polish comments for tlb fault handler in ivt.S
Polish the comments specifically in vhpt_miss and nested_dtlb_miss
handlers. I think it's better to explicitly name each page table
level with its name instead of numerically name them. i.e., use
pgd, pud, pmd, and pte instead of referring as L1, L2, L3 etc.
Along the line, remove some magic number in the comments like:
"PTA + (((IFA(61,63) << 7) | IFA(33,39))*8)". No code change at
all, pure comment update. Feel free to shoot anything you have,
darts or tomahawk cruise missile. I will duck behind a bunker ;-)
Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
Acked-by: Robin Holt <holt@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2005-11-17 12:55:34 +03:00
ld8 r19 = [ r17 ] / / r e a d * p t e a g a i n a n d s e e i f s a m e
2005-04-17 02:20:36 +04:00
mov r20 =PAGE_SHIFT < < 2 / / s e t u p p a g e s i z e f o r p u r g e
;;
cmp. n e p7 ,p0 =r18 ,r19
;;
( p7 ) p t c . l r16 ,r20
# endif
mov p r =r31 ,- 1
2008-05-19 17:13:38 +04:00
RFI
2005-04-17 02:20:36 +04:00
END( d t l b _ m i s s )
.org ia6 4 _ i v t + 0 x0 c00
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x0 c00 E n t r y 3 ( s i z e 6 4 b u n d l e s ) A l t I T L B ( 1 9 )
ENTRY( a l t _ i t l b _ m i s s )
DBG_ F A U L T ( 3 )
2008-05-19 17:13:38 +04:00
MOV_ F R O M _ I F A ( r16 ) / / g e t a d d r e s s t h a t c a u s e d t h e T L B m i s s
2005-04-17 02:20:36 +04:00
movl r17 =PAGE_KERNEL
2008-05-19 17:13:38 +04:00
MOV_ F R O M _ I P S R ( p0 , r21 )
2005-04-17 02:20:36 +04:00
movl r19 = ( ( ( 1 < < I A 6 4 _ M A X _ P H Y S _ B I T S ) - 1 ) & ~ 0 x f f f )
mov r31 =pr
;;
# ifdef C O N F I G _ D I S A B L E _ V H P T
shr. u r22 =r16 ,6 1 / / g e t t h e r e g i o n n u m b e r i n t o r21
;;
cmp. g t p8 ,p0 =6 ,r22 / / u s e r m o d e
;;
2008-05-19 17:13:38 +04:00
THASH( p8 , r17 , r16 , r23 )
2005-04-17 02:20:36 +04:00
;;
2008-05-19 17:13:38 +04:00
MOV_ T O _ I H A ( p8 , r17 , r23 )
2005-04-17 02:20:36 +04:00
( p8 ) m o v r29 =b0 / / s a v e b0
( p8 ) b r . c o n d . d p t k . i t l b _ f a u l t
# endif
extr. u r23 =r21 ,I A 6 4 _ P S R _ C P L 0 _ B I T ,2 / / e x t r a c t p s r . c p l
and r19 =r19 ,r16 / / c l e a r e d , r e s e r v e d b i t s , a n d P T E c o n t r o l b i t s
shr. u r18 =r16 ,5 7 / / m o v e a d d r e s s b i t 6 1 t o b i t 4
;;
andcm r18 =0x10 ,r18 / / b i t 4 = ~ a d d r e s s - b i t ( 6 1 )
cmp. n e p8 ,p0 =r0 ,r23 / / p s r . c p l ! = 0 ?
or r19 =r17 ,r19 / / i n s e r t P T E c o n t r o l b i t s i n t o r19
;;
or r19 =r19 ,r18 / / s e t b i t 4 ( u n c a c h e d ) i f t h e a c c e s s w a s t o r e g i o n 6
( p8 ) b r . c o n d . s p n t p a g e _ f a u l t
;;
2008-05-19 17:13:38 +04:00
ITC_ I ( p0 , r19 , r18 ) / / i n s e r t t h e T L B e n t r y
2005-04-17 02:20:36 +04:00
mov p r =r31 ,- 1
2008-05-19 17:13:38 +04:00
RFI
2005-04-17 02:20:36 +04:00
END( a l t _ i t l b _ m i s s )
.org ia6 4 _ i v t + 0 x10 0 0
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x1 0 0 0 E n t r y 4 ( s i z e 6 4 b u n d l e s ) A l t D T L B ( 7 ,4 6 )
ENTRY( a l t _ d t l b _ m i s s )
DBG_ F A U L T ( 4 )
2008-05-19 17:13:38 +04:00
MOV_ F R O M _ I F A ( r16 ) / / g e t a d d r e s s t h a t c a u s e d t h e T L B m i s s
2005-04-17 02:20:36 +04:00
movl r17 =PAGE_KERNEL
2008-05-19 17:13:38 +04:00
MOV_ F R O M _ I S R ( r20 )
2005-04-17 02:20:36 +04:00
movl r19 = ( ( ( 1 < < I A 6 4 _ M A X _ P H Y S _ B I T S ) - 1 ) & ~ 0 x f f f )
2008-05-19 17:13:38 +04:00
MOV_ F R O M _ I P S R ( p0 , r21 )
2005-04-17 02:20:36 +04:00
mov r31 =pr
2006-10-13 21:08:13 +04:00
mov r24 =PERCPU_ADDR
2005-04-17 02:20:36 +04:00
;;
# ifdef C O N F I G _ D I S A B L E _ V H P T
shr. u r22 =r16 ,6 1 / / g e t t h e r e g i o n n u m b e r i n t o r21
;;
cmp. g t p8 ,p0 =6 ,r22 / / a c c e s s t o r e g i o n 0 - 5
;;
2008-05-19 17:13:38 +04:00
THASH( p8 , r17 , r16 , r25 )
2005-04-17 02:20:36 +04:00
;;
2008-05-19 17:13:38 +04:00
MOV_ T O _ I H A ( p8 , r17 , r25 )
2005-04-17 02:20:36 +04:00
( p8 ) m o v r29 =b0 / / s a v e b0
( p8 ) b r . c o n d . d p t k d t l b _ f a u l t
# endif
2006-10-13 21:08:13 +04:00
cmp. g e p10 ,p11 =r16 ,r24 / / a c c e s s t o p e r _ c p u _ d a t a ?
tbit. z p12 ,p0 =r16 ,6 1 / / a c c e s s t o r e g i o n 6 ?
mov r25 =PERCPU_PAGE_SHIFT < < 2
mov r26 =PERCPU_PAGE_SIZE
nop. m 0
nop. b 0
;;
( p1 0 ) m o v r19 =IA64_KR ( P E R _ C P U _ D A T A )
( p1 1 ) a n d r19 =r19 ,r16 / / c l e a r n o n - p p n f i e l d s
2005-04-17 02:20:36 +04:00
extr. u r23 =r21 ,I A 6 4 _ P S R _ C P L 0 _ B I T ,2 / / e x t r a c t p s r . c p l
and r22 =IA64_ISR_CODE_MASK ,r20 / / g e t t h e i s r . c o d e f i e l d
tbit. n z p6 ,p7 =r20 ,I A 6 4 _ I S R _ S P _ B I T / / i s s p e c u l a t i o n b i t o n ?
tbit. n z p9 ,p0 =r20 ,I A 6 4 _ I S R _ N A _ B I T / / i s n o n - a c c e s s b i t o n ?
;;
2006-10-13 21:08:13 +04:00
( p1 0 ) s u b r19 =r19 ,r26
2008-05-19 17:13:38 +04:00
MOV_ T O _ I T I R ( p10 , r25 , r24 )
2005-04-17 02:20:36 +04:00
cmp. n e p8 ,p0 =r0 ,r23
( p9 ) c m p . e q . o r . a n d c m p6 ,p7 =IA64_ISR_CODE_LFETCH ,r22 / / c h e c k i s r . c o d e f i e l d
2006-10-13 21:08:13 +04:00
( p1 2 ) d e p r17 = - 1 ,r17 ,4 ,1 / / s e t m a =UC f o r r e g i o n 6 a d d r
2005-04-17 02:20:36 +04:00
( p8 ) b r . c o n d . s p n t p a g e _ f a u l t
dep r21 = - 1 ,r21 ,I A 6 4 _ P S R _ E D _ B I T ,1
;;
2006-10-13 21:08:13 +04:00
or r19 =r19 ,r17 / / i n s e r t P T E c o n t r o l b i t s i n t o r19
2008-05-19 17:13:38 +04:00
MOV_ T O _ I P S R ( p6 , r21 , r24 )
2005-04-17 02:20:36 +04:00
;;
2008-05-19 17:13:38 +04:00
ITC_ D ( p7 , r19 , r18 ) / / i n s e r t t h e T L B e n t r y
2005-04-17 02:20:36 +04:00
mov p r =r31 ,- 1
2008-05-19 17:13:38 +04:00
RFI
2005-04-17 02:20:36 +04:00
END( a l t _ d t l b _ m i s s )
.org ia6 4 _ i v t + 0 x14 0 0
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x1 4 0 0 E n t r y 5 ( s i z e 6 4 b u n d l e s ) D a t a n e s t e d T L B ( 6 ,4 5 )
ENTRY( n e s t e d _ d t l b _ m i s s )
/ *
* In t h e a b s e n c e o f k e r n e l b u g s , w e g e t h e r e w h e n t h e v i r t u a l l y m a p p e d l i n e a r
* page t a b l e i s a c c e s s e d n o n - s p e c u l a t i v e l y ( e . g . , i n t h e D i r t y - b i t , I n s t r u c t i o n
* Access- b i t , o r D a t a A c c e s s - b i t f a u l t s ) . I f t h e D T L B e n t r y f o r t h e v i r t u a l p a g e
* table i s m i s s i n g , a n e s t e d T L B m i s s f a u l t i s t r i g g e r e d a n d c o n t r o l i s
* transferred t o t h i s p o i n t . W h e n t h i s h a p p e n s , w e l o o k u p t h e p t e f o r t h e
* faulting a d d r e s s b y w a l k i n g t h e p a g e t a b l e i n p h y s i c a l m o d e a n d r e t u r n t o t h e
* continuation p o i n t p a s s e d i n r e g i s t e r r30 ( o r c a l l p a g e _ f a u l t i f t h e a d d r e s s i s
* not m a p p e d ) .
*
* Input : r16 : faulting a d d r e s s
* r29 : saved b0
* r30 : continuation a d d r e s s
* r31 : saved p r
*
[IA64] polish comments for tlb fault handler in ivt.S
Polish the comments specifically in vhpt_miss and nested_dtlb_miss
handlers. I think it's better to explicitly name each page table
level with its name instead of numerically name them. i.e., use
pgd, pud, pmd, and pte instead of referring as L1, L2, L3 etc.
Along the line, remove some magic number in the comments like:
"PTA + (((IFA(61,63) << 7) | IFA(33,39))*8)". No code change at
all, pure comment update. Feel free to shoot anything you have,
darts or tomahawk cruise missile. I will duck behind a bunker ;-)
Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
Acked-by: Robin Holt <holt@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2005-11-17 12:55:34 +03:00
* Output : r17 : physical a d d r e s s o f P T E o f f a u l t i n g a d d r e s s
2005-04-17 02:20:36 +04:00
* r29 : saved b0
* r30 : continuation a d d r e s s
* r31 : saved p r
*
2005-06-22 01:40:31 +04:00
* Clobbered : b0 , r18 , r19 , r21 , r22 , p s r . d t ( c l e a r e d )
2005-04-17 02:20:36 +04:00
* /
2008-05-19 17:13:38 +04:00
RSM_ P S R _ D T / / s w i t c h t o u s i n g p h y s i c a l d a t a a d d r e s s i n g
2005-04-17 02:20:36 +04:00
mov r19 =IA64_KR ( P T _ B A S E ) / / g e t t h e p a g e t a b l e b a s e a d d r e s s
shl r21 =r16 ,3 / / s h i f t b i t 6 0 i n t o s i g n b i t
2008-05-19 17:13:38 +04:00
MOV_ F R O M _ I T I R ( r18 )
2005-04-17 02:20:36 +04:00
;;
shr. u r17 =r16 ,6 1 / / g e t t h e r e g i o n n u m b e r i n t o r17
2005-06-22 01:40:31 +04:00
extr. u r18 =r18 ,2 ,6 / / g e t t h e f a u l t i n g p a g e s i z e
2005-04-17 02:20:36 +04:00
;;
cmp. e q p6 ,p7 =5 ,r17 / / i s f a u l t i n g a d d r e s s i n r e g i o n 5 ?
2005-06-22 01:40:31 +04:00
add r22 = - P A G E _ S H I F T ,r18 / / a d j u s t m e n t f o r h u g e t l b a d d r e s s
add r18 =PGDIR_SHIFT - P A G E _ S H I F T ,r18
2005-04-17 02:20:36 +04:00
;;
2005-06-22 01:40:31 +04:00
shr. u r22 =r16 ,r22
shr. u r18 =r16 ,r18
2005-04-17 02:20:36 +04:00
( p7 ) d e p r17 =r17 ,r19 ,( P A G E _ S H I F T - 3 ) ,3 / / p u t r e g i o n n u m b e r b i t s i n p l a c e
srlz. d
LOAD_ P H Y S I C A L ( p6 , r19 , s w a p p e r _ p g _ d i r ) / / r e g i o n 5 i s r o o t e d a t s w a p p e r _ p g _ d i r
.pred .rel " mutex" , p6 , p7
( p6 ) s h r . u r21 =r21 ,P G D I R _ S H I F T + P A G E _ S H I F T
( p7 ) s h r . u r21 =r21 ,P G D I R _ S H I F T + P A G E _ S H I F T - 3
;;
[IA64] polish comments for tlb fault handler in ivt.S
Polish the comments specifically in vhpt_miss and nested_dtlb_miss
handlers. I think it's better to explicitly name each page table
level with its name instead of numerically name them. i.e., use
pgd, pud, pmd, and pte instead of referring as L1, L2, L3 etc.
Along the line, remove some magic number in the comments like:
"PTA + (((IFA(61,63) << 7) | IFA(33,39))*8)". No code change at
all, pure comment update. Feel free to shoot anything you have,
darts or tomahawk cruise missile. I will duck behind a bunker ;-)
Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
Acked-by: Robin Holt <holt@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2005-11-17 12:55:34 +03:00
( p6 ) d e p r17 =r18 ,r19 ,3 ,( P A G E _ S H I F T - 3 ) / / r17 =pgd_offset f o r r e g i o n 5
( p7 ) d e p r17 =r18 ,r17 ,3 ,( P A G E _ S H I F T - 6 ) / / r17 =pgd_offset f o r r e g i o n [ 0 - 4 ]
2005-04-17 02:20:36 +04:00
cmp. e q p7 ,p6 =0 ,r21 / / u n u s e d a d d r e s s b i t s a l l z e r o e s ?
2005-11-11 18:35:43 +03:00
# ifdef C O N F I G _ P G T A B L E _ 4
[IA64] polish comments for tlb fault handler in ivt.S
Polish the comments specifically in vhpt_miss and nested_dtlb_miss
handlers. I think it's better to explicitly name each page table
level with its name instead of numerically name them. i.e., use
pgd, pud, pmd, and pte instead of referring as L1, L2, L3 etc.
Along the line, remove some magic number in the comments like:
"PTA + (((IFA(61,63) << 7) | IFA(33,39))*8)". No code change at
all, pure comment update. Feel free to shoot anything you have,
darts or tomahawk cruise missile. I will duck behind a bunker ;-)
Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
Acked-by: Robin Holt <holt@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2005-11-17 12:55:34 +03:00
shr. u r18 =r22 ,P U D _ S H I F T / / s h i f t p u d i n d e x i n t o p o s i t i o n
2005-11-11 18:35:43 +03:00
# else
[IA64] polish comments for tlb fault handler in ivt.S
Polish the comments specifically in vhpt_miss and nested_dtlb_miss
handlers. I think it's better to explicitly name each page table
level with its name instead of numerically name them. i.e., use
pgd, pud, pmd, and pte instead of referring as L1, L2, L3 etc.
Along the line, remove some magic number in the comments like:
"PTA + (((IFA(61,63) << 7) | IFA(33,39))*8)". No code change at
all, pure comment update. Feel free to shoot anything you have,
darts or tomahawk cruise missile. I will duck behind a bunker ;-)
Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
Acked-by: Robin Holt <holt@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2005-11-17 12:55:34 +03:00
shr. u r18 =r22 ,P M D _ S H I F T / / s h i f t p m d i n d e x i n t o p o s i t i o n
2005-11-11 18:35:43 +03:00
# endif
2005-04-17 02:20:36 +04:00
;;
[IA64] polish comments for tlb fault handler in ivt.S
Polish the comments specifically in vhpt_miss and nested_dtlb_miss
handlers. I think it's better to explicitly name each page table
level with its name instead of numerically name them. i.e., use
pgd, pud, pmd, and pte instead of referring as L1, L2, L3 etc.
Along the line, remove some magic number in the comments like:
"PTA + (((IFA(61,63) << 7) | IFA(33,39))*8)". No code change at
all, pure comment update. Feel free to shoot anything you have,
darts or tomahawk cruise missile. I will duck behind a bunker ;-)
Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
Acked-by: Robin Holt <holt@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2005-11-17 12:55:34 +03:00
ld8 r17 = [ r17 ] / / g e t * p g d ( m a y b e 0 )
2005-04-17 02:20:36 +04:00
;;
[IA64] polish comments for tlb fault handler in ivt.S
Polish the comments specifically in vhpt_miss and nested_dtlb_miss
handlers. I think it's better to explicitly name each page table
level with its name instead of numerically name them. i.e., use
pgd, pud, pmd, and pte instead of referring as L1, L2, L3 etc.
Along the line, remove some magic number in the comments like:
"PTA + (((IFA(61,63) << 7) | IFA(33,39))*8)". No code change at
all, pure comment update. Feel free to shoot anything you have,
darts or tomahawk cruise missile. I will duck behind a bunker ;-)
Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
Acked-by: Robin Holt <holt@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2005-11-17 12:55:34 +03:00
( p7 ) c m p . e q p6 ,p7 =r17 ,r0 / / w a s p g d _ p r e s e n t ( * p g d ) = = N U L L ?
dep r17 =r18 ,r17 ,3 ,( P A G E _ S H I F T - 3 ) / / r17 =p [ u | m ] d _ o f f s e t ( p g d ,a d d r )
2005-04-17 02:20:36 +04:00
;;
2005-11-11 18:35:43 +03:00
# ifdef C O N F I G _ P G T A B L E _ 4
[IA64] polish comments for tlb fault handler in ivt.S
Polish the comments specifically in vhpt_miss and nested_dtlb_miss
handlers. I think it's better to explicitly name each page table
level with its name instead of numerically name them. i.e., use
pgd, pud, pmd, and pte instead of referring as L1, L2, L3 etc.
Along the line, remove some magic number in the comments like:
"PTA + (((IFA(61,63) << 7) | IFA(33,39))*8)". No code change at
all, pure comment update. Feel free to shoot anything you have,
darts or tomahawk cruise missile. I will duck behind a bunker ;-)
Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
Acked-by: Robin Holt <holt@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2005-11-17 12:55:34 +03:00
( p7 ) l d8 r17 = [ r17 ] / / g e t * p u d ( m a y b e 0 )
shr. u r18 =r22 ,P M D _ S H I F T / / s h i f t p m d i n d e x i n t o p o s i t i o n
2005-04-17 02:20:36 +04:00
;;
[IA64] polish comments for tlb fault handler in ivt.S
Polish the comments specifically in vhpt_miss and nested_dtlb_miss
handlers. I think it's better to explicitly name each page table
level with its name instead of numerically name them. i.e., use
pgd, pud, pmd, and pte instead of referring as L1, L2, L3 etc.
Along the line, remove some magic number in the comments like:
"PTA + (((IFA(61,63) << 7) | IFA(33,39))*8)". No code change at
all, pure comment update. Feel free to shoot anything you have,
darts or tomahawk cruise missile. I will duck behind a bunker ;-)
Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
Acked-by: Robin Holt <holt@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2005-11-17 12:55:34 +03:00
( p7 ) c m p . e q . o r . a n d c m p6 ,p7 =r17 ,r0 / / w a s p u d _ p r e s e n t ( * p u d ) = = N U L L ?
dep r17 =r18 ,r17 ,3 ,( P A G E _ S H I F T - 3 ) / / r17 =pmd_offset ( p u d ,a d d r )
2005-11-11 18:35:43 +03:00
;;
# endif
[IA64] polish comments for tlb fault handler in ivt.S
Polish the comments specifically in vhpt_miss and nested_dtlb_miss
handlers. I think it's better to explicitly name each page table
level with its name instead of numerically name them. i.e., use
pgd, pud, pmd, and pte instead of referring as L1, L2, L3 etc.
Along the line, remove some magic number in the comments like:
"PTA + (((IFA(61,63) << 7) | IFA(33,39))*8)". No code change at
all, pure comment update. Feel free to shoot anything you have,
darts or tomahawk cruise missile. I will duck behind a bunker ;-)
Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
Acked-by: Robin Holt <holt@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2005-11-17 12:55:34 +03:00
( p7 ) l d8 r17 = [ r17 ] / / g e t * p m d ( m a y b e 0 )
shr. u r19 =r22 ,P A G E _ S H I F T / / s h i f t p t e i n d e x i n t o p o s i t i o n
2005-11-11 18:35:43 +03:00
;;
[IA64] polish comments for tlb fault handler in ivt.S
Polish the comments specifically in vhpt_miss and nested_dtlb_miss
handlers. I think it's better to explicitly name each page table
level with its name instead of numerically name them. i.e., use
pgd, pud, pmd, and pte instead of referring as L1, L2, L3 etc.
Along the line, remove some magic number in the comments like:
"PTA + (((IFA(61,63) << 7) | IFA(33,39))*8)". No code change at
all, pure comment update. Feel free to shoot anything you have,
darts or tomahawk cruise missile. I will duck behind a bunker ;-)
Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
Acked-by: Robin Holt <holt@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2005-11-17 12:55:34 +03:00
( p7 ) c m p . e q . o r . a n d c m p6 ,p7 =r17 ,r0 / / w a s p m d _ p r e s e n t ( * p m d ) = = N U L L ?
dep r17 =r19 ,r17 ,3 ,( P A G E _ S H I F T - 3 ) / / r17 =pte_offset ( p m d ,a d d r ) ;
2005-04-17 02:20:36 +04:00
( p6 ) b r . c o n d . s p n t p a g e _ f a u l t
mov b0 =r30
br. s p t k . m a n y b0 / / r e t u r n t o c o n t i n u a t i o n p o i n t
END( n e s t e d _ d t l b _ m i s s )
.org ia6 4 _ i v t + 0 x18 0 0
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x1 8 0 0 E n t r y 6 ( s i z e 6 4 b u n d l e s ) I n s t r u c t i o n K e y M i s s ( 2 4 )
ENTRY( i k e y _ m i s s )
DBG_ F A U L T ( 6 )
FAULT( 6 )
END( i k e y _ m i s s )
.org ia6 4 _ i v t + 0 x1 c00
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x1 c00 E n t r y 7 ( s i z e 6 4 b u n d l e s ) D a t a K e y M i s s ( 1 2 ,5 1 )
ENTRY( d k e y _ m i s s )
DBG_ F A U L T ( 7 )
FAULT( 7 )
END( d k e y _ m i s s )
.org ia6 4 _ i v t + 0 x20 0 0
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x2 0 0 0 E n t r y 8 ( s i z e 6 4 b u n d l e s ) D i r t y - b i t ( 5 4 )
ENTRY( d i r t y _ b i t )
DBG_ F A U L T ( 8 )
/ *
* What w e d o h e r e i s t o s i m p l y t u r n o n t h e d i r t y b i t i n t h e P T E . W e n e e d t o
* update b o t h t h e p a g e - t a b l e a n d t h e T L B e n t r y . T o e f f i c i e n t l y a c c e s s t h e P T E ,
* we a d d r e s s i t t h r o u g h t h e v i r t u a l p a g e t a b l e . M o s t l i k e l y , t h e T L B e n t r y f o r
* the r e l e v a n t v i r t u a l p a g e t a b l e p a g e i s s t i l l p r e s e n t i n t h e T L B s o w e c a n
* normally d o t h i s w i t h o u t a d d i t i o n a l T L B m i s s e s . I n c a s e t h e n e c e s s a r y v i r t u a l
* page t a b l e T L B e n t r y i s n ' t p r e s e n t , w e t a k e a n e s t e d T L B m i s s h i t w h e r e w e l o o k
* up t h e p h y s i c a l a d d r e s s o f t h e L 3 P T E a n d t h e n c o n t i n u e a t l a b e l 1 b e l o w .
* /
2008-05-19 17:13:38 +04:00
MOV_ F R O M _ I F A ( r16 ) / / g e t t h e a d d r e s s t h a t c a u s e d t h e f a u l t
2005-04-17 02:20:36 +04:00
movl r30 =1f / / l o a d c o n t i n u a t i o n p o i n t i n c a s e o f n e s t e d f a u l t
;;
2008-05-19 17:13:38 +04:00
THASH( p0 , r17 , r16 , r18 ) / / c o m p u t e v i r t u a l a d d r e s s o f L 3 P T E
2005-04-17 02:20:36 +04:00
mov r29 =b0 / / s a v e b0 i n c a s e o f n e s t e d f a u l t
mov r31 =pr / / s a v e p r
# ifdef C O N F I G _ S M P
mov r28 =ar . c c v / / s a v e a r . c c v
;;
1 : ld8 r18 = [ r17 ]
;; // avoid RAW on r18
mov a r . c c v =r18 / / s e t c o m p a r e v a l u e f o r c m p x c h g
or r25 =_PAGE_D | _ P A G E _ A ,r18 / / s e t t h e d i r t y a n d a c c e s s e d b i t s
2006-03-08 06:05:32 +03:00
tbit. z p7 ,p6 = r18 ,_ P A G E _ P _ B I T / / C h e c k p r e s e n t b i t
2005-04-17 02:20:36 +04:00
;;
2006-03-08 06:05:32 +03:00
( p6 ) c m p x c h g 8 . a c q r26 = [ r17 ] ,r25 ,a r . c c v / / O n l y u p d a t e i f p a g e i s p r e s e n t
2005-04-17 02:20:36 +04:00
mov r24 =PAGE_SHIFT < < 2
;;
2006-03-08 06:05:32 +03:00
( p6 ) c m p . e q p6 ,p7 =r26 ,r18 / / O n l y c o m p a r e i f p a g e i s p r e s e n t
2005-04-17 02:20:36 +04:00
;;
2008-05-19 17:13:38 +04:00
ITC_ D ( p6 , r25 , r18 ) / / i n s t a l l u p d a t e d P T E
2005-04-17 02:20:36 +04:00
;;
/ *
* Tell t h e a s s e m b l e r s d e p e n d e n c y - v i o l a t i o n c h e c k e r t h a t t h e a b o v e " i t c " i n s t r u c t i o n s
* cannot p o s s i b l y a f f e c t t h e f o l l o w i n g l o a d s :
* /
dv_ s e r i a l i z e _ d a t a
ld8 r18 = [ r17 ] / / r e a d P T E a g a i n
;;
cmp. e q p6 ,p7 =r18 ,r25 / / i s i t s a m e a s t h e n e w l y i n s t a l l e d
;;
( p7 ) p t c . l r16 ,r24
mov b0 =r29 / / r e s t o r e b0
mov a r . c c v =r28
# else
;;
1 : ld8 r18 = [ r17 ]
;; // avoid RAW on r18
or r18 =_PAGE_D | _ P A G E _ A ,r18 / / s e t t h e d i r t y a n d a c c e s s e d b i t s
mov b0 =r29 / / r e s t o r e b0
;;
st8 [ r17 ] =r18 / / s t o r e b a c k u p d a t e d P T E
2008-10-17 06:17:41 +04:00
ITC_ D ( p0 , r18 , r16 ) / / i n s t a l l u p d a t e d P T E
2005-04-17 02:20:36 +04:00
# endif
mov p r =r31 ,- 1 / / r e s t o r e p r
2008-05-19 17:13:38 +04:00
RFI
2005-04-17 02:20:36 +04:00
END( d i r t y _ b i t )
.org ia6 4 _ i v t + 0 x24 0 0
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x2 4 0 0 E n t r y 9 ( s i z e 6 4 b u n d l e s ) I n s t r u c t i o n A c c e s s - b i t ( 2 7 )
ENTRY( i a c c e s s _ b i t )
DBG_ F A U L T ( 9 )
/ / Like E n t r y 8 , e x c e p t f o r i n s t r u c t i o n a c c e s s
2008-05-19 17:13:38 +04:00
MOV_ F R O M _ I F A ( r16 ) / / g e t t h e a d d r e s s t h a t c a u s e d t h e f a u l t
2005-04-17 02:20:36 +04:00
movl r30 =1f / / l o a d c o n t i n u a t i o n p o i n t i n c a s e o f n e s t e d f a u l t
mov r31 =pr / / s a v e p r e d i c a t e s
# ifdef C O N F I G _ I T A N I U M
/ *
* Erratum 1 0 ( I F A m a y c o n t a i n i n c o r r e c t a d d r e s s ) h a s " N o F i x " s t a t u s .
* /
2008-05-19 17:13:38 +04:00
MOV_ F R O M _ I P S R ( p0 , r17 )
2005-04-17 02:20:36 +04:00
;;
2008-05-19 17:13:38 +04:00
MOV_ F R O M _ I I P ( r18 )
2005-04-17 02:20:36 +04:00
tbit. z p6 ,p0 =r17 ,I A 6 4 _ P S R _ I S _ B I T / / I A 6 4 i n s t r u c t i o n s e t ?
;;
( p6 ) m o v r16 =r18 / / i f s o , u s e c r . i i p i n s t e a d o f c r . i f a
# endif / * C O N F I G _ I T A N I U M * /
;;
2008-05-19 17:13:38 +04:00
THASH( p0 , r17 , r16 , r18 ) / / c o m p u t e v i r t u a l a d d r e s s o f L 3 P T E
2005-04-17 02:20:36 +04:00
mov r29 =b0 / / s a v e b0 i n c a s e o f n e s t e d f a u l t )
# ifdef C O N F I G _ S M P
mov r28 =ar . c c v / / s a v e a r . c c v
;;
1 : ld8 r18 = [ r17 ]
;;
mov a r . c c v =r18 / / s e t c o m p a r e v a l u e f o r c m p x c h g
or r25 =_PAGE_A ,r18 / / s e t t h e a c c e s s e d b i t
2006-03-08 06:05:32 +03:00
tbit. z p7 ,p6 = r18 ,_ P A G E _ P _ B I T / / C h e c k p r e s e n t b i t
2005-04-17 02:20:36 +04:00
;;
2006-03-08 06:05:32 +03:00
( p6 ) c m p x c h g 8 . a c q r26 = [ r17 ] ,r25 ,a r . c c v / / O n l y i f p a g e p r e s e n t
2005-04-17 02:20:36 +04:00
mov r24 =PAGE_SHIFT < < 2
;;
2006-03-08 06:05:32 +03:00
( p6 ) c m p . e q p6 ,p7 =r26 ,r18 / / O n l y i f p a g e p r e s e n t
2005-04-17 02:20:36 +04:00
;;
2008-05-19 17:13:38 +04:00
ITC_ I ( p6 , r25 , r26 ) / / i n s t a l l u p d a t e d P T E
2005-04-17 02:20:36 +04:00
;;
/ *
* Tell t h e a s s e m b l e r s d e p e n d e n c y - v i o l a t i o n c h e c k e r t h a t t h e a b o v e " i t c " i n s t r u c t i o n s
* cannot p o s s i b l y a f f e c t t h e f o l l o w i n g l o a d s :
* /
dv_ s e r i a l i z e _ d a t a
ld8 r18 = [ r17 ] / / r e a d P T E a g a i n
;;
cmp. e q p6 ,p7 =r18 ,r25 / / i s i t s a m e a s t h e n e w l y i n s t a l l e d
;;
( p7 ) p t c . l r16 ,r24
mov b0 =r29 / / r e s t o r e b0
mov a r . c c v =r28
# else / * ! C O N F I G _ S M P * /
;;
1 : ld8 r18 = [ r17 ]
;;
or r18 =_PAGE_A ,r18 / / s e t t h e a c c e s s e d b i t
mov b0 =r29 / / r e s t o r e b0
;;
st8 [ r17 ] =r18 / / s t o r e b a c k u p d a t e d P T E
2008-10-17 06:17:41 +04:00
ITC_ I ( p0 , r18 , r16 ) / / i n s t a l l u p d a t e d P T E
2005-04-17 02:20:36 +04:00
# endif / * ! C O N F I G _ S M P * /
mov p r =r31 ,- 1
2008-05-19 17:13:38 +04:00
RFI
2005-04-17 02:20:36 +04:00
END( i a c c e s s _ b i t )
.org ia6 4 _ i v t + 0 x28 0 0
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x2 8 0 0 E n t r y 1 0 ( s i z e 6 4 b u n d l e s ) D a t a A c c e s s - b i t ( 1 5 ,5 5 )
ENTRY( d a c c e s s _ b i t )
DBG_ F A U L T ( 1 0 )
/ / Like E n t r y 8 , e x c e p t f o r d a t a a c c e s s
2008-05-19 17:13:38 +04:00
MOV_ F R O M _ I F A ( r16 ) / / g e t t h e a d d r e s s t h a t c a u s e d t h e f a u l t
2005-04-17 02:20:36 +04:00
movl r30 =1f / / l o a d c o n t i n u a t i o n p o i n t i n c a s e o f n e s t e d f a u l t
;;
2008-05-19 17:13:38 +04:00
THASH( p0 , r17 , r16 , r18 ) / / c o m p u t e v i r t u a l a d d r e s s o f L 3 P T E
2005-04-17 02:20:36 +04:00
mov r31 =pr
mov r29 =b0 / / s a v e b0 i n c a s e o f n e s t e d f a u l t )
# ifdef C O N F I G _ S M P
mov r28 =ar . c c v / / s a v e a r . c c v
;;
1 : ld8 r18 = [ r17 ]
;; // avoid RAW on r18
mov a r . c c v =r18 / / s e t c o m p a r e v a l u e f o r c m p x c h g
or r25 =_PAGE_A ,r18 / / s e t t h e d i r t y b i t
2006-03-08 06:05:32 +03:00
tbit. z p7 ,p6 = r18 ,_ P A G E _ P _ B I T / / C h e c k p r e s e n t b i t
2005-04-17 02:20:36 +04:00
;;
2006-03-08 06:05:32 +03:00
( p6 ) c m p x c h g 8 . a c q r26 = [ r17 ] ,r25 ,a r . c c v / / O n l y i f p a g e i s p r e s e n t
2005-04-17 02:20:36 +04:00
mov r24 =PAGE_SHIFT < < 2
;;
2006-03-08 06:05:32 +03:00
( p6 ) c m p . e q p6 ,p7 =r26 ,r18 / / O n l y i f p a g e i s p r e s e n t
2005-04-17 02:20:36 +04:00
;;
2008-05-19 17:13:38 +04:00
ITC_ D ( p6 , r25 , r26 ) / / i n s t a l l u p d a t e d P T E
2005-04-17 02:20:36 +04:00
/ *
* Tell t h e a s s e m b l e r s d e p e n d e n c y - v i o l a t i o n c h e c k e r t h a t t h e a b o v e " i t c " i n s t r u c t i o n s
* cannot p o s s i b l y a f f e c t t h e f o l l o w i n g l o a d s :
* /
dv_ s e r i a l i z e _ d a t a
;;
ld8 r18 = [ r17 ] / / r e a d P T E a g a i n
;;
cmp. e q p6 ,p7 =r18 ,r25 / / i s i t s a m e a s t h e n e w l y i n s t a l l e d
;;
( p7 ) p t c . l r16 ,r24
mov a r . c c v =r28
# else
;;
1 : ld8 r18 = [ r17 ]
;; // avoid RAW on r18
or r18 =_PAGE_A ,r18 / / s e t t h e a c c e s s e d b i t
;;
st8 [ r17 ] =r18 / / s t o r e b a c k u p d a t e d P T E
2008-10-17 06:17:41 +04:00
ITC_ D ( p0 , r18 , r16 ) / / i n s t a l l u p d a t e d P T E
2005-04-17 02:20:36 +04:00
# endif
mov b0 =r29 / / r e s t o r e b0
mov p r =r31 ,- 1
2008-05-19 17:13:38 +04:00
RFI
2005-04-17 02:20:36 +04:00
END( d a c c e s s _ b i t )
.org ia6 4 _ i v t + 0 x2 c00
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x2 c00 E n t r y 1 1 ( s i z e 6 4 b u n d l e s ) B r e a k i n s t r u c t i o n ( 3 3 )
ENTRY( b r e a k _ f a u l t )
/ *
* The s t r e a m l i n e d s y s t e m c a l l e n t r y / e x i t p a t h s o n l y s a v e / r e s t o r e t h e i n i t i a l p a r t
* of p t _ r e g s . T h i s i m p l i e s t h a t t h e c a l l e r s o f s y s t e m - c a l l s m u s t a d h e r e t o t h e
* normal p r o c e d u r e c a l l i n g c o n v e n t i o n s .
*
* Registers t o b e s a v e d & r e s t o r e d :
* CR r e g i s t e r s : c r . i p s r , c r . i i p , c r . i f s
* AR r e g i s t e r s : a r . u n a t , a r . p f s , a r . r s c , a r . r n a t , a r . b s p s t o r e , a r . f p s r
* others : pr, b0 , b6 , l o a d r s , r1 , r11 , r12 , r13 , r15
* Registers t o b e r e s t o r e d o n l y :
* r8 - r11 : o u t p u t v a l u e f r o m t h e s y s t e m c a l l .
*
* During s y s t e m c a l l e x i t , s c r a t c h r e g i s t e r s ( i n c l u d i n g r15 ) a r e m o d i f i e d / c l e a r e d
* to p r e v e n t l e a k i n g b i t s f r o m k e r n e l t o u s e r l e v e l .
* /
DBG_ F A U L T ( 1 1 )
2005-04-28 08:19:04 +04:00
mov. m r16 =IA64_KR ( C U R R E N T ) / / M 2 r16 < - c u r r e n t t a s k ( 1 2 c y c )
2008-05-19 17:13:38 +04:00
MOV_ F R O M _ I P S R ( p0 , r29 ) / / M 2 ( 1 2 c y c )
2005-04-28 08:19:04 +04:00
mov r31 =pr / / I 0 ( 2 c y c )
2005-04-17 02:20:36 +04:00
2008-05-19 17:13:38 +04:00
MOV_ F R O M _ I I M ( r17 ) / / M 2 ( 2 c y c )
2005-04-28 08:19:04 +04:00
mov. m r27 =ar . r s c / / M 2 ( 1 2 c y c )
mov r18 =__IA64_BREAK_SYSCALL / / A
2005-04-17 02:20:36 +04:00
2005-04-28 08:19:04 +04:00
mov. m a r . r s c =0 / / M 2
mov. m r21 =ar . f p s r / / M 2 ( 1 2 c y c )
mov r19 =b6 / / I 0 ( 2 c y c )
2005-04-17 02:20:36 +04:00
;;
2005-04-28 08:19:04 +04:00
mov. m r23 =ar . b s p s t o r e / / M 2 ( 1 2 c y c )
mov. m r24 =ar . r n a t / / M 2 ( 5 c y c )
mov. i r26 =ar . p f s / / I 0 ( 2 c y c )
2005-04-17 02:20:36 +04:00
2005-04-28 08:19:04 +04:00
invala / / M 0 | 1
nop. m 0 / / M
mov r20 =r1 / / A s a v e r1
nop. m 0
movl r30 =sys_call_table / / X
2008-05-19 17:13:38 +04:00
MOV_ F R O M _ I I P ( r28 ) / / M 2 ( 2 c y c )
2005-04-28 08:19:04 +04:00
cmp. e q p0 ,p7 =r18 ,r17 / / I 0 i s t h i s a s y s t e m c a l l ?
( p7 ) b r . c o n d . s p n t n o n _ s y s c a l l / / B n o - >
/ /
/ / From t h i s p o i n t o n , w e a r e d e f i n i t e l y o n t h e s y s c a l l - p a t h
/ / and w e c a n u s e ( n o n - b a n k e d ) s c r a t c h r e g i s t e r s .
/ /
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
mov r1 =r16 / / A m o v e t a s k - p o i n t e r t o " a d d l " - a d d r e s s a b l e r e g
mov r2 =r16 / / A s e t u p r2 f o r i a64 _ s y s c a l l _ s e t u p
add r9 =TI_FLAGS + I A 6 4 _ T A S K _ S I Z E ,r16 / / A r9 = & c u r r e n t _ t h r e a d _ i n f o ( ) - > f l a g s
adds r16 =IA64_TASK_THREAD_ON_USTACK_OFFSET ,r16
adds r15 = - 1 0 2 4 ,r15 / / A s u b t r a c t 1 0 2 4 f r o m s y s c a l l n u m b e r
2005-04-17 02:20:36 +04:00
mov r3 =NR_syscalls - 1
;;
2005-04-28 08:19:04 +04:00
ld1 . b i a s r17 = [ r16 ] / / M 0 | 1 r17 = c u r r e n t - > t h r e a d . o n _ u s t a c k f l a g
ld4 r9 = [ r9 ] / / M 0 | 1 r9 = c u r r e n t _ t h r e a d _ i n f o ( ) - > f l a g s
extr. u r8 =r29 ,4 1 ,2 / / I 0 e x t r a c t e i f i e l d f r o m c r . i p s r
2005-04-17 02:20:36 +04:00
2005-04-28 08:19:04 +04:00
shladd r30 =r15 ,3 ,r30 / / A r30 = s y s _ c a l l _ t a b l e + 8 * ( s y s c a l l - 1 0 2 4 )
addl r22 =IA64_RBS_OFFSET ,r1 / / A c o m p u t e b a s e o f R B S
cmp. l e u p6 ,p7 =r15 ,r3 / / A s y s c a l l n u m b e r i n r a n g e ?
2005-04-17 02:20:36 +04:00
;;
2005-04-28 08:19:04 +04:00
lfetch. f a u l t . e x c l . n t 1 [ r22 ] / / M 0 | 1 p r e f e t c h R B S
( p6 ) l d8 r30 = [ r30 ] / / M 0 | 1 l o a d a d d r e s s o f s y s c a l l e n t r y p o i n t
tnat. n z . o r p7 ,p0 =r15 / / I 0 i s s y s c a l l n r a N a T ?
mov. m a r . b s p s t o r e =r22 / / M 2 s w i t c h t o k e r n e l R B S
cmp. e q p8 ,p9 =2 ,r8 / / A i s r . e i = =2 ?
2005-04-17 02:20:36 +04:00
;;
2005-04-28 08:19:04 +04:00
( p8 ) m o v r8 =0 / / A c l e a r e i t o 0
( p7 ) m o v l r30 =sys_ni_syscall / / X
( p8 ) a d d s r28 =16 ,r28 / / A s w i t c h c r . i i p t o n e x t b u n d l e
( p9 ) a d d s r8 =1 ,r8 / / A i n c r e m e n t e i t o n e x t s l o t
2008-01-29 08:27:30 +03:00
# ifdef C O N F I G _ V I R T _ C P U _ A C C O U N T I N G
;;
mov b6 =r30 / / I 0 s e t u p s y s c a l l h a n d l e r b r a n c h r e g e a r l y
# else
2005-04-28 08:19:04 +04:00
nop. i 0
2005-04-17 02:20:36 +04:00
;;
2008-01-29 08:27:30 +03:00
# endif
2005-04-28 08:19:04 +04:00
mov. m r25 =ar . u n a t / / M 2 ( 5 c y c )
dep r29 =r8 ,r29 ,4 1 ,2 / / I 0 i n s e r t n e w e i i n t o c r . i p s r
adds r15 =1024 ,r15 / / A r e s t o r e o r i g i n a l s y s c a l l n u m b e r
/ /
/ / If a n y o f t h e a b o v e l o a d s m i s s i n L 1 D , w e ' l l s t a l l h e r e u n t i l
/ / the d a t a a r r i v e s .
/ /
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
st1 [ r16 ] =r0 / / M 2 | 3 c l e a r c u r r e n t - > t h r e a d . o n _ u s t a c k f l a g
2008-01-29 08:27:30 +03:00
# ifdef C O N F I G _ V I R T _ C P U _ A C C O U N T I N G
mov. m r30 =ar . i t c / / M g e t c y c l e f o r a c c o u n t i n g
# else
2005-04-28 08:19:04 +04:00
mov b6 =r30 / / I 0 s e t u p s y s c a l l h a n d l e r b r a n c h r e g e a r l y
2008-01-29 08:27:30 +03:00
# endif
2005-04-28 08:19:04 +04:00
cmp. e q p K S t k ,p U S t k =r0 ,r17 / / A w e r e w e o n k e r n e l s t a c k s a l r e a d y ?
and r9 =_TIF_SYSCALL_TRACEAUDIT ,r9 / / A m a s k t r a c e o r a u d i t
mov r18 =ar . b s p / / M 2 ( 1 2 c y c )
( pKStk) b r . c o n d . s p n t . b r e a k _ f i x u p / / B w e ' r e a l r e a d y i n k e r n e l - m o d e - - f i x u p R B S
;;
.back_from_break_fixup :
( pUStk) a d d l r1 =IA64_STK_OFFSET - I A 6 4 _ P T _ R E G S _ S I Z E ,r1 / / A c o m p u t e b a s e o f m e m o r y s t a c k
cmp. e q p14 ,p0 =r9 ,r0 / / A a r e s y s c a l l s b e i n g t r a c e d / a u d i t e d ?
br. c a l l . s p t k . m a n y b7 =ia64_syscall_setup / / B
1 :
2008-01-29 08:27:30 +03:00
# ifdef C O N F I G _ V I R T _ C P U _ A C C O U N T I N G
/ / mov. m r30 =ar . i t c i s c a l l e d i n a d v a n c e , a n d r13 i s c u r r e n t
add r16 =TI_AC_STAMP + I A 6 4 _ T A S K _ S I Z E ,r13 / / A
add r17 =TI_AC_LEAVE + I A 6 4 _ T A S K _ S I Z E ,r13 / / A
( pKStk) b r . c o n d . s p n t . s k i p _ a c c o u n t i n g / / B u n l i k e l y s k i p
;;
ld8 r18 = [ r16 ] ,T I _ A C _ S T I M E - T I _ A C _ S T A M P / / M g e t l a s t s t a m p
ld8 r19 = [ r17 ] ,T I _ A C _ U T I M E - T I _ A C _ L E A V E / / M t i m e a t l e a v e
;;
ld8 r20 = [ r16 ] ,T I _ A C _ S T A M P - T I _ A C _ S T I M E / / M c u m u l a t e d s t i m e
ld8 r21 = [ r17 ] / / M c u m u l a t e d u t i m e
sub r22 =r19 ,r18 / / A s t i m e b e f o r e l e a v e
;;
st8 [ r16 ] =r30 ,T I _ A C _ S T I M E - T I _ A C _ S T A M P / / M u p d a t e s t a m p
sub r18 =r30 ,r19 / / A e l a p s e d t i m e i n u s e r
;;
add r20 =r20 ,r22 / / A s u m s t i m e
add r21 =r21 ,r18 / / A s u m u t i m e
;;
st8 [ r16 ] =r20 / / M u p d a t e s t i m e
st8 [ r17 ] =r21 / / M u p d a t e u t i m e
;;
.skip_accounting :
# endif
2005-04-28 08:19:04 +04:00
mov a r . r s c =0x3 / / M 2 s e t e a g e r m o d e , p l 0 , L E , l o a d r s =0
nop 0
2008-05-19 17:13:38 +04:00
BSW_ 1 ( r2 , r14 ) / / B ( 6 c y c ) r e g s a r e s a v e d , s w i t c h t o b a n k 1
2005-04-17 02:20:36 +04:00
;;
2005-04-28 08:19:04 +04:00
2008-05-19 17:13:38 +04:00
SSM_ P S R _ I C _ A N D _ D E F A U L T _ B I T S _ A N D _ S R L Z _ I ( r3 , r16 ) / / M 2 n o w i t ' s s a f e t o r e - e n a b l e i n t r . - c o l l e c t i o n
/ / M0 e n s u r e i n t e r r u p t i o n c o l l e c t i o n i s o n
2005-04-28 08:19:04 +04:00
movl r3 =ia64_ret_from_syscall / / X
2005-04-17 02:20:36 +04:00
;;
2005-04-28 08:19:04 +04:00
mov r p =r3 / / I 0 s e t t h e r e a l r e t u r n a d d r
( p1 0 ) b r . c o n d . s p n t . m a n y i a64 _ r e t _ f r o m _ s y s c a l l / / B r e t u r n i f b a d c a l l - f r a m e o r r15 i s a N a T
2008-05-19 17:13:38 +04:00
SSM_ P S R _ I ( p15 , p15 , r16 ) / / M 2 r e s t o r e p s r . i
2005-04-28 08:19:04 +04:00
( p1 4 ) b r . c a l l . s p t k . m a n y b6 =b6 / / B i n v o k e s y s c a l l - h a n d k e r ( i g n o r e r e t u r n a d d r )
br. c o n d . s p n t . m a n y i a64 _ t r a c e _ s y s c a l l / / B d o s y s c a l l - t r a c i n g t h i n g a m a g i c
2005-04-17 02:20:36 +04:00
/ / NOT R E A C H E D
2005-04-28 08:19:04 +04:00
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / On e n t r y , w e o p t i m i s t i c a l l y a s s u m e d t h a t w e ' r e c o m i n g f r o m u s e r - s p a c e .
/ / For t h e r a r e c a s e s w h e r e a s y s t e m - c a l l i s d o n e f r o m w i t h i n t h e k e r n e l ,
/ / we f i x t h i n g s u p a t t h i s p o i n t :
.break_fixup :
add r1 = - I A 6 4 _ P T _ R E G S _ S I Z E ,s p / / A a l l o c a t e s p a c e f o r p t _ r e g s s t r u c t u r e
mov a r . r n a t =r24 / / M 2 r e s t o r e k e r n e l ' s A R . R N A T
;;
mov a r . b s p s t o r e =r23 / / M 2 r e s t o r e k e r n e l ' s A R . B S P S T O R E
br. c o n d . s p t k . b a c k _ f r o m _ b r e a k _ f i x u p
2005-04-17 02:20:36 +04:00
END( b r e a k _ f a u l t )
.org ia6 4 _ i v t + 0 x30 0 0
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x3 0 0 0 E n t r y 1 2 ( s i z e 6 4 b u n d l e s ) E x t e r n a l I n t e r r u p t ( 4 )
ENTRY( i n t e r r u p t )
2008-05-28 20:41:58 +04:00
/* interrupt handler has become too big to fit this area. */
br. s p t k . m a n y _ _ i n t e r r u p t
2005-04-17 02:20:36 +04:00
END( i n t e r r u p t )
.org ia6 4 _ i v t + 0 x34 0 0
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x3 4 0 0 E n t r y 1 3 ( s i z e 6 4 b u n d l e s ) R e s e r v e d
DBG_ F A U L T ( 1 3 )
FAULT( 1 3 )
.org ia6 4 _ i v t + 0 x38 0 0
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x3 8 0 0 E n t r y 1 4 ( s i z e 6 4 b u n d l e s ) R e s e r v e d
DBG_ F A U L T ( 1 4 )
FAULT( 1 4 )
/ *
* There i s n o p a r t i c u l a r r e a s o n f o r t h i s c o d e t o b e h e r e , o t h e r t h a n t h a t
* there h a p p e n s t o b e s p a c e h e r e t h a t w o u l d g o u n u s e d o t h e r w i s e . I f t h i s
* fault e v e r g e t s " u n r e s e r v e d " , s i m p l y m o v e d t h e f o l l o w i n g c o d e t o a m o r e
* suitable s p o t . . .
*
* ia6 4 _ s y s c a l l _ s e t u p ( ) i s a s e p a r a t e s u b r o u t i n e s o t h a t i t c a n
* allocate s t a c k e d r e g i s t e r s s o i t c a n s a f e l y d e m i n e a n y
* potential N a T v a l u e s f r o m t h e i n p u t r e g i s t e r s .
*
* On e n t r y :
* - executing o n b a n k 0 o r b a n k 1 r e g i s t e r s e t ( d o e s n ' t m a t t e r )
* - r1 : stack p o i n t e r
* - r2 : current t a s k p o i n t e r
* - r3 : preserved
* - r11 : original c o n t e n t s ( s a v e d a r . p f s t o b e s a v e d )
* - r12 : original c o n t e n t s ( s p t o b e s a v e d )
* - r13 : original c o n t e n t s ( t p t o b e s a v e d )
* - r15 : original c o n t e n t s ( s y s c a l l # t o b e s a v e d )
* - r18 : saved b s p ( a f t e r s w i t c h i n g t o k e r n e l s t a c k )
* - r19 : saved b6
* - r20 : saved r1 ( g p )
* - r21 : saved a r . f p s r
* - r22 : kernel' s r e g i s t e r b a c k i n g s t o r e b a s e ( k r b s _ b a s e )
* - r23 : saved a r . b s p s t o r e
* - r24 : saved a r . r n a t
* - r25 : saved a r . u n a t
* - r26 : saved a r . p f s
* - r27 : saved a r . r s c
* - r28 : saved c r . i i p
* - r29 : saved c r . i p s r
2008-01-29 08:27:30 +03:00
* - r30 : ar. i t c f o r a c c o u n t i n g ( d o n ' t t o u c h )
2005-04-17 02:20:36 +04:00
* - r31 : saved p r
* - b0 : original c o n t e n t s ( t o b e s a v e d )
* On e x i t :
* - p10 : TRUE i f s y s c a l l i s i n v o k e d w i t h m o r e t h a n 8 o u t
* registers o r r15 ' s N a t i s t r u e
* - r1 : kernel' s g p
* - r3 : preserved ( s a m e a s o n e n t r y )
* - r8 : - EINVAL i f p10 i s t r u e
* - r12 : points t o k e r n e l s t a c k
* - r13 : points t o c u r r e n t t a s k
2005-04-28 08:19:04 +04:00
* - r14 : preserved ( s a m e a s o n e n t r y )
* - p13 : preserved
2005-04-17 02:20:36 +04:00
* - p15 : TRUE i f i n t e r r u p t s n e e d t o b e r e - e n a b l e d
* - ar. f p s r : s e t t o k e r n e l s e t t i n g s
2005-04-28 08:19:04 +04:00
* - b6 : preserved ( s a m e a s o n e n t r y )
2005-04-17 02:20:36 +04:00
* /
2008-05-19 17:13:38 +04:00
# ifdef _ _ I A 6 4 _ A S M _ P A R A V I R T U A L I Z E D _ N A T I V E
2005-04-17 02:20:36 +04:00
GLOBAL_ E N T R Y ( i a64 _ s y s c a l l _ s e t u p )
# if P T ( B 6 ) ! = 0
# error T h i s c o d e a s s u m e s t h a t b6 i s t h e f i r s t f i e l d i n p t _ r e g s .
# endif
st8 [ r1 ] =r19 / / s a v e b6
add r16 =PT ( C R _ I P S R ) ,r1 / / i n i t i a l i z e f i r s t b a s e p o i n t e r
add r17 =PT ( R 1 1 ) ,r1 / / i n i t i a l i z e s e c o n d b a s e p o i n t e r
;;
alloc r19 =ar . p f s ,8 ,0 ,0 ,0 / / e n s u r e i n 0 - i n 7 a r e w r i t a b l e
st8 [ r16 ] =r29 ,P T ( A R _ P F S ) - P T ( C R _ I P S R ) / / s a v e c r . i p s r
tnat. n z p8 ,p0 =in0
st8 . s p i l l [ r17 ] =r11 ,P T ( C R _ I I P ) - P T ( R 1 1 ) / / s a v e r11
tnat. n z p9 ,p0 =in1
( pKStk) m o v r18 =r0 / / m a k e s u r e r18 i s n ' t N a T
;;
st8 [ r16 ] =r26 ,P T ( C R _ I F S ) - P T ( A R _ P F S ) / / s a v e a r . p f s
st8 [ r17 ] =r28 ,P T ( A R _ U N A T ) - P T ( C R _ I I P ) / / s a v e c r . i i p
mov r28 =b0 / / s a v e b0 ( 2 c y c )
;;
st8 [ r17 ] =r25 ,P T ( A R _ R S C ) - P T ( A R _ U N A T ) / / s a v e a r . u n a t
dep r19 =0 ,r19 ,3 8 ,2 6 / / c l e a r a l l b i t s b u t 0 . . 3 7 [ I 0 ]
( p8 ) m o v i n 0 = - 1
;;
st8 [ r16 ] =r19 ,P T ( A R _ R N A T ) - P T ( C R _ I F S ) / / s t o r e a r . p f s . p f m i n c r . i f s
extr. u r11 =r19 ,7 ,7 / / I 0 / / g e t s o l o f a r . p f s
and r8 =0x7f ,r19 / / A / / g e t s o f o f a r . p f s
st8 [ r17 ] =r27 ,P T ( A R _ B S P S T O R E ) - P T ( A R _ R S C ) / / s a v e a r . r s c
tbit. n z p15 ,p0 =r29 ,I A 6 4 _ P S R _ I _ B I T / / I 0
( p9 ) m o v i n 1 = - 1
;;
( pUStk) s u b r18 =r18 ,r22 / / r18 =RSE . n d i r t y * 8
tnat. n z p10 ,p0 =in2
add r11 =8 ,r11
;;
( pKStk) a d d s r16 =PT ( P R ) - P T ( A R _ R N A T ) ,r16 / / s k i p o v e r a r _ r n a t f i e l d
( pKStk) a d d s r17 =PT ( B 0 ) - P T ( A R _ B S P S T O R E ) ,r17 / / s k i p o v e r a r _ b s p s t o r e f i e l d
tnat. n z p11 ,p0 =in3
;;
( p1 0 ) m o v i n 2 = - 1
tnat. n z p12 ,p0 =in4 / / [ I 0 ]
( p1 1 ) m o v i n 3 = - 1
;;
( pUStk) s t 8 [ r16 ] =r24 ,P T ( P R ) - P T ( A R _ R N A T ) / / s a v e a r . r n a t
( pUStk) s t 8 [ r17 ] =r23 ,P T ( B 0 ) - P T ( A R _ B S P S T O R E ) / / s a v e a r . b s p s t o r e
shl r18 =r18 ,1 6 / / c o m p u t e a r . r s c t o b e u s e d f o r " l o a d r s "
;;
st8 [ r16 ] =r31 ,P T ( L O A D R S ) - P T ( P R ) / / s a v e p r e d i c a t e s
st8 [ r17 ] =r28 ,P T ( R 1 ) - P T ( B 0 ) / / s a v e b0
tnat. n z p13 ,p0 =in5 / / [ I 0 ]
;;
st8 [ r16 ] =r18 ,P T ( R 1 2 ) - P T ( L O A D R S ) / / s a v e a r . r s c v a l u e f o r " l o a d r s "
st8 . s p i l l [ r17 ] =r20 ,P T ( R 1 3 ) - P T ( R 1 ) / / s a v e o r i g i n a l r1
( p1 2 ) m o v i n 4 = - 1
;;
.mem .offset 0 , 0 ; st8.spill [r16]=r12,PT(AR_FPSR)-PT(R12) // save r12
.mem .offset 8 , 0 ; st8.spill [r17]=r13,PT(R15)-PT(R13) // save r13
( p1 3 ) m o v i n 5 = - 1
;;
st8 [ r16 ] =r21 ,P T ( R 8 ) - P T ( A R _ F P S R ) / / s a v e a r . f p s r
2005-04-28 08:19:04 +04:00
tnat. n z p13 ,p0 =in6
2005-04-17 02:20:36 +04:00
cmp. l t p10 ,p9 =r11 ,r8 / / f r a m e s i z e c a n ' t b e m o r e t h a n l o c a l + 8
;;
2005-04-28 08:17:03 +04:00
mov r8 =1
2005-04-17 02:20:36 +04:00
( p9 ) t n a t . n z p10 ,p0 =r15
adds r12 = - 1 6 ,r1 / / s w i t c h t o k e r n e l m e m o r y s t a c k ( w i t h 1 6 b y t e s o f s c r a t c h )
st8 . s p i l l [ r17 ] =r15 / / s a v e r15
tnat. n z p8 ,p0 =in7
nop. i 0
mov r13 =r2 / / e s t a b l i s h ` c u r r e n t '
movl r1 =__gp / / e s t a b l i s h k e r n e l g l o b a l p o i n t e r
;;
2005-04-28 08:17:03 +04:00
st8 [ r16 ] =r8 / / e n s u r e p t _ r e g s . r8 ! = 0 ( s e e h a n d l e _ s y s c a l l _ e r r o r )
2005-04-28 08:19:04 +04:00
( p1 3 ) m o v i n 6 = - 1
2005-04-17 02:20:36 +04:00
( p8 ) m o v i n 7 = - 1
cmp. e q p S y s ,p N o n S y s =r0 ,r0 / / s e t p S y s =1 , p N o n S y s =0
movl r17 =FPSR_DEFAULT
;;
mov. m a r . f p s r =r17 / / s e t a r . f p s r t o k e r n e l d e f a u l t v a l u e
( p1 0 ) m o v r8 = - E I N V A L
br. r e t . s p t k . m a n y b7
END( i a64 _ s y s c a l l _ s e t u p )
2008-05-19 17:13:38 +04:00
# endif / * _ _ I A 6 4 _ A S M _ P A R A V I R T U A L I Z E D _ N A T I V E * /
2005-04-17 02:20:36 +04:00
.org ia6 4 _ i v t + 0 x3 c00
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x3 c00 E n t r y 1 5 ( s i z e 6 4 b u n d l e s ) R e s e r v e d
DBG_ F A U L T ( 1 5 )
FAULT( 1 5 )
.org ia6 4 _ i v t + 0 x40 0 0
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x4 0 0 0 E n t r y 1 6 ( s i z e 6 4 b u n d l e s ) R e s e r v e d
DBG_ F A U L T ( 1 6 )
FAULT( 1 6 )
2008-05-19 17:13:38 +04:00
# if d e f i n e d ( C O N F I G _ V I R T _ C P U _ A C C O U N T I N G ) & & d e f i n e d ( _ _ I A 6 4 _ A S M _ P A R A V I R T U A L I Z E D _ N A T I V E )
2008-01-29 08:27:30 +03:00
/ *
* There i s n o p a r t i c u l a r r e a s o n f o r t h i s c o d e t o b e h e r e , o t h e r t h a n
* that t h e r e h a p p e n s t o b e s p a c e h e r e t h a t w o u l d g o u n u s e d o t h e r w i s e .
* If t h i s f a u l t e v e r g e t s " u n r e s e r v e d " , s i m p l y m o v e d t h e f o l l o w i n g
* code t o a m o r e s u i t a b l e s p o t . . .
*
* account_ s y s _ e n t e r i s c a l l e d f r o m S A V E _ M I N * m a c r o s i f a c c o u n t i n g i s
* enabled a n d i f t h e m a c r o i s e n t e r e d f r o m u s e r m o d e .
* /
2008-05-19 17:13:38 +04:00
GLOBAL_ E N T R Y ( a c c o u n t _ s y s _ e n t e r )
2008-01-29 08:27:30 +03:00
/ / mov. m r20 =ar . i t c i s c a l l e d i n a d v a n c e , a n d r13 i s c u r r e n t
add r16 =TI_AC_STAMP + I A 6 4 _ T A S K _ S I Z E ,r13
add r17 =TI_AC_LEAVE + I A 6 4 _ T A S K _ S I Z E ,r13
;;
ld8 r18 = [ r16 ] ,T I _ A C _ S T I M E - T I _ A C _ S T A M P / / t i m e a t l a s t c h e c k i n k e r n e l
ld8 r19 = [ r17 ] ,T I _ A C _ U T I M E - T I _ A C _ L E A V E / / t i m e a t l e f t f r o m k e r n e l
;;
ld8 r23 = [ r16 ] ,T I _ A C _ S T A M P - T I _ A C _ S T I M E / / c u m u l a t e d s t i m e
ld8 r21 = [ r17 ] / / c u m u l a t e d u t i m e
sub r22 =r19 ,r18 / / s t i m e b e f o r e l e a v e k e r n e l
;;
st8 [ r16 ] =r20 ,T I _ A C _ S T I M E - T I _ A C _ S T A M P / / u p d a t e s t a m p
sub r18 =r20 ,r19 / / e l a p s e d t i m e i n u s e r m o d e
;;
add r23 =r23 ,r22 / / s u m s t i m e
add r21 =r21 ,r18 / / s u m u t i m e
;;
st8 [ r16 ] =r23 / / u p d a t e s t i m e
st8 [ r17 ] =r21 / / u p d a t e u t i m e
;;
br. r e t . s p t k . m a n y r p
END( a c c o u n t _ s y s _ e n t e r )
# endif
2005-04-17 02:20:36 +04:00
.org ia6 4 _ i v t + 0 x44 0 0
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x4 4 0 0 E n t r y 1 7 ( s i z e 6 4 b u n d l e s ) R e s e r v e d
DBG_ F A U L T ( 1 7 )
FAULT( 1 7 )
.org ia6 4 _ i v t + 0 x48 0 0
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x4 8 0 0 E n t r y 1 8 ( s i z e 6 4 b u n d l e s ) R e s e r v e d
DBG_ F A U L T ( 1 8 )
FAULT( 1 8 )
.org ia6 4 _ i v t + 0 x4 c00
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x4 c00 E n t r y 1 9 ( s i z e 6 4 b u n d l e s ) R e s e r v e d
DBG_ F A U L T ( 1 9 )
FAULT( 1 9 )
/ /
/ / - - - End o f l o n g e n t r i e s , B e g i n n i n g o f s h o r t e n t r i e s
/ /
.org ia6 4 _ i v t + 0 x50 0 0
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x5 0 0 0 E n t r y 2 0 ( s i z e 1 6 b u n d l e s ) P a g e N o t P r e s e n t ( 1 0 ,2 2 ,4 9 )
ENTRY( p a g e _ n o t _ p r e s e n t )
DBG_ F A U L T ( 2 0 )
2008-05-19 17:13:38 +04:00
MOV_ F R O M _ I F A ( r16 )
RSM_ P S R _ D T
2005-04-17 02:20:36 +04:00
/ *
* The L i n u x p a g e f a u l t h a n d l e r d o e s n ' t e x p e c t n o n - p r e s e n t p a g e s t o b e i n
* the T L B . F l u s h t h e e x i s t i n g e n t r y n o w , s o w e m e e t t h a t e x p e c t a t i o n .
* /
mov r17 =PAGE_SHIFT < < 2
;;
ptc. l r16 ,r17
;;
mov r31 =pr
srlz. d
br. s p t k . m a n y p a g e _ f a u l t
END( p a g e _ n o t _ p r e s e n t )
.org ia6 4 _ i v t + 0 x51 0 0
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x5 1 0 0 E n t r y 2 1 ( s i z e 1 6 b u n d l e s ) K e y P e r m i s s i o n ( 1 3 ,2 5 ,5 2 )
ENTRY( k e y _ p e r m i s s i o n )
DBG_ F A U L T ( 2 1 )
2008-05-19 17:13:38 +04:00
MOV_ F R O M _ I F A ( r16 )
RSM_ P S R _ D T
2005-04-17 02:20:36 +04:00
mov r31 =pr
;;
srlz. d
br. s p t k . m a n y p a g e _ f a u l t
END( k e y _ p e r m i s s i o n )
.org ia6 4 _ i v t + 0 x52 0 0
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x5 2 0 0 E n t r y 2 2 ( s i z e 1 6 b u n d l e s ) I n s t r u c t i o n A c c e s s R i g h t s ( 2 6 )
ENTRY( i a c c e s s _ r i g h t s )
DBG_ F A U L T ( 2 2 )
2008-05-19 17:13:38 +04:00
MOV_ F R O M _ I F A ( r16 )
RSM_ P S R _ D T
2005-04-17 02:20:36 +04:00
mov r31 =pr
;;
srlz. d
br. s p t k . m a n y p a g e _ f a u l t
END( i a c c e s s _ r i g h t s )
.org ia6 4 _ i v t + 0 x53 0 0
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x5 3 0 0 E n t r y 2 3 ( s i z e 1 6 b u n d l e s ) D a t a A c c e s s R i g h t s ( 1 4 ,5 3 )
ENTRY( d a c c e s s _ r i g h t s )
DBG_ F A U L T ( 2 3 )
2008-05-19 17:13:38 +04:00
MOV_ F R O M _ I F A ( r16 )
RSM_ P S R _ D T
2005-04-17 02:20:36 +04:00
mov r31 =pr
;;
srlz. d
br. s p t k . m a n y p a g e _ f a u l t
END( d a c c e s s _ r i g h t s )
.org ia6 4 _ i v t + 0 x54 0 0
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x5 4 0 0 E n t r y 2 4 ( s i z e 1 6 b u n d l e s ) G e n e r a l E x c e p t i o n ( 5 ,3 2 ,3 4 ,3 6 ,3 8 ,3 9 )
ENTRY( g e n e r a l _ e x c e p t i o n )
DBG_ F A U L T ( 2 4 )
2008-05-19 17:13:38 +04:00
MOV_ F R O M _ I S R ( r16 )
2005-04-17 02:20:36 +04:00
mov r31 =pr
;;
cmp4 . e q p6 ,p0 =0 ,r16
( p6 ) b r . s p t k . m a n y d i s p a t c h _ i l l e g a l _ o p _ f a u l t
;;
mov r19 =24 / / f a u l t n u m b e r
br. s p t k . m a n y d i s p a t c h _ t o _ f a u l t _ h a n d l e r
END( g e n e r a l _ e x c e p t i o n )
.org ia6 4 _ i v t + 0 x55 0 0
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x5 5 0 0 E n t r y 2 5 ( s i z e 1 6 b u n d l e s ) D i s a b l e d F P - R e g i s t e r ( 3 5 )
ENTRY( d i s a b l e d _ f p _ r e g )
DBG_ F A U L T ( 2 5 )
rsm p s r . d f h / / e n s u r e w e c a n a c c e s s f p h
;;
srlz. d
mov r31 =pr
mov r19 =25
br. s p t k . m a n y d i s p a t c h _ t o _ f a u l t _ h a n d l e r
END( d i s a b l e d _ f p _ r e g )
.org ia6 4 _ i v t + 0 x56 0 0
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x5 6 0 0 E n t r y 2 6 ( s i z e 1 6 b u n d l e s ) N a t C o n s u m p t i o n ( 1 1 ,2 3 ,3 7 ,5 0 )
ENTRY( n a t _ c o n s u m p t i o n )
DBG_ F A U L T ( 2 6 )
2005-05-05 00:25:00 +04:00
2008-05-19 17:13:38 +04:00
MOV_ F R O M _ I P S R ( p0 , r16 )
MOV_ F R O M _ I S R ( r17 )
2005-05-05 00:25:00 +04:00
mov r31 =pr / / s a v e P R
;;
and r18 =0xf ,r17 / / r18 = c r . i p s r . c o d e { 3 : 0 }
tbit. z p6 ,p0 =r17 ,I A 6 4 _ I S R _ N A _ B I T
;;
cmp. n e . o r p6 ,p0 =IA64_ISR_CODE_LFETCH ,r18
dep r16 = - 1 ,r16 ,I A 6 4 _ P S R _ E D _ B I T ,1
( p6 ) b r . c o n d . s p n t 1 f / / b r a n c h i f ( c r . i s p r . n a = = 0 | | c r . i p s r . c o d e { 3 : 0 } ! = L F E T C H )
;;
2008-05-19 17:13:38 +04:00
MOV_ T O _ I P S R ( p0 , r16 , r18 )
2005-05-05 00:25:00 +04:00
mov p r =r31 ,- 1
;;
2008-05-19 17:13:38 +04:00
RFI
2005-05-05 00:25:00 +04:00
1 : mov p r =r31 ,- 1
;;
2005-04-17 02:20:36 +04:00
FAULT( 2 6 )
END( n a t _ c o n s u m p t i o n )
.org ia6 4 _ i v t + 0 x57 0 0
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x5 7 0 0 E n t r y 2 7 ( s i z e 1 6 b u n d l e s ) S p e c u l a t i o n ( 4 0 )
ENTRY( s p e c u l a t i o n _ v e c t o r )
DBG_ F A U L T ( 2 7 )
/ *
* A [ f ] c h k . [ a s ] i n s t r u c t i o n n e e d s t o t a k e t h e b r a n c h t o t h e r e c o v e r y c o d e b u t
* this p a r t o f t h e a r c h i t e c t u r e i s n o t i m p l e m e n t e d i n h a r d w a r e o n s o m e C P U s , s u c h
* as I t a n i u m . T h u s , i n g e n e r a l w e n e e d t o e m u l a t e t h e b e h a v i o r . I I M c o n t a i n s
* the r e l a t i v e t a r g e t ( n o t y e t s i g n e x t e n d e d ) . S o a f t e r s i g n e x t e n d i n g i t w e
* simply a d d i t t o I I P . W e a l s o n e e d t o r e s e t t h e E I f i e l d o f t h e I P S R t o z e r o ,
* i. e . , t h e s l o t t o r e s t a r t i n t o .
*
* cr. i m m c o n t a i n s z e r o _ e x t ( i m m 2 1 )
* /
2008-05-19 17:13:38 +04:00
MOV_ F R O M _ I I M ( r18 )
2005-04-17 02:20:36 +04:00
;;
2008-05-19 17:13:38 +04:00
MOV_ F R O M _ I I P ( r17 )
2005-04-17 02:20:36 +04:00
shl r18 =r18 ,4 3 / / p u t s i g n b i t i n p o s i t i o n ( 4 3 =64 - 2 1 )
;;
2008-05-19 17:13:38 +04:00
MOV_ F R O M _ I P S R ( p0 , r16 )
2005-04-17 02:20:36 +04:00
shr r18 =r18 ,3 9 / / s i g n e x t e n d ( 3 9 =43 - 4 )
;;
add r17 =r17 ,r18 / / n o w a d d t h e o f f s e t
;;
2008-08-04 07:02:28 +04:00
MOV_ T O _ I I P ( r17 , r19 )
2005-04-17 02:20:36 +04:00
dep r16 =0 ,r16 ,4 1 ,2 / / c l e a r E I
;;
2008-08-04 07:02:28 +04:00
MOV_ T O _ I P S R ( p0 , r16 , r19 )
2005-04-17 02:20:36 +04:00
;;
2008-05-19 17:13:38 +04:00
RFI
2005-04-17 02:20:36 +04:00
END( s p e c u l a t i o n _ v e c t o r )
.org ia6 4 _ i v t + 0 x58 0 0
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x5 8 0 0 E n t r y 2 8 ( s i z e 1 6 b u n d l e s ) R e s e r v e d
DBG_ F A U L T ( 2 8 )
FAULT( 2 8 )
.org ia6 4 _ i v t + 0 x59 0 0
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x5 9 0 0 E n t r y 2 9 ( s i z e 1 6 b u n d l e s ) D e b u g ( 1 6 ,2 8 ,5 6 )
ENTRY( d e b u g _ v e c t o r )
DBG_ F A U L T ( 2 9 )
FAULT( 2 9 )
END( d e b u g _ v e c t o r )
.org ia6 4 _ i v t + 0 x5 a00
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x5 a00 E n t r y 3 0 ( s i z e 1 6 b u n d l e s ) U n a l i g n e d R e f e r e n c e ( 5 7 )
ENTRY( u n a l i g n e d _ a c c e s s )
DBG_ F A U L T ( 3 0 )
mov r31 =pr / / p r e p a r e t o s a v e p r e d i c a t e s
;;
br. s p t k . m a n y d i s p a t c h _ u n a l i g n e d _ h a n d l e r
END( u n a l i g n e d _ a c c e s s )
.org ia6 4 _ i v t + 0 x5 b00
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x5 b00 E n t r y 3 1 ( s i z e 1 6 b u n d l e s ) U n s u p p o r t e d D a t a R e f e r e n c e ( 5 7 )
ENTRY( u n s u p p o r t e d _ d a t a _ r e f e r e n c e )
DBG_ F A U L T ( 3 1 )
FAULT( 3 1 )
END( u n s u p p o r t e d _ d a t a _ r e f e r e n c e )
.org ia6 4 _ i v t + 0 x5 c00
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x5 c00 E n t r y 3 2 ( s i z e 1 6 b u n d l e s ) F l o a t i n g - P o i n t F a u l t ( 6 4 )
ENTRY( f l o a t i n g _ p o i n t _ f a u l t )
DBG_ F A U L T ( 3 2 )
FAULT( 3 2 )
END( f l o a t i n g _ p o i n t _ f a u l t )
.org ia6 4 _ i v t + 0 x5 d00
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x5 d00 E n t r y 3 3 ( s i z e 1 6 b u n d l e s ) F l o a t i n g P o i n t T r a p ( 6 6 )
ENTRY( f l o a t i n g _ p o i n t _ t r a p )
DBG_ F A U L T ( 3 3 )
FAULT( 3 3 )
END( f l o a t i n g _ p o i n t _ t r a p )
.org ia6 4 _ i v t + 0 x5 e 0 0
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x5 e 0 0 E n t r y 3 4 ( s i z e 1 6 b u n d l e s ) L o w e r P r i v i l e g e T r a n s f e r T r a p ( 6 6 )
ENTRY( l o w e r _ p r i v i l e g e _ t r a p )
DBG_ F A U L T ( 3 4 )
FAULT( 3 4 )
END( l o w e r _ p r i v i l e g e _ t r a p )
.org ia6 4 _ i v t + 0 x5 f00
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x5 f00 E n t r y 3 5 ( s i z e 1 6 b u n d l e s ) T a k e n B r a n c h T r a p ( 6 8 )
ENTRY( t a k e n _ b r a n c h _ t r a p )
DBG_ F A U L T ( 3 5 )
FAULT( 3 5 )
END( t a k e n _ b r a n c h _ t r a p )
.org ia6 4 _ i v t + 0 x60 0 0
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x6 0 0 0 E n t r y 3 6 ( s i z e 1 6 b u n d l e s ) S i n g l e S t e p T r a p ( 6 9 )
ENTRY( s i n g l e _ s t e p _ t r a p )
DBG_ F A U L T ( 3 6 )
FAULT( 3 6 )
END( s i n g l e _ s t e p _ t r a p )
.org ia6 4 _ i v t + 0 x61 0 0
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x6 1 0 0 E n t r y 3 7 ( s i z e 1 6 b u n d l e s ) R e s e r v e d
DBG_ F A U L T ( 3 7 )
FAULT( 3 7 )
.org ia6 4 _ i v t + 0 x62 0 0
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x6 2 0 0 E n t r y 3 8 ( s i z e 1 6 b u n d l e s ) R e s e r v e d
DBG_ F A U L T ( 3 8 )
FAULT( 3 8 )
.org ia6 4 _ i v t + 0 x63 0 0
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x6 3 0 0 E n t r y 3 9 ( s i z e 1 6 b u n d l e s ) R e s e r v e d
DBG_ F A U L T ( 3 9 )
FAULT( 3 9 )
.org ia6 4 _ i v t + 0 x64 0 0
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x6 4 0 0 E n t r y 4 0 ( s i z e 1 6 b u n d l e s ) R e s e r v e d
DBG_ F A U L T ( 4 0 )
FAULT( 4 0 )
.org ia6 4 _ i v t + 0 x65 0 0
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x6 5 0 0 E n t r y 4 1 ( s i z e 1 6 b u n d l e s ) R e s e r v e d
DBG_ F A U L T ( 4 1 )
FAULT( 4 1 )
.org ia6 4 _ i v t + 0 x66 0 0
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x6 6 0 0 E n t r y 4 2 ( s i z e 1 6 b u n d l e s ) R e s e r v e d
DBG_ F A U L T ( 4 2 )
FAULT( 4 2 )
.org ia6 4 _ i v t + 0 x67 0 0
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x6 7 0 0 E n t r y 4 3 ( s i z e 1 6 b u n d l e s ) R e s e r v e d
DBG_ F A U L T ( 4 3 )
FAULT( 4 3 )
.org ia6 4 _ i v t + 0 x68 0 0
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x6 8 0 0 E n t r y 4 4 ( s i z e 1 6 b u n d l e s ) R e s e r v e d
DBG_ F A U L T ( 4 4 )
FAULT( 4 4 )
.org ia6 4 _ i v t + 0 x69 0 0
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x6 9 0 0 E n t r y 4 5 ( s i z e 1 6 b u n d l e s ) I A - 3 2 E x e c e p t i o n ( 1 7 ,1 8 ,2 9 ,4 1 ,4 2 ,4 3 ,4 4 ,5 8 ,6 0 ,6 1 ,6 2 ,7 2 ,7 3 ,7 5 ,7 6 ,7 7 )
ENTRY( i a32 _ e x c e p t i o n )
DBG_ F A U L T ( 4 5 )
FAULT( 4 5 )
END( i a32 _ e x c e p t i o n )
.org ia6 4 _ i v t + 0 x6 a00
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x6 a00 E n t r y 4 6 ( s i z e 1 6 b u n d l e s ) I A - 3 2 I n t e r c e p t ( 3 0 ,3 1 ,5 9 ,7 0 ,7 1 )
ENTRY( i a32 _ i n t e r c e p t )
DBG_ F A U L T ( 4 6 )
# ifdef C O N F I G _ I A 3 2 _ S U P P O R T
mov r31 =pr
2008-05-19 17:13:38 +04:00
MOV_ F R O M _ I S R ( r16 )
2005-04-17 02:20:36 +04:00
;;
extr. u r17 =r16 ,1 6 ,8 / / g e t I S R . c o d e
mov r18 =ar . e f l a g
2008-05-19 17:13:38 +04:00
MOV_ F R O M _ I I M ( r19 ) / / o l d e f l a g v a l u e
2005-04-17 02:20:36 +04:00
;;
cmp. n e p6 ,p0 =2 ,r17
( p6 ) b r . c o n d . s p n t 1 f / / n o t a s y s t e m f l a g f a u l t
xor r16 =r18 ,r19
;;
extr. u r17 =r16 ,1 8 ,1 / / g e t t h e e f l a g s . a c b i t
;;
cmp. e q p6 ,p0 =0 ,r17
( p6 ) b r . c o n d . s p n t 1 f / / e f l a g s . a c b i t d i d n ' t c h a n g e
;;
mov p r =r31 ,- 1 / / r e s t o r e p r e d i c a t e r e g i s t e r s
2008-05-19 17:13:38 +04:00
RFI
2005-04-17 02:20:36 +04:00
1 :
# endif / / C O N F I G _ I A 3 2 _ S U P P O R T
FAULT( 4 6 )
END( i a32 _ i n t e r c e p t )
.org ia6 4 _ i v t + 0 x6 b00
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x6 b00 E n t r y 4 7 ( s i z e 1 6 b u n d l e s ) I A - 3 2 I n t e r r u p t ( 7 4 )
ENTRY( i a32 _ i n t e r r u p t )
DBG_ F A U L T ( 4 7 )
# ifdef C O N F I G _ I A 3 2 _ S U P P O R T
mov r31 =pr
br. s p t k . m a n y d i s p a t c h _ t o _ i a32 _ h a n d l e r
# else
FAULT( 4 7 )
# endif
END( i a32 _ i n t e r r u p t )
.org ia6 4 _ i v t + 0 x6 c00
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x6 c00 E n t r y 4 8 ( s i z e 1 6 b u n d l e s ) R e s e r v e d
DBG_ F A U L T ( 4 8 )
FAULT( 4 8 )
.org ia6 4 _ i v t + 0 x6 d00
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x6 d00 E n t r y 4 9 ( s i z e 1 6 b u n d l e s ) R e s e r v e d
DBG_ F A U L T ( 4 9 )
FAULT( 4 9 )
.org ia6 4 _ i v t + 0 x6 e 0 0
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x6 e 0 0 E n t r y 5 0 ( s i z e 1 6 b u n d l e s ) R e s e r v e d
DBG_ F A U L T ( 5 0 )
FAULT( 5 0 )
.org ia6 4 _ i v t + 0 x6 f00
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x6 f00 E n t r y 5 1 ( s i z e 1 6 b u n d l e s ) R e s e r v e d
DBG_ F A U L T ( 5 1 )
FAULT( 5 1 )
.org ia6 4 _ i v t + 0 x70 0 0
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x7 0 0 0 E n t r y 5 2 ( s i z e 1 6 b u n d l e s ) R e s e r v e d
DBG_ F A U L T ( 5 2 )
FAULT( 5 2 )
.org ia6 4 _ i v t + 0 x71 0 0
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x7 1 0 0 E n t r y 5 3 ( s i z e 1 6 b u n d l e s ) R e s e r v e d
DBG_ F A U L T ( 5 3 )
FAULT( 5 3 )
.org ia6 4 _ i v t + 0 x72 0 0
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x7 2 0 0 E n t r y 5 4 ( s i z e 1 6 b u n d l e s ) R e s e r v e d
DBG_ F A U L T ( 5 4 )
FAULT( 5 4 )
.org ia6 4 _ i v t + 0 x73 0 0
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x7 3 0 0 E n t r y 5 5 ( s i z e 1 6 b u n d l e s ) R e s e r v e d
DBG_ F A U L T ( 5 5 )
FAULT( 5 5 )
.org ia6 4 _ i v t + 0 x74 0 0
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x7 4 0 0 E n t r y 5 6 ( s i z e 1 6 b u n d l e s ) R e s e r v e d
DBG_ F A U L T ( 5 6 )
FAULT( 5 6 )
.org ia6 4 _ i v t + 0 x75 0 0
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x7 5 0 0 E n t r y 5 7 ( s i z e 1 6 b u n d l e s ) R e s e r v e d
DBG_ F A U L T ( 5 7 )
FAULT( 5 7 )
.org ia6 4 _ i v t + 0 x76 0 0
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x7 6 0 0 E n t r y 5 8 ( s i z e 1 6 b u n d l e s ) R e s e r v e d
DBG_ F A U L T ( 5 8 )
FAULT( 5 8 )
.org ia6 4 _ i v t + 0 x77 0 0
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x7 7 0 0 E n t r y 5 9 ( s i z e 1 6 b u n d l e s ) R e s e r v e d
DBG_ F A U L T ( 5 9 )
FAULT( 5 9 )
.org ia6 4 _ i v t + 0 x78 0 0
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x7 8 0 0 E n t r y 6 0 ( s i z e 1 6 b u n d l e s ) R e s e r v e d
DBG_ F A U L T ( 6 0 )
FAULT( 6 0 )
.org ia6 4 _ i v t + 0 x79 0 0
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x7 9 0 0 E n t r y 6 1 ( s i z e 1 6 b u n d l e s ) R e s e r v e d
DBG_ F A U L T ( 6 1 )
FAULT( 6 1 )
.org ia6 4 _ i v t + 0 x7 a00
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x7 a00 E n t r y 6 2 ( s i z e 1 6 b u n d l e s ) R e s e r v e d
DBG_ F A U L T ( 6 2 )
FAULT( 6 2 )
.org ia6 4 _ i v t + 0 x7 b00
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x7 b00 E n t r y 6 3 ( s i z e 1 6 b u n d l e s ) R e s e r v e d
DBG_ F A U L T ( 6 3 )
FAULT( 6 3 )
.org ia6 4 _ i v t + 0 x7 c00
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x7 c00 E n t r y 6 4 ( s i z e 1 6 b u n d l e s ) R e s e r v e d
DBG_ F A U L T ( 6 4 )
FAULT( 6 4 )
.org ia6 4 _ i v t + 0 x7 d00
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x7 d00 E n t r y 6 5 ( s i z e 1 6 b u n d l e s ) R e s e r v e d
DBG_ F A U L T ( 6 5 )
FAULT( 6 5 )
.org ia6 4 _ i v t + 0 x7 e 0 0
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x7 e 0 0 E n t r y 6 6 ( s i z e 1 6 b u n d l e s ) R e s e r v e d
DBG_ F A U L T ( 6 6 )
FAULT( 6 6 )
.org ia6 4 _ i v t + 0 x7 f00
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / 0 x7 f00 E n t r y 6 7 ( s i z e 1 6 b u n d l e s ) R e s e r v e d
DBG_ F A U L T ( 6 7 )
FAULT( 6 7 )
2008-05-28 20:41:58 +04:00
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / call d o _ p a g e _ f a u l t ( p r e d i c a t e s a r e i n r31 , p s r . d t m a y b e o f f , r16 i s f a u l t i n g a d d r e s s )
ENTRY( p a g e _ f a u l t )
SSM_ P S R _ D T _ A N D _ S R L Z _ I
;;
SAVE_ M I N _ W I T H _ C O V E R
alloc r15 =ar . p f s ,0 ,0 ,3 ,0
MOV_ F R O M _ I F A ( o u t 0 )
MOV_ F R O M _ I S R ( o u t 1 )
SSM_ P S R _ I C _ A N D _ D E F A U L T _ B I T S _ A N D _ S R L Z _ I ( r14 , r3 )
adds r3 =8 ,r2 / / s e t u p s e c o n d b a s e p o i n t e r
SSM_ P S R _ I ( p15 , p15 , r14 ) / / r e s t o r e p s r . i
movl r14 =ia64_leave_kernel
;;
SAVE_ R E S T
mov r p =r14
;;
adds o u t 2 =16 ,r12 / / o u t 2 = p o i n t e r t o p t _ r e g s
br. c a l l . s p t k . m a n y b6 =ia64_do_page_fault / / i g n o r e r e t u r n a d d r e s s
END( p a g e _ f a u l t )
ENTRY( n o n _ s y s c a l l )
mov a r . r s c =r27 / / r e s t o r e a r . r s c b e f o r e S A V E _ M I N _ W I T H _ C O V E R
;;
SAVE_ M I N _ W I T H _ C O V E R
/ / There i s n o p a r t i c u l a r r e a s o n f o r t h i s c o d e t o b e h e r e , o t h e r t h a n t h a t
/ / there h a p p e n s t o b e s p a c e h e r e t h a t w o u l d g o u n u s e d o t h e r w i s e . I f t h i s
/ / fault e v e r g e t s " u n r e s e r v e d " , s i m p l y m o v e d t h e f o l l o w i n g c o d e t o a m o r e
/ / suitable s p o t . . .
alloc r14 =ar . p f s ,0 ,0 ,2 ,0
MOV_ F R O M _ I I M ( o u t 0 )
add o u t 1 =16 ,s p
adds r3 =8 ,r2 / / s e t u p s e c o n d b a s e p o i n t e r f o r S A V E _ R E S T
SSM_ P S R _ I C _ A N D _ D E F A U L T _ B I T S _ A N D _ S R L Z _ I ( r15 , r24 )
/ / guarantee t h a t i n t e r r u p t i o n c o l l e c t i o n i s o n
SSM_ P S R _ I ( p15 , p15 , r15 ) / / r e s t o r e p s r . i
movl r15 =ia64_leave_kernel
;;
SAVE_ R E S T
mov r p =r15
;;
br. c a l l . s p t k . m a n y b6 =ia64_bad_break / / a v o i d W A W o n C F M a n d i g n o r e r e t u r n a d d r
END( n o n _ s y s c a l l )
ENTRY( _ _ i n t e r r u p t )
DBG_ F A U L T ( 1 2 )
mov r31 =pr / / p r e p a r e t o s a v e p r e d i c a t e s
;;
SAVE_ M I N _ W I T H _ C O V E R / / u s e s r31 ; defines r2 and r3
SSM_ P S R _ I C _ A N D _ D E F A U L T _ B I T S _ A N D _ S R L Z _ I ( r3 , r14 )
/ / ensure e v e r y b o d y k n o w s p s r . i c i s b a c k o n
adds r3 =8 ,r2 / / s e t u p s e c o n d b a s e p o i n t e r f o r S A V E _ R E S T
;;
SAVE_ R E S T
;;
MCA_ R E C O V E R _ R A N G E ( i n t e r r u p t )
alloc r14 =ar . p f s ,0 ,0 ,2 ,0 / / m u s t b e f i r s t i n a n i n s n g r o u p
MOV_ F R O M _ I V R ( o u t 0 , r8 ) / / p a s s c r . i v r a s f i r s t a r g
add o u t 1 =16 ,s p / / p a s s p o i n t e r t o p t _ r e g s a s s e c o n d a r g
;;
srlz. d / / m a k e s u r e w e s e e t h e e f f e c t o f c r . i v r
movl r14 =ia64_leave_kernel
;;
mov r p =r14
br. c a l l . s p t k . m a n y b6 =ia64_handle_irq
END( _ _ i n t e r r u p t )
/ *
* There i s n o p a r t i c u l a r r e a s o n f o r t h i s c o d e t o b e h e r e , o t h e r t h a n t h a t
* there h a p p e n s t o b e s p a c e h e r e t h a t w o u l d g o u n u s e d o t h e r w i s e . I f t h i s
* fault e v e r g e t s " u n r e s e r v e d " , s i m p l y m o v e d t h e f o l l o w i n g c o d e t o a m o r e
* suitable s p o t . . .
* /
ENTRY( d i s p a t c h _ u n a l i g n e d _ h a n d l e r )
SAVE_ M I N _ W I T H _ C O V E R
;;
alloc r14 =ar . p f s ,0 ,0 ,2 ,0 / / n o w i t ' s s a f e ( m u s t b e f i r s t i n i n s n g r o u p ! )
MOV_ F R O M _ I F A ( o u t 0 )
adds o u t 1 =16 ,s p
SSM_ P S R _ I C _ A N D _ D E F A U L T _ B I T S _ A N D _ S R L Z _ I ( r3 , r24 )
/ / guarantee t h a t i n t e r r u p t i o n c o l l e c t i o n i s o n
SSM_ P S R _ I ( p15 , p15 , r3 ) / / r e s t o r e p s r . i
adds r3 =8 ,r2 / / s e t u p s e c o n d b a s e p o i n t e r
;;
SAVE_ R E S T
movl r14 =ia64_leave_kernel
;;
mov r p =r14
br. s p t k . m a n y i a64 _ p r e p a r e _ h a n d l e _ u n a l i g n e d
END( d i s p a t c h _ u n a l i g n e d _ h a n d l e r )
/ *
* There i s n o p a r t i c u l a r r e a s o n f o r t h i s c o d e t o b e h e r e , o t h e r t h a n t h a t
* there h a p p e n s t o b e s p a c e h e r e t h a t w o u l d g o u n u s e d o t h e r w i s e . I f t h i s
* fault e v e r g e t s " u n r e s e r v e d " , s i m p l y m o v e d t h e f o l l o w i n g c o d e t o a m o r e
* suitable s p o t . . .
* /
ENTRY( d i s p a t c h _ t o _ f a u l t _ h a n d l e r )
/ *
* Input :
* psr. i c : o f f
* r19 : fault v e c t o r n u m b e r ( e . g . , 2 4 f o r G e n e r a l E x c e p t i o n )
* r31 : contains s a v e d p r e d i c a t e s ( p r )
* /
SAVE_ M I N _ W I T H _ C O V E R _ R 1 9
alloc r14 =ar . p f s ,0 ,0 ,5 ,0
MOV_ F R O M _ I S R ( o u t 1 )
MOV_ F R O M _ I F A ( o u t 2 )
MOV_ F R O M _ I I M ( o u t 3 )
MOV_ F R O M _ I T I R ( o u t 4 )
;;
SSM_ P S R _ I C _ A N D _ D E F A U L T _ B I T S _ A N D _ S R L Z _ I ( r3 , o u t 0 )
/ / guarantee t h a t i n t e r r u p t i o n c o l l e c t i o n i s o n
mov o u t 0 =r15
;;
SSM_ P S R _ I ( p15 , p15 , r3 ) / / r e s t o r e p s r . i
adds r3 =8 ,r2 / / s e t u p s e c o n d b a s e p o i n t e r f o r S A V E _ R E S T
;;
SAVE_ R E S T
movl r14 =ia64_leave_kernel
;;
mov r p =r14
br. c a l l . s p t k . m a n y b6 =ia64_fault
END( d i s p a t c h _ t o _ f a u l t _ h a n d l e r )
2008-05-28 00:23:16 +04:00
/ *
* Squatting i n t h i s s p a c e . . .
*
* This s p e c i a l c a s e d i s p a t c h e r f o r i l l e g a l o p e r a t i o n f a u l t s a l l o w s p r e s e r v e d
* registers t o b e m o d i f i e d t h r o u g h a c a l l b a c k f u n c t i o n ( a s m o n l y ) t h a t i s h a n d e d
* back f r o m t h e f a u l t h a n d l e r i n r8 . U p t o t h r e e a r g u m e n t s c a n b e p a s s e d t o t h e
* callback f u n c t i o n b y r e t u r n i n g a n a g g r e g a t e w i t h t h e c a l l b a c k a s i t s f i r s t
* element, f o l l o w e d b y t h e a r g u m e n t s .
* /
ENTRY( d i s p a t c h _ i l l e g a l _ o p _ f a u l t )
.prologue
.body
SAVE_ M I N _ W I T H _ C O V E R
2008-05-19 17:13:38 +04:00
SSM_ P S R _ I C _ A N D _ D E F A U L T _ B I T S _ A N D _ S R L Z _ I ( r3 , r24 )
/ / guarantee t h a t i n t e r r u p t i o n c o l l e c t i o n i s o n
2008-05-28 00:23:16 +04:00
;;
2008-05-19 17:13:38 +04:00
SSM_ P S R _ I ( p15 , p15 , r3 ) / / r e s t o r e p s r . i
2008-05-28 00:23:16 +04:00
adds r3 =8 ,r2 / / s e t u p s e c o n d b a s e p o i n t e r f o r S A V E _ R E S T
;;
alloc r14 =ar . p f s ,0 ,0 ,1 ,0 / / m u s t b e f i r s t i n i n s n g r o u p
mov o u t 0 =ar . e c
;;
SAVE_ R E S T
PT_ R E G S _ U N W I N D _ I N F O ( 0 )
;;
br. c a l l . s p t k . m a n y r p =ia64_illegal_op_fault
.ret0 : ;;
alloc r14 =ar . p f s ,0 ,0 ,3 ,0 / / m u s t b e f i r s t i n i n s n g r o u p
mov o u t 0 =r9
mov o u t 1 =r10
mov o u t 2 =r11
movl r15 =ia64_leave_kernel
;;
mov r p =r15
mov b6 =r8
;;
cmp. n e p6 ,p0 =0 ,r8
( p6 ) b r . c a l l . d p n t . m a n y b6 =b6 / / c a l l r e t u r n s t o i a64 _ l e a v e _ k e r n e l
br. s p t k . m a n y i a64 _ l e a v e _ k e r n e l
END( d i s p a t c h _ i l l e g a l _ o p _ f a u l t )
2005-04-17 02:20:36 +04:00
# ifdef C O N F I G _ I A 3 2 _ S U P P O R T
/ *
* There i s n o p a r t i c u l a r r e a s o n f o r t h i s c o d e t o b e h e r e , o t h e r t h a n t h a t
* there h a p p e n s t o b e s p a c e h e r e t h a t w o u l d g o u n u s e d o t h e r w i s e . I f t h i s
* fault e v e r g e t s " u n r e s e r v e d " , s i m p l y m o v e d t h e f o l l o w i n g c o d e t o a m o r e
* suitable s p o t . . .
* /
/ / IA3 2 i n t e r r u p t e n t r y p o i n t
ENTRY( d i s p a t c h _ t o _ i a32 _ h a n d l e r )
SAVE_ M I N
;;
2008-05-19 17:13:38 +04:00
MOV_ F R O M _ I S R ( r14 )
SSM_ P S R _ I C _ A N D _ D E F A U L T _ B I T S _ A N D _ S R L Z _ I ( r3 , r24 )
/ / guarantee t h a t i n t e r r u p t i o n c o l l e c t i o n i s o n
2005-04-17 02:20:36 +04:00
;;
2008-05-19 17:13:38 +04:00
SSM_ P S R _ I ( p15 , p15 , r3 )
2005-04-17 02:20:36 +04:00
adds r3 =8 ,r2 / / B a s e p o i n t e r f o r S A V E _ R E S T
;;
SAVE_ R E S T
;;
mov r15 =0x80
shr r14 =r14 ,1 6 / / G e t i n t e r r u p t n u m b e r
;;
cmp. n e p6 ,p0 =r14 ,r15
( p6 ) b r . c a l l . d p n t . m a n y b6 =non_ia32_syscall
adds r14 =IA64_PT_REGS_R8_OFFSET + 1 6 ,s p / / 1 6 b y t e h o l e p e r S W c o n v e n t i o n s
adds r15 =IA64_PT_REGS_R1_OFFSET + 1 6 ,s p
;;
cmp. e q p S y s ,p N o n S y s =r0 ,r0 / / s e t p S y s =1 , p N o n S y s =0
ld8 r8 = [ r14 ] / / g e t r8
;;
st8 [ r15 ] =r8 / / s a v e o r i g i n a l E A X i n r1 ( I A 3 2 p r o c s d o n ' t u s e t h e G P )
;;
alloc r15 =ar . p f s ,0 ,0 ,6 ,0 / / m u s t f i r s t i n a n i n s n g r o u p
;;
ld4 r8 = [ r14 ] ,8 / / r8 = = e a x ( s y s c a l l n u m b e r )
mov r15 =IA32_NR_syscalls
;;
cmp. l t u . u n c p6 ,p7 =r8 ,r15
ld4 o u t 1 = [ r14 ] ,8 / / r9 = = e c x
;;
ld4 o u t 2 = [ r14 ] ,8 / / r10 = = e d x
;;
ld4 o u t 0 = [ r14 ] / / r11 = = e b x
adds r14 = ( I A 6 4 _ P T _ R E G S _ R 1 3 _ O F F S E T ) + 1 6 ,s p
;;
ld4 o u t 5 = [ r14 ] ,P T ( R 1 4 ) - P T ( R 1 3 ) / / r13 = = e b p
;;
ld4 o u t 3 = [ r14 ] ,P T ( R 1 5 ) - P T ( R 1 4 ) / / r14 = = e s i
adds r2 =TI_FLAGS + I A 6 4 _ T A S K _ S I Z E ,r13
;;
ld4 o u t 4 = [ r14 ] / / r15 = = e d i
movl r16 =ia32_syscall_table
;;
( p6 ) s h l a d d r16 =r8 ,3 ,r16 / / f o r c e n i _ s y s c a l l i f n o t v a l i d s y s c a l l n u m b e r
ld4 r2 = [ r2 ] / / r2 = c u r r e n t _ t h r e a d _ i n f o ( ) - > f l a g s
;;
ld8 r16 = [ r16 ]
and r2 =_TIF_SYSCALL_TRACEAUDIT ,r2 / / m a s k t r a c e o r a u d i t
;;
mov b6 =r16
movl r15 =ia32_ret_from_syscall
cmp. e q p8 ,p0 =r2 ,r0
;;
mov r p =r15
( p8 ) b r . c a l l . s p t k . m a n y b6 =b6
br. c o n d . s p t k i a32 _ t r a c e _ s y s c a l l
non_ia32_syscall :
alloc r15 =ar . p f s ,0 ,0 ,2 ,0
mov o u t 0 =r14 / / i n t e r r u p t #
add o u t 1 =16 ,s p / / p o i n t e r t o p t _ r e g s
;; // avoid WAW on CFM
br. c a l l . s p t k . m a n y r p =ia32_bad_interrupt
.ret1 : movl r15 =ia64_leave_kernel
;;
mov r p =r15
br. r e t . s p t k . m a n y r p
END( d i s p a t c h _ t o _ i a32 _ h a n d l e r )
# endif / * C O N F I G _ I A 3 2 _ S U P P O R T * /