2008-04-01 10:52:19 +04:00
/ *
2008-11-21 16:04:37 +03:00
* arch/ i a64 / k v m / v m m _ i v t . S
2008-04-01 10:52:19 +04:00
*
* Copyright ( C ) 1 9 9 8 - 2 0 0 1 , 2 0 0 3 H e w l e t t - P a c k a r d C o
* 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 S M P
* 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 n o w u s e s v i r t u a l P T .
*
* 0 7 / 6 / 2 0 Xuefei X u ( A n t h o n y X u ) ( a n t h o n y . x u @intel.com)
* Supporting I n t e l v i r t u a l i z a t i o n a r c h i t e c t u r e
*
* /
/ *
* 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
* critical
* 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
* boundary.
* ( 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 / c a c h e . h >
# include < a s m / p g t a b l e . h >
# include " a s m - o f f s e t s . h "
# include " v c p u . h "
# include " k v m _ m i n s t a t e . h "
# include " v t i . 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
# define K V M _ F A U L T ( n ) \
2008-11-21 16:04:37 +03:00
kvm_ f a u l t _ ## n : ; \
mov r19 =n ;; \
br. s p t k . m a n y k v m _ v m m _ p a n i c ; \
;; \
2008-04-01 10:52:19 +04:00
# define K V M _ R E F L E C T ( n ) \
2008-11-21 16:04:37 +03:00
mov r31 =pr ; \
mov r19 =n ; /* prepare to save predicates */ \
mov r29 =cr . i p s r ; \
;; \
tbit. z p6 ,p7 =r29 ,I A 6 4 _ P S R _ V M _ B I T ; \
( p7 ) b r . s p t k . m a n y k v m _ d i s p a t c h _ r e f l e c t i o n ; \
br. s p t k . m a n y k v m _ v m m _ p a n i c ; \
2008-04-01 10:52:19 +04:00
2008-11-21 12:16:07 +03:00
GLOBAL_ E N T R Y ( k v m _ v m m _ p a n i c )
2008-11-21 16:04:37 +03:00
KVM_ S A V E _ M I N _ W I T H _ C O V E R _ R 1 9
alloc r14 =ar . p f s ,0 ,0 ,1 ,0
mov o u t 0 =r15
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 c
;;
srlz. i / / g u a r a n t e e 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
;;
/ / ( p1 5 ) s s m p s r . i / / r e s t o r e p s r . i
addl r14 = @gprel(ia64_leave_hypervisor),gp
;;
KVM_ S A V E _ R E S T
mov r p =r14
;;
br. c a l l . s p t k . m a n y b6 =vmm_panic_handler ;
2008-11-21 12:16:07 +03:00
END( k v m _ v m m _ p a n i c )
2008-04-01 10:52:19 +04:00
.section .text .ivt , " ax"
.align 32768 / / align o n 3 2 K B b o u n d a r y
.global kvm_ia64_ivt
kvm_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( k v m _ v h p t _ m i s s )
2008-11-21 16:04:37 +03:00
KVM_ F A U L T ( 0 )
2008-04-01 10:52:19 +04:00
END( k v m _ v h p t _ m i s s )
.org kvm_ i a64 _ 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( k v m _ i t l b _ m i s s )
2008-11-21 16:04:37 +03:00
mov r31 = p r
mov r29 =cr . i p s r ;
;;
tbit. z p6 ,p7 =r29 ,I A 6 4 _ P S R _ V M _ B I T ;
( p6 ) b r . s p t k k v m _ a l t _ i t l b _ m i s s
mov r19 = 1
br. s p t k k v m _ i t l b _ m i s s _ d i s p a t c h
KVM_ F A U L T ( 1 ) ;
2008-04-01 10:52:19 +04:00
END( k v m _ i t l b _ m i s s )
.org kvm_ i a64 _ 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( k v m _ d t l b _ m i s s )
2008-11-21 16:04:37 +03:00
mov r31 = p r
mov r29 =cr . i p s r ;
;;
tbit. z p6 ,p7 =r29 ,I A 6 4 _ P S R _ V M _ B I T ;
( p6 ) b r . s p t k k v m _ a l t _ d t l b _ m i s s
br. s p t k k v m _ d t l b _ m i s s _ d i s p a t c h
2008-04-01 10:52:19 +04:00
END( k v m _ d t l b _ m i s s )
.org kvm_ i a64 _ 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( k v m _ a l t _ i t l b _ m i s s )
2008-11-21 16:04:37 +03:00
mov r16 =cr . i f a / / 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
;;
movl r17 =PAGE_KERNEL
mov r24 =cr . i p s r
movl r19 = ( ( ( 1 < < I A 6 4 _ M A X _ P H Y S _ B I T S ) - 1 ) & ~ 0 x f f f )
;;
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
;;
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
;;
movl r20 =IA64_GRANULE_SHIFT < < 2
;;
mov c r . i t i r =r20
;;
itc. i r19 / / i n s e r t t h e T L B e n t r y
mov p r =r31 ,- 1
rfi
2008-04-01 10:52:19 +04:00
END( k v m _ a l t _ i t l b _ m i s s )
.org kvm_ i a64 _ 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( k v m _ a l t _ d t l b _ m i s s )
2008-11-21 16:04:37 +03:00
mov r16 =cr . i f a / / 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
;;
movl r17 =PAGE_KERNEL
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 r24 =cr . i p s r
;;
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
;;
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
;;
movl r20 =IA64_GRANULE_SHIFT < < 2
;;
mov c r . i t i r =r20
;;
itc. d r19 / / i n s e r t t h e T L B e n t r y
mov p r =r31 ,- 1
rfi
2008-04-01 10:52:19 +04:00
END( k v m _ a l t _ d t l b _ m i s s )
.org kvm_ i a64 _ 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( k v m _ n e s t e d _ d t l b _ m i s s )
2008-11-21 16:04:37 +03:00
KVM_ F A U L T ( 5 )
2008-04-01 10:52:19 +04:00
END( k v m _ n e s t e d _ d t l b _ m i s s )
.org kvm_ i a64 _ 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( k v m _ i k e y _ m i s s )
2008-11-21 16:04:37 +03:00
KVM_ R E F L E C T ( 6 )
2008-04-01 10:52:19 +04:00
END( k v m _ i k e y _ m i s s )
.org kvm_ i a64 _ 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( k v m _ d k e y _ m i s s )
2008-11-21 16:04:37 +03:00
KVM_ R E F L E C T ( 7 )
2008-04-01 10:52:19 +04:00
END( k v m _ d k e y _ m i s s )
.org kvm_ i a64 _ 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( k v m _ d i r t y _ b i t )
2008-11-21 16:04:37 +03:00
KVM_ R E F L E C T ( 8 )
2008-04-01 10:52:19 +04:00
END( k v m _ d i r t y _ b i t )
.org kvm_ i a64 _ 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( k v m _ i a c c e s s _ b i t )
2008-11-21 16:04:37 +03:00
KVM_ R E F L E C T ( 9 )
2008-04-01 10:52:19 +04:00
END( k v m _ i a c c e s s _ b i t )
.org kvm_ i a64 _ 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( k v m _ d a c c e s s _ b i t )
2008-11-21 16:04:37 +03:00
KVM_ R E F L E C T ( 1 0 )
2008-04-01 10:52:19 +04:00
END( k v m _ d a c c e s s _ b i t )
.org kvm_ i a64 _ 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( k v m _ b r e a k _ f a u l t )
2008-11-21 16:04:37 +03:00
mov r31 =pr
mov r19 =11
mov r29 =cr . i p s r
;;
KVM_ S A V E _ M I N _ W I T H _ C O V E R _ R 1 9
;;
alloc r14 =ar . p f s ,0 ,0 ,4 ,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 =cr . i f a
mov o u t 2 =cr . i s r / / F I X M E : p i t y t o m a k e t h i s s l o w a c c e s s t w i c e
mov o u t 3 =cr . i i m / / F I X M E : p i t y t o m a k e t h i s s l o w a c c e s s t w i c e
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 c
;;
srlz. i / / g u a r a n t e e 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
;;
/ / ( p1 5 ) s s m p s r . i / / r e s t o r e p s r . i
addl r14 = @gprel(ia64_leave_hypervisor),gp
;;
KVM_ S A V E _ R E S T
mov r p =r14
;;
adds o u t 1 =16 ,s p
br. c a l l . s p t k . m a n y b6 =kvm_ia64_handle_break
;;
2008-04-01 10:52:19 +04:00
END( k v m _ b r e a k _ f a u l t )
.org kvm_ i a64 _ 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( k v m _ i n t e r r u p t )
2008-11-21 16:04:37 +03:00
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
mov r19 =12
mov r29 =cr . i p s r
;;
tbit. z p6 ,p7 =r29 ,I A 6 4 _ P S R _ V M _ B I T
tbit. z p0 ,p15 =r29 ,I A 6 4 _ P S R _ I _ B I T
;;
( p7 ) b r . s p t k k v m _ d i s p a t c h _ i n t e r r u p t
;;
mov r27 =ar . r s c / * M * /
mov r20 =r1 / * A * /
mov r25 =ar . u n a t / * M * /
mov r26 =ar . p f s / * I * /
mov r28 =cr . i i p / * M * /
cover / * B ( o r n o t h i n g ) * /
;;
mov r1 =sp
;;
invala / * M * /
mov r30 =cr . i f s
;;
addl r1 = - V M M _ P T _ R E G S _ S I Z E ,r1
;;
adds r17 =2 * L 1 _ C A C H E _ B Y T E S ,r1 / * r e a l l y : b i g g e s t c a c h e - l i n e s i z e * /
adds r16 =PT ( C R _ I P S R ) ,r1
;;
lfetch. f a u l t . e x c l . n t 1 [ r17 ] ,L 1 _ C A C H E _ B Y T E S
st8 [ r16 ] =r29 / * s a v e c r . i p s r * /
;;
lfetch. f a u l t . e x c l . n t 1 [ r17 ]
mov r29 =b0
;;
adds r16 =PT ( R 8 ) ,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 * /
adds r17 =PT ( R 9 ) ,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 * /
mov r18 =r0 / * m a k e s u r e r18 i s n ' t N a T * /
;;
2008-04-01 10:52:19 +04:00
.mem .offset 0 , 0 ; st8.spill [r16]=r8,16
.mem .offset 8 , 0 ; st8.spill [r17]=r9,16
;;
.mem .offset 0 , 0 ; st8.spill [r16]=r10,24
.mem .offset 8 , 0 ; st8.spill [r17]=r11,24
;;
2008-11-21 16:04:37 +03:00
st8 [ r16 ] =r28 ,1 6 / * s a v e c r . i i p * /
st8 [ r17 ] =r30 ,1 6 / * s a v e c r . i f s * /
mov r8 =ar . f p s r / * M * /
mov r9 =ar . c s d
mov r10 =ar . s s d
movl r11 =FPSR_DEFAULT / * L - u n i t * /
;;
st8 [ r16 ] =r25 ,1 6 / * s a v e a r . u n a t * /
st8 [ r17 ] =r26 ,1 6 / * s a v e a r . p f s * /
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 ] =r27 ,1 6 / * s a v e a r . r s c * /
adds r17 =16 ,r17 / * s k i p o v e r a r _ r n a t f i e l d * /
;;
st8 [ r17 ] =r31 ,1 6 / * s a v e p r e d i c a t e s * /
adds r16 =16 ,r16 / * s k i p o v e r a r _ b s p s t o r e f i e l d * /
;;
st8 [ r16 ] =r29 ,1 6 / * s a v e b0 * /
st8 [ r17 ] =r18 ,1 6 / * s a v e a r . r s c v a l u e f o r " l o a d r s " * /
;;
2008-04-01 10:52:19 +04:00
.mem .offset 0 , 0 ; st8.spill [r16]=r20,16 /* save original r1 */
.mem .offset 8 , 0 ; st8.spill [r17]=r12,16
2008-11-21 16:04:37 +03:00
adds r12 = - 1 6 ,r1
/* switch to kernel memory stack (with 16 bytes of scratch) */
;;
2008-04-01 10:52:19 +04:00
.mem .offset 0 , 0 ; st8.spill [r16]=r13,16
.mem .offset 8 , 0 ; st8.spill [r17]=r8,16 /* save ar.fpsr */
2008-11-21 16:04:37 +03:00
;;
2008-04-01 10:52:19 +04:00
.mem .offset 0 , 0 ; st8.spill [r16]=r15,16
.mem .offset 8 , 0 ; st8.spill [r17]=r14,16
2008-11-21 16:04:37 +03:00
dep r14 = - 1 ,r0 ,6 0 ,4
;;
2008-04-01 10:52:19 +04:00
.mem .offset 0 , 0 ; st8.spill [r16]=r2,16
.mem .offset 8 , 0 ; st8.spill [r17]=r3,16
2008-11-21 16:04:37 +03:00
adds r2 =VMM_PT_REGS_R16_OFFSET ,r1
adds r14 = V M M _ V C P U _ G P _ O F F S E T ,r13
;;
mov r8 =ar . c c v
ld8 r14 = [ r14 ]
;;
mov r1 =r14 / * 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 * /
;; \
bsw. 1
;;
alloc r14 =ar . p f s ,0 ,0 ,1 ,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 o u t 0 =r13
;;
ssm p s r . i c
;;
srlz. i
;;
/ / ( p1 5 ) s s m 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
srlz. i / / e n s u r e 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
;;
2008-04-01 10:52:19 +04:00
.mem .offset 0 , 0 ; st8.spill [r2]=r16,16
.mem .offset 8 , 0 ; st8.spill [r3]=r17,16
2008-11-21 16:04:37 +03:00
;;
2008-04-01 10:52:19 +04:00
.mem .offset 0 , 0 ; st8.spill [r2]=r18,16
.mem .offset 8 , 0 ; st8.spill [r3]=r19,16
2008-11-21 16:04:37 +03:00
;;
2008-04-01 10:52:19 +04:00
.mem .offset 0 , 0 ; st8.spill [r2]=r20,16
.mem .offset 8 , 0 ; st8.spill [r3]=r21,16
2008-11-21 16:04:37 +03:00
mov r18 =b6
;;
2008-04-01 10:52:19 +04:00
.mem .offset 0 , 0 ; st8.spill [r2]=r22,16
.mem .offset 8 , 0 ; st8.spill [r3]=r23,16
2008-11-21 16:04:37 +03:00
mov r19 =b7
;;
2008-04-01 10:52:19 +04:00
.mem .offset 0 , 0 ; st8.spill [r2]=r24,16
.mem .offset 8 , 0 ; st8.spill [r3]=r25,16
2008-11-21 16:04:37 +03:00
;;
2008-04-01 10:52:19 +04:00
.mem .offset 0 , 0 ; st8.spill [r2]=r26,16
.mem .offset 8 , 0 ; st8.spill [r3]=r27,16
2008-11-21 16:04:37 +03:00
;;
2008-04-01 10:52:19 +04:00
.mem .offset 0 , 0 ; st8.spill [r2]=r28,16
.mem .offset 8 , 0 ; st8.spill [r3]=r29,16
2008-11-21 16:04:37 +03:00
;;
2008-04-01 10:52:19 +04:00
.mem .offset 0 , 0 ; st8.spill [r2]=r30,16
.mem .offset 8 , 0 ; st8.spill [r3]=r31,32
2008-11-21 16:04:37 +03:00
;;
mov a r . f p s r =r11 / * M - u n i t * /
st8 [ r2 ] =r8 ,8 / * a r . c c v * /
adds r24 =PT ( B 6 ) - P T ( F 7 ) ,r3
;;
stf. s p i l l [ r2 ] =f6 ,3 2
stf. s p i l l [ r3 ] =f7 ,3 2
;;
stf. s p i l l [ r2 ] =f8 ,3 2
stf. s p i l l [ r3 ] =f9 ,3 2
;;
stf. s p i l l [ r2 ] =f10
stf. s p i l l [ r3 ] =f11
adds r25 =PT ( B 7 ) - P T ( F 1 1 ) ,r3
;;
st8 [ r24 ] =r18 ,1 6 / * b6 * /
st8 [ r25 ] =r19 ,1 6 / * b7 * /
;;
st8 [ r24 ] =r9 / * a r . c s d * /
st8 [ r25 ] =r10 / * a r . s s d * /
;;
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
addl r14 = @gprel(ia64_leave_nested),gp
;;
mov r p =r14
br. c a l l . s p t k . m a n y b6 =kvm_ia64_handle_irq
;;
2008-04-01 10:52:19 +04:00
END( k v m _ i n t e r r u p t )
.global kvm_dispatch_vexirq
.org kvm_ i a64 _ 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
ENTRY( k v m _ v i r t u a l _ e x i r q )
2008-11-21 16:04:37 +03:00
mov r31 =pr
mov r19 =13
mov r30 =r0
;;
2008-04-01 10:52:19 +04:00
kvm_dispatch_vexirq :
2008-11-21 16:04:37 +03:00
cmp. e q p6 ,p0 = 1 ,r30
;;
( p6 ) a d d r29 = V M M _ V C P U _ S A V E D _ G P _ O F F S E T ,r21
;;
( p6 ) l d8 r1 = [ r29 ]
;;
KVM_ S A V E _ M I N _ W I T H _ C O V E R _ R 1 9
alloc r14 =ar . p f s ,0 ,0 ,1 ,0
mov o u t 0 =r13
ssm p s r . i c
;;
srlz. i / / g u a r a n t e e 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
;;
/ / ( p1 5 ) s s m p s r . i / / 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
;;
KVM_ S A V E _ R E S T
addl r14 = @gprel(ia64_leave_hypervisor),gp
;;
mov r p =r14
br. c a l l . s p t k . m a n y b6 =kvm_vexirq
2008-04-01 10:52:19 +04:00
END( k v m _ v i r t u a l _ e x i r q )
.org kvm_ i a64 _ 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
2008-11-21 16:04:37 +03:00
KVM_ F A U L T ( 1 4 )
/ / this c o d e s e g m e n t i s f r o m 2 . 6 . 1 6 . 1 3
2008-04-01 10:52:19 +04:00
.org kvm_ i a64 _ 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
2008-11-21 16:04:37 +03:00
KVM_ F A U L T ( 1 5 )
2008-04-01 10:52:19 +04:00
.org kvm_ i a64 _ 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
2008-11-21 16:04:37 +03:00
KVM_ F A U L T ( 1 6 )
2008-04-01 10:52:19 +04:00
.org kvm_ i a64 _ 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
2008-11-21 16:04:37 +03:00
KVM_ F A U L T ( 1 7 )
2008-04-01 10:52:19 +04:00
.org kvm_ i a64 _ 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
2008-11-21 16:04:37 +03:00
KVM_ F A U L T ( 1 8 )
2008-04-01 10:52:19 +04:00
.org kvm_ i a64 _ 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
2008-11-21 16:04:37 +03:00
KVM_ F A U L T ( 1 9 )
2008-04-01 10:52:19 +04:00
.org kvm_ i a64 _ 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
ENTRY( k v m _ p a g e _ n o t _ p r e s e n t )
2008-11-21 16:04:37 +03:00
KVM_ R E F L E C T ( 2 0 )
2008-04-01 10:52:19 +04:00
END( k v m _ p a g e _ n o t _ p r e s e n t )
.org kvm_ i a64 _ 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 v e c t o r
ENTRY( k v m _ k e y _ p e r m i s s i o n )
2008-11-21 16:04:37 +03:00
KVM_ R E F L E C T ( 2 1 )
2008-04-01 10:52:19 +04:00
END( k v m _ k e y _ p e r m i s s i o n )
.org kvm_ i a64 _ 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( k v m _ i a c c e s s _ r i g h t s )
2008-11-21 16:04:37 +03:00
KVM_ R E F L E C T ( 2 2 )
2008-04-01 10:52:19 +04:00
END( k v m _ i a c c e s s _ r i g h t s )
.org kvm_ i a64 _ 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( k v m _ d a c c e s s _ r i g h t s )
2008-11-21 16:04:37 +03:00
KVM_ R E F L E C T ( 2 3 )
2008-04-01 10:52:19 +04:00
END( k v m _ d a c c e s s _ r i g h t s )
.org kvm_ i a64 _ 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( k v m _ g e n e r a l _ e x c e p t i o n )
2008-11-21 16:04:37 +03:00
KVM_ R E F L E C T ( 2 4 )
KVM_ F A U L T ( 2 4 )
2008-04-01 10:52:19 +04:00
END( k v m _ g e n e r a l _ e x c e p t i o n )
.org kvm_ i a64 _ 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( k v m _ d i s a b l e d _ f p _ r e g )
2008-11-21 16:04:37 +03:00
KVM_ R E F L E C T ( 2 5 )
2008-04-01 10:52:19 +04:00
END( k v m _ d i s a b l e d _ f p _ r e g )
.org kvm_ i a64 _ 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( k v m _ n a t _ c o n s u m p t i o n )
2008-11-21 16:04:37 +03:00
KVM_ R E F L E C T ( 2 6 )
2008-04-01 10:52:19 +04:00
END( k v m _ n a t _ c o n s u m p t i o n )
.org kvm_ i a64 _ 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( k v m _ s p e c u l a t i o n _ v e c t o r )
2008-11-21 16:04:37 +03:00
KVM_ R E F L E C T ( 2 7 )
2008-04-01 10:52:19 +04:00
END( k v m _ s p e c u l a t i o n _ v e c t o r )
.org kvm_ i a64 _ 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
2008-11-21 16:04:37 +03:00
KVM_ F A U L T ( 2 8 )
2008-04-01 10:52:19 +04:00
.org kvm_ i a64 _ 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( k v m _ d e b u g _ v e c t o r )
2008-11-21 16:04:37 +03:00
KVM_ F A U L T ( 2 9 )
2008-04-01 10:52:19 +04:00
END( k v m _ d e b u g _ v e c t o r )
.org kvm_ i a64 _ 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( k v m _ u n a l i g n e d _ a c c e s s )
2008-11-21 16:04:37 +03:00
KVM_ R E F L E C T ( 3 0 )
2008-04-01 10:52:19 +04:00
END( k v m _ u n a l i g n e d _ a c c e s s )
.org kvm_ i a64 _ 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( k v m _ u n s u p p o r t e d _ d a t a _ r e f e r e n c e )
2008-11-21 16:04:37 +03:00
KVM_ R E F L E C T ( 3 1 )
2008-04-01 10:52:19 +04:00
END( k v m _ 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 kvm_ i a64 _ 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 5 )
ENTRY( k v m _ f l o a t i n g _ p o i n t _ f a u l t )
2008-11-21 16:04:37 +03:00
KVM_ R E F L E C T ( 3 2 )
2008-04-01 10:52:19 +04:00
END( k v m _ f l o a t i n g _ p o i n t _ f a u l t )
.org kvm_ i a64 _ 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( k v m _ f l o a t i n g _ p o i n t _ t r a p )
2008-11-21 16:04:37 +03:00
KVM_ R E F L E C T ( 3 3 )
2008-04-01 10:52:19 +04:00
END( k v m _ f l o a t i n g _ p o i n t _ t r a p )
.org kvm_ i a64 _ 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( k v m _ l o w e r _ p r i v i l e g e _ t r a p )
2008-11-21 16:04:37 +03:00
KVM_ R E F L E C T ( 3 4 )
2008-04-01 10:52:19 +04:00
END( k v m _ l o w e r _ p r i v i l e g e _ t r a p )
.org kvm_ i a64 _ 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( k v m _ t a k e n _ b r a n c h _ t r a p )
2008-11-21 16:04:37 +03:00
KVM_ R E F L E C T ( 3 5 )
2008-04-01 10:52:19 +04:00
END( k v m _ t a k e n _ b r a n c h _ t r a p )
.org kvm_ i a64 _ 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( k v m _ s i n g l e _ s t e p _ t r a p )
2008-11-21 16:04:37 +03:00
KVM_ R E F L E C T ( 3 6 )
2008-04-01 10:52:19 +04:00
END( k v m _ s i n g l e _ s t e p _ t r a p )
.global kvm_virtualization_fault_back
.org kvm_ i a64 _ 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 ) V i r t u a l i z a t i o n F a u l t
ENTRY( k v m _ v i r t u a l i z a t i o n _ f a u l t )
2008-11-21 16:04:37 +03:00
mov r31 =pr
adds r16 = V M M _ V C P U _ S A V E D _ G P _ O F F S E T ,r21
;;
st8 [ r16 ] = r1
adds r17 = V M M _ V C P U _ G P _ O F F S E T , r21
;;
ld8 r1 = [ r17 ]
cmp. e q p6 ,p0 =EVENT_MOV_FROM_AR ,r24
cmp. e q p7 ,p0 =EVENT_MOV_FROM_RR ,r24
cmp. e q p8 ,p0 =EVENT_MOV_TO_RR ,r24
cmp. e q p9 ,p0 =EVENT_RSM ,r24
cmp. e q p10 ,p0 =EVENT_SSM ,r24
cmp. e q p11 ,p0 =EVENT_MOV_TO_PSR ,r24
cmp. e q p12 ,p0 =EVENT_THASH ,r24
( p6 ) b r . d p t k . m a n y k v m _ a s m _ m o v _ f r o m _ a r
( p7 ) b r . d p t k . m a n y k v m _ a s m _ m o v _ f r o m _ r r
( p8 ) b r . d p t k . m a n y k v m _ a s m _ m o v _ t o _ r r
( p9 ) b r . d p t k . m a n y k v m _ a s m _ r s m
( p1 0 ) b r . d p t k . m a n y k v m _ a s m _ s s m
( p1 1 ) b r . d p t k . m a n y k v m _ a s m _ m o v _ t o _ p s r
( p1 2 ) b r . d p t k . m a n y k v m _ a s m _ t h a s h
;;
2008-04-01 10:52:19 +04:00
kvm_virtualization_fault_back :
2008-11-21 16:04:37 +03:00
adds r16 = V M M _ V C P U _ S A V E D _ G P _ O F F S E T ,r21
;;
ld8 r1 = [ r16 ]
;;
mov r19 =37
adds r16 = V M M _ V C P U _ C A U S E _ O F F S E T ,r21
adds r17 = V M M _ V C P U _ O P C O D E _ O F F S E T ,r21
;;
st8 [ r16 ] = r24
st8 [ r17 ] = r25
;;
cmp. n e p6 ,p0 =EVENT_RFI , r24
( p6 ) b r . s p t k k v m _ d i s p a t c h _ v i r t u a l i z a t i o n _ f a u l t
;;
adds r18 =VMM_VPD_BASE_OFFSET ,r21
;;
ld8 r18 = [ r18 ]
;;
adds r18 =VMM_VPD_VIFS_OFFSET ,r18
;;
ld8 r18 = [ r18 ]
;;
tbit. z p6 ,p0 =r18 ,6 3
( p6 ) b r . s p t k k v m _ d i s p a t c h _ v i r t u a l i z a t i o n _ f a u l t
;;
/ / if v i f s . v =1 d e s e r t c u r r e n t r e g i s t e r f r a m e
alloc r18 =ar . p f s ,0 ,0 ,0 ,0
br. s p t k k v m _ d i s p a t c h _ v i r t u a l i z a t i o n _ f a u l t
2008-04-01 10:52:19 +04:00
END( k v m _ v i r t u a l i z a t i o n _ f a u l t )
.org kvm_ i a64 _ 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
2008-11-21 16:04:37 +03:00
KVM_ F A U L T ( 3 8 )
2008-04-01 10:52:19 +04:00
.org kvm_ i a64 _ 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
2008-11-21 16:04:37 +03:00
KVM_ F A U L T ( 3 9 )
2008-04-01 10:52:19 +04:00
.org kvm_ i a64 _ 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
2008-11-21 16:04:37 +03:00
KVM_ F A U L T ( 4 0 )
2008-04-01 10:52:19 +04:00
.org kvm_ i a64 _ 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
2008-11-21 16:04:37 +03:00
KVM_ F A U L T ( 4 1 )
2008-04-01 10:52:19 +04:00
.org kvm_ i a64 _ 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
2008-11-21 16:04:37 +03:00
KVM_ F A U L T ( 4 2 )
2008-04-01 10:52:19 +04:00
.org kvm_ i a64 _ 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
2008-11-21 16:04:37 +03:00
KVM_ F A U L T ( 4 3 )
2008-04-01 10:52:19 +04:00
.org kvm_ i a64 _ 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
2008-11-21 16:04:37 +03:00
KVM_ F A U L T ( 4 4 )
2008-04-01 10:52:19 +04:00
.org kvm_ i a64 _ 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( k v m _ i a32 _ e x c e p t i o n )
2008-11-21 16:04:37 +03:00
KVM_ F A U L T ( 4 5 )
2008-04-01 10:52:19 +04:00
END( k v m _ i a32 _ e x c e p t i o n )
.org kvm_ i a64 _ 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( k v m _ i a32 _ i n t e r c e p t )
2008-11-21 16:04:37 +03:00
KVM_ F A U L T ( 4 7 )
2008-04-01 10:52:19 +04:00
END( k v m _ i a32 _ i n t e r c e p t )
.org kvm_ i a64 _ 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
2008-11-21 16:04:37 +03:00
KVM_ F A U L T ( 4 8 )
2008-04-01 10:52:19 +04:00
.org kvm_ i a64 _ 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
2008-11-21 16:04:37 +03:00
KVM_ F A U L T ( 4 9 )
2008-04-01 10:52:19 +04:00
.org kvm_ i a64 _ 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
2008-11-21 16:04:37 +03:00
KVM_ F A U L T ( 5 0 )
2008-04-01 10:52:19 +04:00
.org kvm_ i a64 _ 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
2008-11-21 16:04:37 +03:00
KVM_ F A U L T ( 5 2 )
2008-04-01 10:52:19 +04:00
.org kvm_ i a64 _ 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
2008-11-21 16:04:37 +03:00
KVM_ F A U L T ( 5 3 )
2008-04-01 10:52:19 +04:00
.org kvm_ i a64 _ 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
2008-11-21 16:04:37 +03:00
KVM_ F A U L T ( 5 4 )
2008-04-01 10:52:19 +04:00
.org kvm_ i a64 _ 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
2008-11-21 16:04:37 +03:00
KVM_ F A U L T ( 5 5 )
2008-04-01 10:52:19 +04:00
.org kvm_ i a64 _ 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
2008-11-21 16:04:37 +03:00
KVM_ F A U L T ( 5 6 )
2008-04-01 10:52:19 +04:00
.org kvm_ i a64 _ 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
2008-11-21 16:04:37 +03:00
KVM_ F A U L T ( 5 7 )
2008-04-01 10:52:19 +04:00
.org kvm_ i a64 _ 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
2008-11-21 16:04:37 +03:00
KVM_ F A U L T ( 5 8 )
2008-04-01 10:52:19 +04:00
.org kvm_ i a64 _ 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
2008-11-21 16:04:37 +03:00
KVM_ F A U L T ( 5 9 )
2008-04-01 10:52:19 +04:00
.org kvm_ i a64 _ 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
2008-11-21 16:04:37 +03:00
KVM_ F A U L T ( 6 0 )
2008-04-01 10:52:19 +04:00
.org kvm_ i a64 _ 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
2008-11-21 16:04:37 +03:00
KVM_ F A U L T ( 6 1 )
2008-04-01 10:52:19 +04:00
.org kvm_ i a64 _ 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
2008-11-21 16:04:37 +03:00
KVM_ F A U L T ( 6 2 )
2008-04-01 10:52:19 +04:00
.org kvm_ i a64 _ 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
2008-11-21 16:04:37 +03:00
KVM_ F A U L T ( 6 3 )
2008-04-01 10:52:19 +04:00
.org kvm_ i a64 _ 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
2008-11-21 16:04:37 +03:00
KVM_ F A U L T ( 6 4 )
2008-04-01 10:52:19 +04:00
.org kvm_ i a64 _ 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
2008-11-21 16:04:37 +03:00
KVM_ F A U L T ( 6 5 )
2008-04-01 10:52:19 +04:00
.org kvm_ i a64 _ 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
2008-11-21 16:04:37 +03:00
KVM_ F A U L T ( 6 6 )
2008-04-01 10:52:19 +04:00
.org kvm_ i a64 _ 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
2008-11-21 16:04:37 +03:00
KVM_ F A U L T ( 6 7 )
2008-04-01 10:52:19 +04:00
.org kvm_ i a64 _ i v t + 0 x80 0 0
/ / 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( k v m _ d t l b _ m i s s _ d i s p a t c h )
2008-11-21 16:04:37 +03:00
mov r19 = 2
KVM_ S A V E _ M I N _ W I T H _ C O V E R _ R 1 9
alloc r14 =ar . p f s ,0 ,0 ,3 ,0
mov o u t 0 =cr . i f a
mov o u t 1 =r15
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 c
;;
srlz. i / / g u a r a n t e e 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
;;
/ / ( p1 5 ) s s m p s r . i / / r e s t o r e p s r . i
addl r14 = @gprel(ia64_leave_hypervisor_prepare),gp
;;
KVM_ S A V E _ R E S T
KVM_ S A V E _ E X T R A
mov r p =r14
;;
adds o u t 2 =16 ,r12
br. c a l l . s p t k . m a n y b6 =kvm_page_fault
2008-04-01 10:52:19 +04:00
END( k v m _ d t l b _ m i s s _ d i s p a t c h )
ENTRY( k v m _ i t l b _ m i s s _ d i s p a t c h )
2008-11-21 16:04:37 +03:00
KVM_ S A V E _ M I N _ W I T H _ C O V E R _ R 1 9
alloc r14 =ar . p f s ,0 ,0 ,3 ,0
mov o u t 0 =cr . i f a
mov o u t 1 =r15
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 c
;;
srlz. i / / g u a r a n t e e 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
;;
/ / ( p1 5 ) s s m p s r . i / / r e s t o r e p s r . i
addl r14 = @gprel(ia64_leave_hypervisor),gp
;;
KVM_ S A V E _ R E S T
mov r p =r14
;;
adds o u t 2 =16 ,r12
br. c a l l . s p t k . m a n y b6 =kvm_page_fault
2008-04-01 10:52:19 +04:00
END( k v m _ i t l b _ m i s s _ d i s p a t c h )
ENTRY( k v m _ d i s p a t c h _ r e f l e c t i o n )
2008-11-21 16:04:37 +03:00
/ *
* Input :
* psr. i c : o f f
* r19 : intr t y p e ( o f f s e t i n t o i v t , s e e i a64 _ i n t . h )
* r31 : contains s a v e d p r e d i c a t e s ( p r )
* /
KVM_ S A V E _ 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 o u t 0 =cr . i f a
mov o u t 1 =cr . i s r
mov o u t 2 =cr . i i m
mov o u t 3 =r15
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 c
;;
srlz. i / / g u a r a n t e e 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
;;
/ / ( p1 5 ) s s m p s r . i / / r e s t o r e p s r . i
addl r14 = @gprel(ia64_leave_hypervisor),gp
;;
KVM_ S A V E _ R E S T
mov r p =r14
;;
adds o u t 4 =16 ,r12
br. c a l l . s p t k . m a n y b6 =reflect_interruption
2008-04-01 10:52:19 +04:00
END( k v m _ d i s p a t c h _ r e f l e c t i o n )
ENTRY( k v m _ d i s p a t c h _ v i r t u a l i z a t i o n _ f a u l t )
2008-11-21 16:04:37 +03:00
adds r16 = V M M _ V C P U _ C A U S E _ O F F S E T ,r21
adds r17 = V M M _ V C P U _ O P C O D E _ O F F S E T ,r21
;;
st8 [ r16 ] = r24
st8 [ r17 ] = r25
;;
KVM_ S A V E _ M I N _ W I T H _ C O V E R _ R 1 9
;;
alloc r14 =ar . p f s ,0 ,0 ,2 ,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 =r13 / / v c p u
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 c
;;
srlz. i / / g u a r a n t e e 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
;;
/ / ( p1 5 ) s s m p s r . i / / r e s t o r e p s r . i
addl r14 = @gprel(ia64_leave_hypervisor_prepare),gp
;;
KVM_ S A V E _ R E S T
KVM_ S A V E _ E X T R A
mov r p =r14
;;
adds o u t 1 =16 ,s p / / r e g s
br. c a l l . s p t k . m a n y b6 =kvm_emulate
2008-04-01 10:52:19 +04:00
END( k v m _ d i s p a t c h _ v i r t u a l i z a t i o n _ f a u l t )
ENTRY( k v m _ d i s p a t c h _ i n t e r r u p t )
2008-11-21 16:04:37 +03:00
KVM_ S A V E _ M I N _ W I T H _ C O V E R _ R 1 9 / / u s e s r31 ; defines r2 and r3
;;
alloc r14 =ar . p f s ,0 ,0 ,1 ,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
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
;;
srlz. i
;;
/ / ( p1 5 ) s s m p s r . i
addl r14 = @gprel(ia64_leave_hypervisor),gp
;;
KVM_ S A V E _ R E S T
mov r p =r14
;;
mov o u t 0 =r13 / / 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
br. c a l l . s p t k . m a n y b6 =kvm_ia64_handle_irq
2008-04-01 10:52:19 +04:00
END( k v m _ d i s p a t c h _ i n t e r r u p t )
GLOBAL_ E N T R Y ( i a64 _ l e a v e _ n e s t e d )
rsm p s r . i
;;
adds r21 =PT ( P R ) + 1 6 ,r12
;;
lfetch [ r21 ] ,P T ( C R _ I P S R ) - P T ( P R )
adds r2 =PT ( B 6 ) + 1 6 ,r12
adds r3 =PT ( R 1 6 ) + 1 6 ,r12
;;
lfetch [ r21 ]
ld8 r28 = [ r2 ] ,8 / / l o a d b6
adds r29 =PT ( R 2 4 ) + 1 6 ,r12
ld8 . f i l l r16 = [ r3 ]
adds r3 =PT ( A R _ C S D ) - P T ( R 1 6 ) ,r3
adds r30 =PT ( A R _ C C V ) + 1 6 ,r12
;;
ld8 . f i l l r24 = [ r29 ]
ld8 r15 = [ r30 ] / / l o a d a r . c c v
;;
ld8 r29 = [ r2 ] ,1 6 / / l o a d b7
ld8 r30 = [ r3 ] ,1 6 / / l o a d a r . c s d
;;
ld8 r31 = [ r2 ] ,1 6 / / l o a d a r . s s d
ld8 . f i l l r8 = [ r3 ] ,1 6
;;
ld8 . f i l l r9 = [ r2 ] ,1 6
ld8 . f i l l r10 = [ r3 ] ,P T ( R 1 7 ) - P T ( R 1 0 )
;;
ld8 . f i l l r11 = [ r2 ] ,P T ( R 1 8 ) - P T ( R 1 1 )
ld8 . f i l l r17 = [ r3 ] ,1 6
;;
ld8 . f i l l r18 = [ r2 ] ,1 6
ld8 . f i l l r19 = [ r3 ] ,1 6
;;
ld8 . f i l l r20 = [ r2 ] ,1 6
ld8 . f i l l r21 = [ r3 ] ,1 6
mov a r . c s d =r30
mov a r . s s d =r31
;;
rsm p s r . i | p s r . i c
/ / initiate t u r n i n g o f f o f i n t e r r u p t a n d i n t e r r u p t i o n c o l l e c t i o n
invala / / i n v a l i d a t e A L A T
;;
srlz. i
;;
ld8 . f i l l r22 = [ r2 ] ,2 4
ld8 . f i l l r23 = [ r3 ] ,2 4
mov b6 =r28
;;
ld8 . f i l l r25 = [ r2 ] ,1 6
ld8 . f i l l r26 = [ r3 ] ,1 6
mov b7 =r29
;;
ld8 . f i l l r27 = [ r2 ] ,1 6
ld8 . f i l l r28 = [ r3 ] ,1 6
;;
ld8 . f i l l r29 = [ r2 ] ,1 6
ld8 . f i l l r30 = [ r3 ] ,2 4
;;
ld8 . f i l l r31 = [ r2 ] ,P T ( F 9 ) - P T ( R 3 1 )
adds r3 =PT ( F 1 0 ) - P T ( F 6 ) ,r3
;;
ldf. f i l l f9 = [ r2 ] ,P T ( F 6 ) - P T ( F 9 )
ldf. f i l l f10 = [ r3 ] ,P T ( F 8 ) - P T ( F 1 0 )
;;
ldf. f i l l f6 = [ r2 ] ,P T ( F 7 ) - P T ( F 6 )
;;
ldf. f i l l f7 = [ r2 ] ,P T ( F 1 1 ) - P T ( F 7 )
ldf. f i l l f8 = [ r3 ] ,3 2
;;
srlz. i / / 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 f f
mov a r . c c v =r15
;;
bsw. 0 / / s w i t c h b a c k t o b a n k 0 ( n o s t o p b i t r e q u i r e d b e f o r e h a n d . . . )
;;
ldf. f i l l f11 = [ r2 ]
/ / mov r18 =r13
2008-11-21 16:04:37 +03:00
/ / mov r21 =r13
2008-04-01 10:52:19 +04:00
adds r16 =PT ( C R _ I P S R ) + 1 6 ,r12
adds r17 =PT ( C R _ I I P ) + 1 6 ,r12
;;
ld8 r29 = [ r16 ] ,1 6 / / l o a d c r . i p s r
ld8 r28 = [ r17 ] ,1 6 / / l o a d c r . i i p
;;
ld8 r30 = [ r16 ] ,1 6 / / l o a d c r . i f s
ld8 r25 = [ r17 ] ,1 6 / / l o a d a r . u n a t
;;
ld8 r26 = [ r16 ] ,1 6 / / l o a d a r . p f s
ld8 r27 = [ r17 ] ,1 6 / / l o a d a r . r s c
cmp. e q p9 ,p0 =r0 ,r0
/ / set p9 t o i n d i c a t e t h a t w e s h o u l d r e s t o r e c r . i f s
;;
ld8 r24 = [ r16 ] ,1 6 / / l o a d a r . r n a t ( m a y b e g a r b a g e )
ld8 r23 = [ r17 ] ,1 6 / / l o a d a r . b s p s t o r e ( m a y b e g a r b a g e )
;;
ld8 r31 = [ r16 ] ,1 6 / / l o a d p r e d i c a t e s
ld8 r22 = [ r17 ] ,1 6 / / l o a d b0
;;
ld8 r19 = [ r16 ] ,1 6 / / l o a d a r . r s c v a l u e f o r " l o a d r s "
ld8 . f i l l r1 = [ r17 ] ,1 6 / / l o a d r1
;;
ld8 . f i l l r12 = [ r16 ] ,1 6
ld8 . f i l l r13 = [ r17 ] ,1 6
;;
ld8 r20 = [ r16 ] ,1 6 / / a r . f p s r
ld8 . f i l l r15 = [ r17 ] ,1 6
;;
ld8 . f i l l r14 = [ r16 ] ,1 6
ld8 . f i l l r2 = [ r17 ]
;;
ld8 . f i l l r3 = [ r16 ]
;;
mov r16 =ar . b s p / / g e t e x i s t i n g b a c k i n g s t o r e p o i n t e r
;;
mov b0 =r22
mov a r . p f s =r26
mov c r . i f s =r30
mov c r . i p s r =r29
mov a r . f p s r =r20
mov c r . i i p =r28
;;
mov a r . r s c =r27
mov a r . u n a t =r25
mov p r =r31 ,- 1
rfi
END( i a64 _ l e a v e _ n e s t e d )
GLOBAL_ E N T R Y ( i a64 _ l e a v e _ h y p e r v i s o r _ p r e p a r e )
2008-11-21 16:04:37 +03:00
/ *
* work. n e e d _ r e s c h e d e t c . m u s t n ' t g e t c h a n g e d
* by t h i s C P U b e f o r e i t r e t u r n s t o
* user- o r f s y s - m o d e , h e n c e w e d i s a b l e i n t e r r u p t s e a r l y o n :
* /
adds r2 = P T ( R 4 ) + 1 6 ,r12
adds r3 = P T ( R 5 ) + 1 6 ,r12
adds r8 = P T ( E M L _ U N A T ) + 1 6 ,r12
;;
ld8 r8 = [ r8 ]
;;
mov a r . u n a t =r8
;;
ld8 . f i l l r4 = [ r2 ] ,1 6 / / l o a d r4
ld8 . f i l l r5 = [ r3 ] ,1 6 / / l o a d r5
;;
ld8 . f i l l r6 = [ r2 ] / / l o a d r6
ld8 . f i l l r7 = [ r3 ] / / l o a d r7
;;
2008-04-01 10:52:19 +04:00
END( i a64 _ l e a v e _ h y p e r v i s o r _ p r e p a r e )
/ / fall t h r o u g h
GLOBAL_ E N T R Y ( i a64 _ l e a v e _ h y p e r v i s o r )
2008-11-21 16:04:37 +03:00
rsm p s r . i
;;
br. c a l l . s p t k . m a n y b0 =leave_hypervisor_tail
;;
adds r20 =PT ( P R ) + 1 6 ,r12
adds r8 =PT ( E M L _ U N A T ) + 1 6 ,r12
;;
ld8 r8 = [ r8 ]
;;
mov a r . u n a t =r8
;;
lfetch [ r20 ] ,P T ( C R _ I P S R ) - P T ( P R )
adds r2 = P T ( B 6 ) + 1 6 ,r12
adds r3 = P T ( B 7 ) + 1 6 ,r12
;;
lfetch [ r20 ]
;;
ld8 r24 = [ r2 ] ,1 6 / * B 6 * /
ld8 r25 = [ r3 ] ,1 6 / * B 7 * /
;;
ld8 r26 = [ r2 ] ,1 6 / * a r _ c s d * /
ld8 r27 = [ r3 ] ,1 6 / * a r _ s s d * /
mov b6 = r24
;;
ld8 . f i l l r8 = [ r2 ] ,1 6
ld8 . f i l l r9 = [ r3 ] ,1 6
mov b7 = r25
;;
mov a r . c s d = r26
mov a r . s s d = r27
;;
ld8 . f i l l r10 = [ r2 ] ,P T ( R 1 5 ) - P T ( R 1 0 )
ld8 . f i l l r11 = [ r3 ] ,P T ( R 1 4 ) - P T ( R 1 1 )
;;
ld8 . f i l l r15 = [ r2 ] ,P T ( R 1 6 ) - P T ( R 1 5 )
ld8 . f i l l r14 = [ r3 ] ,P T ( R 1 7 ) - P T ( R 1 4 )
;;
ld8 . f i l l r16 = [ r2 ] ,1 6
ld8 . f i l l r17 = [ r3 ] ,1 6
;;
ld8 . f i l l r18 = [ r2 ] ,1 6
ld8 . f i l l r19 = [ r3 ] ,1 6
;;
ld8 . f i l l r20 = [ r2 ] ,1 6
ld8 . f i l l r21 = [ r3 ] ,1 6
;;
ld8 . f i l l r22 = [ r2 ] ,1 6
ld8 . f i l l r23 = [ r3 ] ,1 6
;;
ld8 . f i l l r24 = [ r2 ] ,1 6
ld8 . f i l l r25 = [ r3 ] ,1 6
;;
ld8 . f i l l r26 = [ r2 ] ,1 6
ld8 . f i l l r27 = [ r3 ] ,1 6
;;
ld8 . f i l l r28 = [ r2 ] ,1 6
ld8 . f i l l r29 = [ r3 ] ,1 6
;;
ld8 . f i l l r30 = [ r2 ] ,P T ( F 6 ) - P T ( R 3 0 )
ld8 . f i l l r31 = [ r3 ] ,P T ( F 7 ) - P T ( R 3 1 )
;;
rsm p s r . i | p s r . i c
/ / initiate t u r n i n g o f f o f i n t e r r u p t a n d i n t e r r u p t i o n c o l l e c t i o n
invala / / i n v a l i d a t e A L A T
;;
srlz. i / / 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 f f
;;
bsw. 0
;;
adds r16 = P T ( C R _ I P S R ) + 1 6 ,r12
adds r17 = P T ( C R _ I I P ) + 1 6 ,r12
mov r21 =r13 / / g e t c u r r e n t
;;
ld8 r31 = [ r16 ] ,1 6 / / l o a d c r . i p s r
ld8 r30 = [ r17 ] ,1 6 / / l o a d c r . i i p
;;
ld8 r29 = [ r16 ] ,1 6 / / l o a d c r . i f s
ld8 r28 = [ r17 ] ,1 6 / / l o a d a r . u n a t
;;
ld8 r27 = [ r16 ] ,1 6 / / l o a d a r . p f s
ld8 r26 = [ r17 ] ,1 6 / / l o a d a r . r s c
;;
ld8 r25 = [ r16 ] ,1 6 / / l o a d a r . r n a t
ld8 r24 = [ r17 ] ,1 6 / / l o a d a r . b s p s t o r e
;;
ld8 r23 = [ r16 ] ,1 6 / / l o a d p r e d i c a t e s
ld8 r22 = [ r17 ] ,1 6 / / l o a d b0
;;
ld8 r20 = [ r16 ] ,1 6 / / l o a d a r . r s c v a l u e f o r " l o a d r s "
ld8 . f i l l r1 = [ r17 ] ,1 6 / / l o a d r1
;;
ld8 . f i l l r12 = [ r16 ] ,1 6 / / l o a d r12
ld8 . f i l l r13 = [ r17 ] ,P T ( R 2 ) - P T ( R 1 3 ) / / l o a d r13
;;
ld8 r19 = [ r16 ] ,P T ( R 3 ) - P T ( A R _ F P S R ) / / l o a d a r _ f p s r
ld8 . f i l l r2 = [ r17 ] ,P T ( A R _ C C V ) - P T ( R 2 ) / / l o a d r2
;;
ld8 . f i l l r3 = [ r16 ] / / l o a d r3
ld8 r18 = [ r17 ] / / l o a d a r _ c c v
;;
mov a r . f p s r =r19
mov a r . c c v =r18
shr. u r18 =r20 ,1 6
;;
2008-04-01 10:52:19 +04:00
kvm_rbs_switch :
2008-11-21 16:04:37 +03:00
mov r19 =96
2008-04-01 10:52:19 +04:00
kvm_dont_preserve_current_frame :
/ *
* To p r e v e n t l e a k i n g b i t s b e t w e e n t h e h y p e r v i s o r a n d g u e s t d o m a i n ,
* we m u s t c l e a r t h e s t a c k e d r e g i s t e r s i n t h e " i n v a l i d " p a r t i t i o n h e r e .
* 5 registers/ c y c l e o n M c K i n l e y ) .
* /
# define p R e c u r s e p6
# define p R e t u r n p7
# define N r e g s 1 4
2008-11-21 16:04:37 +03:00
alloc l o c0 =ar . p f s ,2 ,N r e g s - 2 ,2 ,0
shr. u l o c1 =r18 ,9 / / R N a T s l o t s < = f l o o r ( d i r t y S i z e / ( 6 4 * 8 ) )
sub r19 =r19 ,r18 / / r19 = ( p h y s S t a c k e d S i z e + 8 ) - d i r t y S i z e
;;
mov a r . r s c =r20 / / l o a d a r . r s c t o b e u s e d f o r " l o a d r s "
shladd i n 0 =loc1 ,3 ,r19
mov i n 1 =0
;;
TEXT_ A L I G N ( 3 2 )
2008-04-01 10:52:19 +04:00
kvm_rse_clear_invalid :
2008-11-21 16:04:37 +03:00
alloc l o c0 =ar . p f s ,2 ,N r e g s - 2 ,2 ,0
cmp. l t p R e c u r s e ,p0 =Nregs * 8 ,i n 0
/ / if m o r e t h a n N r e g s r e g s l e f t t o c l e a r , ( r e ) c u r s e
add o u t 0 = - N r e g s * 8 ,i n 0
add o u t 1 =1 ,i n 1 / / i n c r e m e n t r e c u r s i o n c o u n t
mov l o c1 =0
mov l o c2 =0
;;
mov l o c3 =0
mov l o c4 =0
mov l o c5 =0
mov l o c6 =0
mov l o c7 =0
2008-04-01 10:52:19 +04:00
( pRecurse) b r . c a l l . d p t k . f e w b0 =kvm_rse_clear_invalid
2008-11-21 16:04:37 +03:00
;;
mov l o c8 =0
mov l o c9 =0
cmp. n e p R e t u r n ,p0 =r0 ,i n 1
/ / if r e c u r s i o n c o u n t ! = 0 , w e n e e d t o d o a b r . r e t
mov l o c10 =0
mov l o c11 =0
2008-04-01 10:52:19 +04:00
( pReturn) b r . r e t . d p t k . m a n y b0
# undef p R e c u r s e
# undef p R e t u r n
/ / loadrs h a s a l r e a d y b e e n s h i f t e d
2008-11-21 16:04:37 +03:00
alloc r16 =ar . p f s ,0 ,0 ,0 ,0 / / d r o p c u r r e n t r e g i s t e r f r a m e
;;
loadrs
;;
mov a r . b s p s t o r e =r24
;;
mov a r . u n a t =r28
mov a r . r n a t =r25
mov a r . r s c =r26
;;
mov c r . i p s r =r31
mov c r . i i p =r30
mov c r . i f s =r29
mov a r . p f s =r27
adds r18 =VMM_VPD_BASE_OFFSET ,r21
;;
ld8 r18 = [ r18 ] / / v p d
adds r17 =VMM_VCPU_ISR_OFFSET ,r21
;;
ld8 r17 = [ r17 ]
adds r19 =VMM_VPD_VPSR_OFFSET ,r18
;;
ld8 r19 = [ r19 ] / / v p s r
mov r25 =r18
adds r16 = V M M _ V C P U _ G P _ O F F S E T ,r21
;;
ld8 r16 = [ r16 ] / / P u t g p i n r24
movl r24 = @gprel(ia64_vmm_entry) // calculate return address
;;
add r24 =r24 ,r16
;;
br. s p t k . m a n y k v m _ v p s _ s y n c _ w r i t e / / c a l l t h e s e r v i c e
;;
2008-04-01 10:52:19 +04:00
END( i a64 _ l e a v e _ h y p e r v i s o r )
/ / fall t h r o u g h
GLOBAL_ E N T R Y ( i a64 _ v m m _ e n t r y )
/ *
* must b e a t b a n k 0
* parameter :
* r17 : cr. i s r
* r18 : vpd
* r19 : vpsr
* r22 : b0
* r23 : predicate
* /
2008-11-21 16:04:37 +03:00
mov r24 =r22
mov r25 =r18
tbit. n z p1 ,p2 = r19 ,I A 6 4 _ P S R _ I C _ B I T / / p1 =vpsr . i c
( p1 ) b r . c o n d . s p t k . f e w k v m _ v p s _ r e s u m e _ n o r m a l
( p2 ) b r . c o n d . s p t k . m a n y k v m _ v p s _ r e s u m e _ h a n d l e r
;;
2008-04-01 10:52:19 +04:00
END( i a64 _ v m m _ e n t r y )
/ *
* extern u 6 4 i a64 _ c a l l _ v s a ( u 6 4 p r o c , u 6 4 a r g 1 , u 6 4 a r g 2 ,
* u6 4 a r g 3 , u 6 4 a r g 4 , u 6 4 a r g 5 ,
* u6 4 a r g 6 , u 6 4 a r g 7 ) ;
*
* XXX : The c u r r e n t l y d e f i n e d s e r v i c e s u s e o n l y 4 a r g s a t t h e m a x . T h e
* rest a r e n o t c o n s u m e d .
* /
GLOBAL_ E N T R Y ( i a64 _ c a l l _ v s a )
.regstk 4 , 4 , 0 , 0
rpsave = l o c0
pfssave = l o c1
psrsave = l o c2
entry = l o c3
hostret = r24
2008-11-21 16:04:37 +03:00
alloc p f s s a v e =ar . p f s ,4 ,4 ,0 ,0
mov r p s a v e =rp
adds e n t r y =VMM_VCPU_VSA_BASE_OFFSET , r13
;;
ld8 e n t r y = [ e n t r y ]
1 : mov h o s t r e t =ip
mov r25 =in1 / / c o p y a r g u m e n t s
mov r26 =in2
mov r27 =in3
mov p s r s a v e =psr
;;
tbit. n z p6 ,p0 =psrsave ,1 4 / / I A 6 4 _ P S R _ I
tbit. n z p7 ,p0 =psrsave ,1 3 / / I A 6 4 _ P S R _ I C
;;
add h o s t r e t =2f - 1 b ,h o s t r e t / / c a l c u l a t e r e t u r n a d d r e s s
add e n t r y =entry ,i n 0
;;
rsm p s r . i | p s r . i c
;;
srlz. i
mov b6 =entry
br. c o n d . s p t k b6 / / c a l l t h e s e r v i c e
2008-04-01 10:52:19 +04:00
2 :
2008-11-21 16:04:37 +03:00
/ / Architectural s e q u e n c e f o r e n a b l i n g i n t e r r u p t s i f n e c e s s a r y
2008-04-01 10:52:19 +04:00
( p7 ) s s m p s r . i c
2008-11-21 16:04:37 +03:00
;;
2008-04-01 10:52:19 +04:00
( p7 ) s r l z . i
2008-11-21 16:04:37 +03:00
;;
2008-04-01 10:52:19 +04:00
/ / ( p6 ) s s m p s r . i
2008-11-21 16:04:37 +03:00
;;
mov r p =rpsave
mov a r . p f s =pfssave
mov r8 =r31
;;
srlz. d
br. r e t . s p t k r p
2008-04-01 10:52:19 +04:00
END( i a64 _ c a l l _ v s a )
# define I N I T _ B S P S T O R E ( ( 4 < < 3 0 ) - ( 1 2 < < 2 0 ) - 0 x10 0 )
GLOBAL_ E N T R Y ( v m m _ r e s e t _ e n t r y )
2008-11-21 16:04:37 +03:00
/ / set u p i p s r , i i p , v p d . v p s r , d c r
/ / For I P S R : i t / d t / r t =1 , i / i c =1 , s i =1 , v m / b n =1
/ / For D C R : a l l b i t s 0
bsw. 0
;;
mov r21 =r13
adds r14 = - V M M _ P T _ R E G S _ S I Z E , r12
;;
movl r6 =0x501008826000 / / I P S R d t / r t / i t : 1 ;i/ic:1, si:1, vm/bn:1
movl r10 =0x8000000000000000
adds r16 =PT ( C R _ I I P ) , r14
adds r20 =PT ( R 1 ) , r14
;;
rsm p s r . i c | p s r . i
;;
srlz. i
;;
mov a r . r s c = 0
;;
flushrs
;;
mov a r . b s p s t o r e = 0
/ / clear B S P S T O R E
;;
mov c r . i p s r =r6
mov c r . i f s =r10
ld8 r4 = [ r16 ] / / S e t i n i t i i p f o r f i r s t r u n .
ld8 r1 = [ r20 ]
;;
mov c r . i i p =r4
adds r16 =VMM_VPD_BASE_OFFSET ,r13
;;
ld8 r18 = [ r16 ]
;;
adds r19 =VMM_VPD_VPSR_OFFSET ,r18
;;
ld8 r19 = [ r19 ]
mov r17 =r0
mov r22 =r0
mov r23 =r0
br. c o n d . s p t k i a64 _ v m m _ e n t r y
br. r e t . s p t k b0
2008-04-01 10:52:19 +04:00
END( v m m _ r e s e t _ e n t r y )