2005-04-17 02:20:36 +04:00
/ *
2012-07-20 13:15:04 +04:00
* Copyright I B M C o r p . 1 9 9 9 , 2 0 1 0
2005-11-07 11:59:12 +03:00
*
* Author( s ) : H a r t m u t P e n n e r < h p @de.ibm.com>
* Martin S c h w i d e f s k y < s c h w i d e f s k y @de.ibm.com>
* Rob v a n d e r H e i j < r v d h e i @iae.nl>
* Heiko C a r s t e n s < h e i k o . c a r s t e n s @de.ibm.com>
2005-04-17 02:20:36 +04:00
*
* There a r e 5 d i f f e r e n t I P L m e t h o d s
* 1 ) load t h e i m a g e d i r e c t l y i n t o r a m a t a d d r e s s 0 a n d d o a n P S W r e s t a r t
* 2 ) linload w i l l l o a d t h e i m a g e f r o m a d d r e s s 0 x10 0 0 0 t o m e m o r y 0 x10 0 0 0
* and s t a r t t h e c o d e t h r u L P S W 0 x00 0 8 0 0 0 0 8 0 0 1 0 0 0 0 ( V M o n l y , d e p r e c a t e d )
* 3 ) generate t h e t a p e i p l h e a d e r , s t o r e t h e g e n e r a t e d i m a g e o n a t a p e
* and i p l f r o m i t
* In c a s e o f S L t a p e y o u n e e d t o I P L 5 t i m e s t o g e t p a s t V O L 1 e t c
* 4 ) generate t h e v m r e a d e r i p l h e a d e r , m o v e t h e g e n e r a t e d i m a g e t o t h e
* VM r e a d e r ( u s e o p t i o n N O H ! ) a n d d o a i p l f r o m r e a d e r ( V M o n l y )
* 5 ) direct c a l l o f s t a r t b y t h e S A L I P L l o a d e r
* We u s e t h e c p u i d t o d i s t i n g u i s h b e t w e e n V M a n d n a t i v e i p l
* params f o r k e r n e l a r e p u s h e d t o 0 x10 4 0 0 ( s e e s e t u p . h )
2005-11-07 11:59:12 +03:00
*
2005-04-17 02:20:36 +04:00
* /
2009-04-26 06:11:06 +04:00
# include < l i n u x / i n i t . h >
2011-07-24 12:48:19 +04:00
# include < l i n u x / l i n k a g e . h >
2005-09-09 22:57:26 +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 / t h r e a d _ i n f o . h >
# include < a s m / p a g e . h >
2006-01-06 11:19:28 +03:00
# ifdef C O N F I G _ 6 4 B I T
2005-11-07 11:59:12 +03:00
# define A R C H _ O F F S E T 4
# else
# define A R C H _ O F F S E T 0
# endif
2009-04-26 06:11:06 +04:00
_ _ HEAD
2005-04-17 02:20:36 +04:00
2006-09-28 18:56:37 +04:00
# define I P L _ B S 0 x73 0
.org 0
.long 0 x0 0 0 8 0 0 0 0 ,0 x80 0 0 0 0 0 0 + i p l s t a r t # T h e f i r s t 24 b y t e s a r e l o a d e d
.long 0 x0 2 0 0 0 0 1 8 ,0 x60 0 0 0 0 5 0 # b y i p l t o a d d r e s s e s 0 - 2 3 .
.long 0 x0 2 0 0 0 0 6 8 ,0 x60 0 0 0 0 5 0 # ( a P S W a n d t w o C C W s ) .
.fill 8 0 - 2 4 , 1 , 0 x4 0 # b y t e s 24 - 7 9 a r e d i s c a r d e d ! !
.long 0 x0 2 0 0 0 0 f0 ,0 x60 0 0 0 0 5 0 # T h e n e x t 160 b y t e a r e l o a d e d
.long 0 x0 2 0 0 0 1 4 0 ,0 x60 0 0 0 0 5 0 # t o a d d r e s s e s 0x18 - 0 x b7
.long 0 x0 2 0 0 0 1 9 0 ,0 x60 0 0 0 0 5 0 # T h e y f o r m t h e c o n t i n u a t i o n
.long 0 x0 2 0 0 0 1 e 0 ,0 x60 0 0 0 0 5 0 # o f t h e C C W p r o g r a m s t a r t e d
.long 0 x0 2 0 0 0 2 3 0 ,0 x60 0 0 0 0 5 0 # b y i p l a n d l o a d t h e r a n g e
.long 0 x0 2 0 0 0 2 8 0 ,0 x60 0 0 0 0 5 0 # 0x0f0 - 0 x73 0 f r o m t h e i m a g e
.long 0 x0 2 0 0 0 2 d0 ,0 x60 0 0 0 0 5 0 # t o t h e r a n g e 0x0f0 - 0 x73 0
.long 0 x0 2 0 0 0 3 2 0 ,0 x60 0 0 0 0 5 0 # i n m e m o r y . A t t h e e n d o f
.long 0 x0 2 0 0 0 3 7 0 ,0 x60 0 0 0 0 5 0 # t h e c h a n n e l p r o g r a m t h e P S W
.long 0 x0 2 0 0 0 3 c0 ,0 x60 0 0 0 0 5 0 # a t l o c a t i o n 0 i s l o a d e d .
.long 0 x0 2 0 0 0 4 1 0 ,0 x60 0 0 0 0 5 0 # I n i t i a l p r o c e s s i n g s t a r t s
2012-08-23 18:18:09 +04:00
.long 0 x0 2 0 0 0 4 6 0 ,0 x60 0 0 0 0 5 0 # a t 0x200 = i p l s t a r t .
2006-09-28 18:56:37 +04:00
.long 0 x0 2 0 0 0 4 b0 ,0 x60 0 0 0 0 5 0
.long 0 x0 2 0 0 0 5 0 0 ,0 x60 0 0 0 0 5 0
.long 0 x0 2 0 0 0 5 5 0 ,0 x60 0 0 0 0 5 0
.long 0 x0 2 0 0 0 5 a0 ,0 x60 0 0 0 0 5 0
.long 0 x0 2 0 0 0 5 f0 ,0 x60 0 0 0 0 5 0
.long 0 x0 2 0 0 0 6 4 0 ,0 x60 0 0 0 0 5 0
.long 0 x0 2 0 0 0 6 9 0 ,0 x60 0 0 0 0 5 0
.long 0 x0 2 0 0 0 6 e 0 ,0 x20 0 0 0 0 5 0
2005-04-17 02:20:36 +04:00
2012-08-23 18:18:09 +04:00
.org 0x200
#
# subroutine t o s e t a r c h i t e c t u r e m o d e
#
.Lsetmode :
# ifdef C O N F I G _ 6 4 B I T
mvi _ _ L C _ A R _ M O D E _ I D ,1 # s e t e s a m e f l a g
slr % r0 ,% r0 # s e t c p u i d t o z e r o
lhi % r1 ,2 # m o d e 2 = e s a m e ( d u m p )
sigp % r1 ,% r0 ,0 x12 # s w i t c h t o e s a m e m o d e
bras % r13 ,0 f
.fill 1 6 , 4 , 0 x0
0 : lmh % r0 ,% r15 ,0 ( % r13 ) # c l e a r h i g h - o r d e r h a l f o f g p r s
sam3 1 # s w i t c h t o 31 b i t a d d r e s s i n g m o d e
# else
mvi _ _ L C _ A R _ M O D E _ I D ,0 # s e t E S A f l a g ( m o d e 0 )
# endif
br % r14
#
# subroutine t o w a i t f o r e n d I / O
#
.Lirqwait :
# ifdef C O N F I G _ 6 4 B I T
mvc 0 x1 f0 ( 1 6 ) ,. L n e w p s w # s e t u p I O i n t e r r u p t p s w
lpsw . L w a i t p s w
.Lioint :
br % r14
.align 8
.Lnewpsw :
.quad 0 x0 0 0 0 0 0 0 0 8 0 0 0 0 0 0 0 ,. L i o i n t
# else
mvc 0 x78 ( 8 ) ,. L n e w p s w # s e t u p I O i n t e r r u p t p s w
lpsw . L w a i t p s w
.Lioint :
br % r14
.align 8
.Lnewpsw :
.long 0 x0 0 0 8 0 0 0 0 ,0 x80 0 0 0 0 0 0 + . L i o i n t
# endif
.Lwaitpsw :
.long 0 x0 2 0 a00 0 0 ,0 x80 0 0 0 0 0 0 + . L i o i n t
2005-04-17 02:20:36 +04:00
#
# subroutine f o r l o a d i n g c a r d s f r o m t h e r e a d e r
#
2006-09-28 18:56:37 +04:00
.Lloader :
2012-08-23 18:18:09 +04:00
la % r4 ,0 ( % r14 )
2006-09-28 18:56:37 +04:00
la % r3 ,. L o r b # r 2 = a d d r e s s o f o r b i n t o r2
la % r5 ,. L i r b # r 4 = a d d r e s s o f i r b
la % r6 ,. L c c w s
la % r7 ,2 0
2005-04-17 02:20:36 +04:00
.Linit :
2006-09-28 18:56:37 +04:00
st % r2 ,4 ( % r6 ) # i n i t i a l i z e C C W d a t a a d d r e s s e s
la % r2 ,0 x50 ( % r2 )
la % r6 ,8 ( % r6 )
bct 7 ,. L i n i t
2005-04-17 02:20:36 +04:00
2006-09-28 18:56:37 +04:00
lctl % c6 ,% c6 ,. L c r6 # s e t I O s u b c l a s s m a s k
slr % r2 ,% r2
2005-04-17 02:20:36 +04:00
.Lldlp :
2006-09-28 18:56:37 +04:00
ssch 0 ( % r3 ) # l o a d c h u n k o f 1600 b y t e s
bnz . L l d e r r
2005-04-17 02:20:36 +04:00
.Lwait4irq :
2012-08-23 18:18:09 +04:00
bas % r14 ,. L i r q w a i t
2006-09-28 18:56:37 +04:00
c % r1 ,0 x b8 # c o m p a r e s u b c h a n n e l n u m b e r
bne . L w a i t 4 i r q
tsch 0 ( % r5 )
2005-04-17 02:20:36 +04:00
2006-09-28 18:56:37 +04:00
slr % r0 ,% r0
ic % r0 ,8 ( % r5 ) # g e t d e v i c e s t a t u s
chi % r0 ,8 # c h a n n e l e n d ?
be . L c o n t
chi % r0 ,1 2 # c h a n n e l e n d + d e v i c e e n d ?
be . L c o n t
2005-04-17 02:20:36 +04:00
2006-09-28 18:56:37 +04:00
l % r0 ,4 ( % r5 )
s % r0 ,8 ( % r3 ) # r 0 / 8 = n u m b e r o f c c w s e x e c u t e d
mhi % r0 ,1 0 # * 10 = n u m b e r o f b y t e s i n c c w s
lh % r3 ,1 0 ( % r5 ) # g e t r e s i d u a l c o u n t
sr % r0 ,% r3 # # c c w s * 80 - r e s i d u a l = #b y t e s r e a d
ar % r2 ,% r0
2012-08-23 18:18:09 +04:00
br % r4 # r 2 c o n t a i n s t h e t o t a l s i z e
2005-04-17 02:20:36 +04:00
.Lcont :
2006-09-28 18:56:37 +04:00
ahi % r2 ,0 x64 0 # a d d 0x640 t o t o t a l s i z e
la % r6 ,. L c c w s
la % r7 ,2 0
2005-04-17 02:20:36 +04:00
.Lincr :
2006-09-28 18:56:37 +04:00
l % r0 ,4 ( % r6 ) # u p d a t e C C W d a t a a d d r e s s e s
ahi % r0 ,0 x64 0
st % r0 ,4 ( % r6 )
ahi % r6 ,8
bct 7 ,. L i n c r
2005-04-17 02:20:36 +04:00
2006-09-28 18:56:37 +04:00
b . L l d l p
2005-04-17 02:20:36 +04:00
.Llderr :
2006-09-28 18:56:37 +04:00
lpsw . L c r a s h
2005-04-17 02:20:36 +04:00
2006-09-28 18:56:37 +04:00
.align 8
.Lorb : .long 0 x0 0 0 0 0 0 0 0 ,0 x00 8 0 f f00 ,. L c c w s
.Lirb : .long 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0
.Lcr6 : .long 0xff000000
.Lloadp : .long 0 , 0
.align 8
.Lcrash : .long 0 x0 0 0 a00 0 0 ,0 x00 0 0 0 0 0 0
2005-04-17 02:20:36 +04:00
2006-09-28 18:56:37 +04:00
.align 8
.Lccws : .rept 19
.long 0 x0 2 6 0 0 0 5 0 ,0 x00 0 0 0 0 0 0
.endr
.long 0 x0 2 2 0 0 0 5 0 ,0 x00 0 0 0 0 0 0
2005-04-17 02:20:36 +04:00
iplstart :
2012-08-23 18:18:09 +04:00
bas % r14 ,. L s e t m o d e # I m m e d i a t e l y s w i t c h t o 64 b i t m o d e
2006-09-28 18:56:37 +04:00
lh % r1 ,0 x b8 # t e s t i f s u b c h a n n e l n u m b e r
bct % r1 ,. L n o l o a d # i s v a l i d
l % r1 ,0 x b8 # l o a d i p l s u b c h a n n e l n u m b e r
la % r2 ,I P L _ B S # l o a d s t a r t a d d r e s s
bas % r14 ,. L l o a d e r # l o a d r e s t o f i p l i m a g e
l % r12 ,. L p a r m # p o i n t e r t o p a r a m e t e r a r e a
st % r1 ,I P L _ D E V I C E + A R C H _ O F F S E T - P A R M A R E A ( % r12 ) # s a v e i p l d e v i c e n u m b e r
2005-04-17 02:20:36 +04:00
#
# load p a r a m e t e r f i l e f r o m i p l d e v i c e
#
.Lagain1 :
2006-09-28 18:56:37 +04:00
l % r2 ,. L i n i t r d # r a m d i s k l o c . i s t e m p
bas % r14 ,. L l o a d e r # l o a d p a r a m e t e r f i l e
ltr % r2 ,% r2 # g o t a n y t h i n g ?
bz . L n o p f
chi % r2 ,8 9 5
bnh . L n o t r u n c
la % r2 ,8 9 5
2005-04-17 02:20:36 +04:00
.Lnotrunc :
2006-09-28 18:56:37 +04:00
l % r4 ,. L i n i t r d
clc 0 ( 3 ,% r4 ) ,. L _ h d r # i f i t i s H D R x
bz . L a g a i n 1 # s k i p d a t a s e t h e a d e r
clc 0 ( 3 ,% r4 ) ,. L _ e o f # i f i t i s E O F x
bz . L a g a i n 1 # s k i p d a t e s e t t r a i l e r
la % r5 ,0 ( % r4 ,% r2 )
lr % r3 ,% r2
2010-02-27 00:37:51 +03:00
la % r3 ,C O M M A N D _ L I N E - P A R M A R E A ( % r12 ) # l o a d a d r . o f c o m m a n d l i n e
2006-09-28 18:56:37 +04:00
mvc 0 ( 2 5 6 ,% r3 ) ,0 ( % r4 )
mvc 2 5 6 ( 2 5 6 ,% r3 ) ,2 5 6 ( % r4 )
mvc 5 1 2 ( 2 5 6 ,% r3 ) ,5 1 2 ( % r4 )
mvc 7 6 8 ( 1 2 2 ,% r3 ) ,7 6 8 ( % r4 )
slr % r0 ,% r0
b . L c n t l p
2005-04-17 02:20:36 +04:00
.Ldelspc :
2006-09-28 18:56:37 +04:00
ic % r0 ,0 ( % r2 ,% r3 )
chi % r0 ,0 x20 # i s i t a s p a c e ?
be . L c n t l p
ahi % r2 ,1
b . L e o l p
2005-04-17 02:20:36 +04:00
.Lcntlp :
2006-09-28 18:56:37 +04:00
brct % r2 ,. L d e l s p c
2005-04-17 02:20:36 +04:00
.Leolp :
2006-09-28 18:56:37 +04:00
slr % r0 ,% r0
stc % r0 ,0 ( % r2 ,% r3 ) # t e r m i n a t e b u f f e r
2005-04-17 02:20:36 +04:00
.Lnopf :
#
# load r a m d i s k f r o m i p l d e v i c e
2006-09-28 18:56:37 +04:00
#
2005-04-17 02:20:36 +04:00
.Lagain2 :
2006-09-28 18:56:37 +04:00
l % r2 ,. L i n i t r d # a d d r o f r a m d i s k
st % r2 ,I N I T R D _ S T A R T + A R C H _ O F F S E T - P A R M A R E A ( % r12 )
bas % r14 ,. L l o a d e r # l o a d r a m d i s k
st % r2 ,I N I T R D _ S I Z E + A R C H _ O F F S E T - P A R M A R E A ( % r12 ) # s t o r e s i z e o f r d
ltr % r2 ,% r2
bnz . L r d c o n t
st % r2 ,I N I T R D _ S T A R T + A R C H _ O F F S E T - P A R M A R E A ( % r12 ) # n o r a m d i s k f o u n d
2005-04-17 02:20:36 +04:00
.Lrdcont :
2006-09-28 18:56:37 +04:00
l % r2 ,. L i n i t r d
2005-04-17 02:20:36 +04:00
2006-09-28 18:56:37 +04:00
clc 0 ( 3 ,% r2 ) ,. L _ h d r # s k i p H D R x a n d E O F x
bz . L a g a i n 2
clc 0 ( 3 ,% r2 ) ,. L _ e o f
bz . L a g a i n 2
2005-04-17 02:20:36 +04:00
#
# reset f i l e s i n V M r e a d e r
#
2012-08-23 18:18:09 +04:00
stidp . L c p u i d # s t o r e c p u i d
tm . L c p u i d ,0 x f f # r u n n i n g V M ?
2006-09-28 18:56:37 +04:00
bno . L n o r e s e t
la % r2 ,. L r e s e t
lhi % r3 ,2 6
diag % r2 ,% r3 ,8
la % r5 ,. L i r b
stsch 0 ( % r5 ) # c h e c k i f i r q i s p e n d i n g
tm 3 0 ( % r5 ) ,0 x0 f # b y v e r i f y i n g i f a n y o f t h e
bnz . L w a i t f o r i r q # a c t i v i t y o r s t a t u s c o n t r o l
tm 3 1 ( % r5 ) ,0 x f f # b i t s i s s e t i n t h e s c h i b
bz . L n o r e s e t
2005-07-30 01:03:36 +04:00
.Lwaitforirq :
2012-08-23 18:18:09 +04:00
bas % r14 ,. L i r q w a i t # w a i t f o r I O i n t e r r u p t
2006-09-28 18:56:37 +04:00
c % r1 ,0 x b8 # c o m p a r e s u b c h a n n e l n u m b e r
2012-08-23 18:18:09 +04:00
bne . L w a i t f o r i r q
2006-09-28 18:56:37 +04:00
la % r5 ,. L i r b
tsch 0 ( % r5 )
2005-04-17 02:20:36 +04:00
.Lnoreset :
2006-09-28 18:56:37 +04:00
b . L n o l o a d
2005-06-22 04:16:31 +04:00
2005-04-17 02:20:36 +04:00
#
# everything l o a d e d , g o f o r i t
#
.Lnoload :
2006-09-28 18:56:37 +04:00
l % r1 ,. L s t a r t u p
br % r1
2005-04-17 02:20:36 +04:00
2010-08-09 20:12:57 +04:00
.Linitrd : .long _end # default a d d r e s s o f i n i t r d
2005-04-17 02:20:36 +04:00
.Lparm : .long PARMAREA
.Lstartup : .long startup
2006-09-28 18:56:37 +04:00
.Lreset : .byte 0 xc3 ,0 x c8 ,0 x c1 ,0 x d5 ,0 x c7 ,0 x c5 ,0 x40 ,0 x d9 ,0 x c4 ,0 x d9 ,0 x40
.byte 0 xc1 ,0 x d3 ,0 x d3 ,0 x40 ,0 x d2 ,0 x c5 ,0 x c5 ,0 x d7 ,0 x40 ,0 x d5 ,0 x d6
.byte 0 xc8 ,0 x d6 ,0 x d3 ,0 x c4 # " change rdr all keep nohold "
.L_eof : .long 0xc5d6c600 /* C'EOF' */
.L_hdr : .long 0xc8c4d900 /* C'HDR' */
2012-08-23 18:18:09 +04:00
.align 8
.Lcpuid : .fill 8 , 1 , 0
2005-04-17 02:20:36 +04:00
#
# SALIPL l o a d e r s u p p o r t . B a s e d o n a p a t c h b y R o b v a n d e r H e i j .
# This e n t r y p o i n t i s c a l l e d d i r e c t l y f r o m t h e S A L I P L l o a d e r a n d
# doesn' t n e e d a b u i l t i n i p l r e c o r d .
#
2006-09-28 18:56:37 +04:00
.org 0x800
2011-07-24 12:48:19 +04:00
ENTRY( s t a r t )
2006-09-28 18:56:37 +04:00
stm % r0 ,% r15 ,0 x07 b0 # s t o r e r e g i s t e r s
2012-08-23 18:18:09 +04:00
bas % r14 ,. L s e t m o d e # I m m e d i a t e l y s w i t c h t o 64 b i t m o d e
2006-09-28 18:56:37 +04:00
basr % r12 ,% r0
2005-04-17 02:20:36 +04:00
.base :
2006-09-28 18:56:37 +04:00
l % r11 ,. p a r m
l % r8 ,. c m d # p o i n t e r t o c o m m a n d b u f f e r
2005-04-17 02:20:36 +04:00
2006-09-28 18:56:37 +04:00
ltr % r9 ,% r9 # d o w e h a v e S A L I P L p a r a m e t e r s ?
bp . s k 8 x8
2005-04-17 02:20:36 +04:00
2006-09-28 18:56:37 +04:00
mvc 0 ( 6 4 ,% r8 ) ,0 x00 b0 # c o p y s a v e d r e g i s t e r s
xc 6 4 ( 2 4 0 - 6 4 ,% r8 ) ,0 ( % r8 ) # r e m a i n d e r o f b u f f e r
tr 0 ( 6 4 ,% r8 ) ,. l o w c a s e
b . g o t r
2005-04-17 02:20:36 +04:00
.sk8x8 :
2006-09-28 18:56:37 +04:00
mvc 0 ( 2 4 0 ,% r8 ) ,0 ( % r9 ) # c o p y i p l p a r m s i n t o b u f f e r
2005-04-17 02:20:36 +04:00
.gotr :
2006-09-28 18:56:37 +04:00
slr % r0 ,% r0
st % r0 ,I N I T R D _ S I Z E + A R C H _ O F F S E T - P A R M A R E A ( % r11 )
st % r0 ,I N I T R D _ S T A R T + A R C H _ O F F S E T - P A R M A R E A ( % r11 )
j s t a r t u p # c o n t i n u e w i t h s t a r t u p
.cmd : .long COMMAND_LINE # address o f c o m m a n d l i n e b u f f e r
.parm : .long PARMAREA
2005-04-17 02:20:36 +04:00
.lowcase :
2006-09-28 18:56:37 +04:00
.byte 0 x0 0 ,0 x01 ,0 x02 ,0 x03 ,0 x04 ,0 x05 ,0 x06 ,0 x07
2005-04-17 02:20:36 +04:00
.byte 0 x0 8 ,0 x09 ,0 x0 a ,0 x0 b ,0 x0 c ,0 x0 d ,0 x0 e ,0 x0 f
2006-09-28 18:56:37 +04:00
.byte 0 x1 0 ,0 x11 ,0 x12 ,0 x13 ,0 x14 ,0 x15 ,0 x16 ,0 x17
2005-04-17 02:20:36 +04:00
.byte 0 x1 8 ,0 x19 ,0 x1 a ,0 x1 b ,0 x1 c ,0 x1 d ,0 x1 e ,0 x1 f
2006-09-28 18:56:37 +04:00
.byte 0 x2 0 ,0 x21 ,0 x22 ,0 x23 ,0 x24 ,0 x25 ,0 x26 ,0 x27
2005-04-17 02:20:36 +04:00
.byte 0 x2 8 ,0 x29 ,0 x2 a ,0 x2 b ,0 x2 c ,0 x2 d ,0 x2 e ,0 x2 f
2006-09-28 18:56:37 +04:00
.byte 0 x3 0 ,0 x31 ,0 x32 ,0 x33 ,0 x34 ,0 x35 ,0 x36 ,0 x37
2005-04-17 02:20:36 +04:00
.byte 0 x3 8 ,0 x39 ,0 x3 a ,0 x3 b ,0 x3 c ,0 x3 d ,0 x3 e ,0 x3 f
2006-09-28 18:56:37 +04:00
.byte 0 x4 0 ,0 x41 ,0 x42 ,0 x43 ,0 x44 ,0 x45 ,0 x46 ,0 x47
2005-04-17 02:20:36 +04:00
.byte 0 x4 8 ,0 x49 ,0 x4 a ,0 x4 b ,0 x4 c ,0 x4 d ,0 x4 e ,0 x4 f
2006-09-28 18:56:37 +04:00
.byte 0 x5 0 ,0 x51 ,0 x52 ,0 x53 ,0 x54 ,0 x55 ,0 x56 ,0 x57
2005-04-17 02:20:36 +04:00
.byte 0 x5 8 ,0 x59 ,0 x5 a ,0 x5 b ,0 x5 c ,0 x5 d ,0 x5 e ,0 x5 f
2006-09-28 18:56:37 +04:00
.byte 0 x6 0 ,0 x61 ,0 x62 ,0 x63 ,0 x64 ,0 x65 ,0 x66 ,0 x67
2005-04-17 02:20:36 +04:00
.byte 0 x6 8 ,0 x69 ,0 x6 a ,0 x6 b ,0 x6 c ,0 x6 d ,0 x6 e ,0 x6 f
2006-09-28 18:56:37 +04:00
.byte 0 x7 0 ,0 x71 ,0 x72 ,0 x73 ,0 x74 ,0 x75 ,0 x76 ,0 x77
2005-04-17 02:20:36 +04:00
.byte 0 x7 8 ,0 x79 ,0 x7 a ,0 x7 b ,0 x7 c ,0 x7 d ,0 x7 e ,0 x7 f
2006-09-28 18:56:37 +04:00
.byte 0 x8 0 ,0 x81 ,0 x82 ,0 x83 ,0 x84 ,0 x85 ,0 x86 ,0 x87
2005-04-17 02:20:36 +04:00
.byte 0 x8 8 ,0 x89 ,0 x8 a ,0 x8 b ,0 x8 c ,0 x8 d ,0 x8 e ,0 x8 f
2006-09-28 18:56:37 +04:00
.byte 0 x9 0 ,0 x91 ,0 x92 ,0 x93 ,0 x94 ,0 x95 ,0 x96 ,0 x97
2005-04-17 02:20:36 +04:00
.byte 0 x9 8 ,0 x99 ,0 x9 a ,0 x9 b ,0 x9 c ,0 x9 d ,0 x9 e ,0 x9 f
2006-09-28 18:56:37 +04:00
.byte 0 xa0 ,0 x a1 ,0 x a2 ,0 x a3 ,0 x a4 ,0 x a5 ,0 x a6 ,0 x a7
2005-04-17 02:20:36 +04:00
.byte 0 xa8 ,0 x a9 ,0 x a a ,0 x a b ,0 x a c ,0 x a d ,0 x a e ,0 x a f
2006-09-28 18:56:37 +04:00
.byte 0 xb0 ,0 x b1 ,0 x b2 ,0 x b3 ,0 x b4 ,0 x b5 ,0 x b6 ,0 x b7
2005-04-17 02:20:36 +04:00
.byte 0 xb8 ,0 x b9 ,0 x b a ,0 x b b ,0 x b c ,0 x b d ,0 x b e ,0 x b f
2006-09-28 18:56:37 +04:00
.byte 0 xc0 ,0 x81 ,0 x82 ,0 x83 ,0 x84 ,0 x85 ,0 x86 ,0 x87 # . a b c d e f g
2005-04-17 02:20:36 +04:00
.byte 0 x8 8 ,0 x89 ,0 x c a ,0 x c b ,0 x c c ,0 x c d ,0 x c e ,0 x c f # h i
2006-09-28 18:56:37 +04:00
.byte 0 xd0 ,0 x91 ,0 x92 ,0 x93 ,0 x94 ,0 x95 ,0 x96 ,0 x97 # . j k l m n o p
2005-04-17 02:20:36 +04:00
.byte 0 x9 8 ,0 x99 ,0 x d a ,0 x d b ,0 x d c ,0 x d d ,0 x d e ,0 x d f # q r
.byte 0 xe0 ,0 x e 1 ,0 x a2 ,0 x a3 ,0 x a4 ,0 x a5 ,0 x a6 ,0 x a7 # . . s t u v w x
.byte 0 xa8 ,0 x a9 ,0 x e a ,0 x e b ,0 x e c ,0 x e d ,0 x e e ,0 x e f # y z
2006-09-28 18:56:37 +04:00
.byte 0 xf0 ,0 x f1 ,0 x f2 ,0 x f3 ,0 x f4 ,0 x f5 ,0 x f6 ,0 x f7
2005-04-17 02:20:36 +04:00
.byte 0 xf8 ,0 x f9 ,0 x f a ,0 x f b ,0 x f c ,0 x f d ,0 x f e ,0 x f f
2008-12-25 15:39:19 +03:00
#
# startup- c o d e a t 0 x10 0 0 0 , r u n n i n g i n a b s o l u t e a d d r e s s i n g m o d e
# this i s c a l l e d e i t h e r b y t h e i p l l o a d e r o r d i r e c t l y b y P S W r e s t a r t
# or l i n l o a d o r S A L I P L
#
.org 0x10000
2011-07-24 12:48:19 +04:00
ENTRY( s t a r t u p )
2011-10-30 18:16:40 +04:00
j . L e p _ s t a r t u p _ n o r m a l
.org 0x10008
#
# This i s a l i s t o f s39 0 k e r n e l e n t r y p o i n t s . A t a d d r e s s 0 x10 0 0 f t h e n u m b e r o f
# valid e n t r y p o i n t s i s s t o r e d .
#
# IMPORTANT : Do n o t c h a n g e t h i s t a b l e , i t i s s39 0 k e r n e l A B I !
#
.ascii " S3 9 0 E P "
.byte 0 x0 0 ,0 x01
#
# kdump s t a r t u p - c o d e a t 0 x10 0 1 0 , r u n n i n g i n 6 4 b i t a b s o l u t e a d d r e s s i n g m o d e
#
.org 0x10010
ENTRY( s t a r t u p _ k d u m p )
j . L e p _ s t a r t u p _ k d u m p
.Lep_startup_normal :
2012-08-23 18:18:09 +04:00
# ifdef C O N F I G _ 6 4 B I T
mvi _ _ L C _ A R _ M O D E _ I D ,1 # s e t e s a m e f l a g
slr % r0 ,% r0 # s e t c p u i d t o z e r o
lhi % r1 ,2 # m o d e 2 = e s a m e ( d u m p )
sigp % r1 ,% r0 ,0 x12 # s w i t c h t o e s a m e m o d e
bras % r13 ,0 f
.fill 1 6 , 4 , 0 x0
0 : lmh % r0 ,% r15 ,0 ( % r13 ) # c l e a r h i g h - o r d e r h a l f o f g p r s
sam3 1 # s w i t c h t o 31 b i t a d d r e s s i n g m o d e
# else
mvi _ _ L C _ A R _ M O D E _ I D ,0 # s e t E S A f l a g ( m o d e 0 )
# endif
2010-02-27 00:37:53 +03:00
basr % r13 ,0 # g e t b a s e
2008-12-25 15:39:19 +03:00
.LPG0 :
2009-03-26 17:24:44 +03:00
xc 0 x20 0 ( 2 5 6 ) ,0 x20 0 # p a r t i a l l y c l e a r l o w c o r e
xc 0 x30 0 ( 2 5 6 ) ,0 x30 0
2011-10-30 18:16:40 +04:00
xc 0 x e 0 0 ( 2 5 6 ) ,0 x e 0 0
2010-02-27 00:37:53 +03:00
stck _ _ L C _ L A S T _ U P D A T E _ C L O C K
2012-11-13 12:26:37 +04:00
spt 6 f - . L P G 0 ( % r13 )
mvc _ _ L C _ L A S T _ U P D A T E _ T I M E R ( 8 ) ,6 f - . L P G 0 ( % r13 )
[S390] Fix stfle() lowcore protection problem
The stfle() function writes into lowcore memory when stfl_fac_list
is initialized with "S390_lowcore.stfl_fac_list = 0". For older
compilers this triggers a lowcore exception. With newer compilers
and "-OXX" compile option the bug does not show up because
the "S390_lowcore.stfl_fac_list" initialization is removed by the
compiler. The reason for thatis the incorrect "=m"
(S390_lowcore.stfl_fac_list) constraint in the stfl inline assembly.
The following shows the disassembly of the stfle() optimized code
that is inlined in the lgr_info_get() function:
000000000011325c <lgr_info_get>:
11325c: eb 9f f0 60 00 24 stmg %r9,%r15,96(%r15)
113262: c0 d0 00 29 0e 47 larl %r13,634ef0 <servi..>
113268: a7 f1 3f c0 tml %r15,16320
11326c: b9 04 00 ef lgr %r14,%r15
113270: a7 84 00 01 je 113272 <lgr_info_g..>
113274: a7 fb ff c0 aghi %r15,-64
113278: b9 04 00 c2 lgr %r12,%r2
11327c: a7 29 00 01 lghi %r2,1
113280: e3 e0 f0 98 00 24 stg %r14,152(%r15)
113286: d7 97 c0 00 c0 00 xc 0(152,%r12),0(%r12)
11328c: c0 e5 00 28 db 4c brasl %r14,62e924 <add_e..>
113292: b2 b1 00 00 stfl 0
To fix the problem we now clear the S390_lowcore.stfl_fac_list at
startup in "head.S" for all machine types before lowcore protection
is enabled.
In addition to that the "=m" constraint is replaced by "+m".
Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2012-04-11 16:28:11 +04:00
xc _ _ L C _ S T F L _ F A C _ L I S T ( 8 ) ,_ _ L C _ S T F L _ F A C _ L I S T
2008-12-25 15:39:19 +03:00
# ifndef C O N F I G _ M A R C H _ G 5
2009-06-12 12:26:23 +04:00
# check c a p a b i l i t i e s a g a i n s t M A R C H _ { G 5 ,Z 9 0 0 ,Z 9 9 0 ,Z 9 _ 1 0 9 ,Z 1 0 }
2011-04-04 11:43:33 +04:00
.insn s,0 x b2 b10 0 0 0 ,_ _ L C _ S T F L _ F A C _ L I S T # s t o r e f a c i l i t y l i s t
2009-06-12 12:26:23 +04:00
tm _ _ L C _ S T F L _ F A C _ L I S T ,0 x01 # s t f l e a v a i l a b l e ?
jz 0 f
2012-11-13 12:26:37 +04:00
la % r0 ,1
2009-06-12 12:26:23 +04:00
.insn s,0 x b2 b00 0 0 0 ,_ _ L C _ S T F L _ F A C _ L I S T # s t o r e f a c i l i t y l i s t e x t e n d e d
2012-11-13 12:26:37 +04:00
# verify i f a l l r e q u i r e d f a c i l i t i e s a r e s u p p o r t e d b y t h e m a c h i n e
0 : la % r1 ,_ _ L C _ S T F L _ F A C _ L I S T
la % r2 ,3 f + 8 - . L P G 0 ( % r13 )
l % r3 ,0 ( % r2 )
1 : l % r0 ,0 ( % r1 )
n % r0 ,4 ( % r2 )
cl % r0 ,4 ( % r2 )
jne 2 f
la % r1 ,4 ( % r1 )
la % r2 ,4 ( % r2 )
ahi % r3 ,- 1
jnz 1 b
j 4 f
2 : l % r15 ,. L s t a c k - . L P G 0 ( % r13 )
2009-06-12 12:26:24 +04:00
ahi % r15 ,- 9 6
la % r2 ,. L a l s _ s t r i n g - . L P G 0 ( % r13 )
l % r3 ,. L s c l p _ p r i n t - . L P G 0 ( % r13 )
basr % r14 ,% r3
2012-11-13 12:26:37 +04:00
lpsw 3 f - . L P G 0 ( % r13 ) # m a c h i n e t y p e n o t g o o d e n o u g h , c r a s h
2009-06-12 12:26:24 +04:00
.Lals_string :
.asciz " The L i n u x k e r n e l r e q u i r e s m o r e r e c e n t p r o c e s s o r h a r d w a r e "
.Lsclp_print :
.long _sclp_print_early
.Lstack :
2010-02-27 00:37:53 +03:00
.long 0x8000 + ( 1 < < ( PAGE_ S H I F T + T H R E A D _ O R D E R ) )
2008-12-25 15:39:19 +03:00
.align 16
2012-11-13 12:26:37 +04:00
3 : .long 0x000a0000 , 0 x8 b a d c c c c
# List o f f a c i l i t i e s t h a t a r e r e q u i r e d . I f n o t a l l f a c i l i t i e s a r e p r e s e n t
# the k e r n e l w i l l c r a s h . F o r m a t i s n u m b e r o f f a c i l i t y w o r d s w i t h b i t s s e t ,
# followed b y t h e f a c i l i t y w o r d s .
2009-06-12 12:26:23 +04:00
# if d e f i n e d ( C O N F I G _ 6 4 B I T )
2012-11-13 12:26:37 +04:00
# if d e f i n e d ( C O N F I G _ M A R C H _ Z E C 1 2 )
2013-09-17 11:48:44 +04:00
.long 3 , 0 xc1 0 0 e f e 3 , 0 x f46 c e 8 0 0 , 0 x00 4 0 0 0 0 0
2012-11-13 12:26:37 +04:00
# elif d e f i n e d ( C O N F I G _ M A R C H _ Z 1 9 6 )
.long 2 , 0 xc1 0 0 e f e 3 , 0 x f46 c00 0 0
2010-10-25 18:10:17 +04:00
# elif d e f i n e d ( C O N F I G _ M A R C H _ Z 1 0 )
2012-11-13 12:26:37 +04:00
.long 2 , 0 xc1 0 0 e f e 3 , 0 x f06 8 0 0 0 0
2009-06-12 12:26:23 +04:00
# elif d e f i n e d ( C O N F I G _ M A R C H _ Z 9 _ 1 0 9 )
2012-11-13 12:26:37 +04:00
.long 1 , 0 xc1 0 0 e f c3
2009-06-12 12:26:23 +04:00
# elif d e f i n e d ( C O N F I G _ M A R C H _ Z 9 9 0 )
2012-11-13 12:26:37 +04:00
.long 1 , 0 xc0 0 0 2 0 0 0
2009-06-12 12:26:23 +04:00
# elif d e f i n e d ( C O N F I G _ M A R C H _ Z 9 0 0 )
2012-11-13 12:26:37 +04:00
.long 1 , 0 xc0 0 0 0 0 0 0
2009-06-12 12:26:23 +04:00
# endif
# else
2012-11-13 12:26:37 +04:00
# if d e f i n e d ( C O N F I G _ M A R C H _ Z E C 1 2 )
.long 1 , 0 x8 1 0 0 c88 0
# elif d e f i n e d ( C O N F I G _ M A R C H _ Z 1 9 6 )
.long 1 , 0 x8 1 0 0 c88 0
2010-10-25 18:10:17 +04:00
# elif d e f i n e d ( C O N F I G _ M A R C H _ Z 1 0 )
2012-11-13 12:26:37 +04:00
.long 1 , 0 x8 1 0 0 c88 0
2008-12-25 15:39:19 +03:00
# elif d e f i n e d ( C O N F I G _ M A R C H _ Z 9 _ 1 0 9 )
2012-11-13 12:26:37 +04:00
.long 1 , 0 x8 1 0 0 c88 0
2008-12-25 15:39:19 +03:00
# elif d e f i n e d ( C O N F I G _ M A R C H _ Z 9 9 0 )
2012-11-13 12:26:37 +04:00
.long 1 , 0 x8 0 0 0 2 0 0 0
2008-12-25 15:39:19 +03:00
# elif d e f i n e d ( C O N F I G _ M A R C H _ Z 9 0 0 )
2012-11-13 12:26:37 +04:00
.long 1 , 0 x8 0 0 0 0 0 0 0
2009-06-12 12:26:23 +04:00
# endif
2008-12-25 15:39:19 +03:00
# endif
2012-11-13 12:26:37 +04:00
4 :
2008-12-25 15:39:19 +03:00
# endif
2010-02-27 00:37:53 +03:00
# ifdef C O N F I G _ 6 4 B I T
2012-08-23 18:18:09 +04:00
/* Continue with 64bit startup code in head64.S */
2010-02-27 00:37:53 +03:00
sam6 4 # s w i t c h t o 64 b i t m o d e
jg s t a r t u p _ c o n t i n u e
# else
2012-08-23 18:18:09 +04:00
/* Continue with 31bit startup code in head31.S */
2012-11-13 12:26:37 +04:00
l % r13 ,5 f - . L P G 0 ( % r13 )
2008-12-25 15:39:19 +03:00
b 0 ( % r13 )
2010-02-27 00:37:53 +03:00
.align 8
2012-11-13 12:26:37 +04:00
5 : .long s t a r t u p _ c o n t i n u e
2010-02-27 00:37:53 +03:00
# endif
2012-08-23 18:18:09 +04:00
2009-04-14 17:36:29 +04:00
.align 8
2012-11-13 12:26:37 +04:00
6 : .long 0x7fffffff , 0 xffffffff
2008-12-25 15:39:19 +03:00
2011-10-30 18:16:40 +04:00
# include " h e a d _ k d u m p . S "
2008-12-25 15:39:19 +03:00
#
# params a t 1 0 4 0 0 ( s e t u p . h )
#
.org PARMAREA
.long 0 , 0 # IPL_ D E V I C E
.long 0 , 0 # INITRD_ S T A R T
.long 0 , 0 # INITRD_ S I Z E
2011-10-30 18:16:40 +04:00
.long 0 , 0 # OLDMEM_ B A S E
.long 0 , 0 # OLDMEM_ S I Z E
2008-12-25 15:39:19 +03:00
.org COMMAND_LINE
.byte " root= / d e v / r a m 0 r o "
.byte 0
2010-02-27 00:37:53 +03:00
.org 0x11000