2018-01-03 14:17:58 +03:00
/ *
* Contains C P U s p e c i f i c b r a n c h p r e d i c t o r i n v a l i d a t i o n s e q u e n c e s
*
* Copyright ( C ) 2 0 1 8 A R M L t d .
*
* This p r o g r a m i s f r e e s o f t w a r e ; you can redistribute it and/or modify
* it u n d e r t h e t e r m s o f t h e G N U G e n e r a l P u b l i c L i c e n s e v e r s i o n 2 a s
* published b y t h e F r e e S o f t w a r e F o u n d a t i o n .
*
* This p r o g r a m i s d i s t r i b u t e d i n t h e h o p e t h a t i t w i l l b e u s e f u l ,
* but W I T H O U T A N Y W A R R A N T Y ; without even the implied warranty of
* MERCHANTABILITY o r F I T N E S S F O R A P A R T I C U L A R P U R P O S E . S e e t h e
* GNU G e n e r a l P u b l i c L i c e n s e f o r m o r e d e t a i l s .
*
* You s h o u l d h a v e r e c e i v e d a c o p y o f t h e G N U G e n e r a l P u b l i c L i c e n s e
* along w i t h t h i s p r o g r a m . I f n o t , s e e < h t t p : / / w w w . g n u . o r g / l i c e n s e s / > .
* /
# include < l i n u x / l i n k a g e . h >
.macro ventry target
.rept 31
nop
.endr
b \ t a r g e t
.endm
.macro vectors target
ventry \ t a r g e t + 0 x00 0
ventry \ t a r g e t + 0 x08 0
ventry \ t a r g e t + 0 x10 0
ventry \ t a r g e t + 0 x18 0
ventry \ t a r g e t + 0 x20 0
ventry \ t a r g e t + 0 x28 0
ventry \ t a r g e t + 0 x30 0
ventry \ t a r g e t + 0 x38 0
ventry \ t a r g e t + 0 x40 0
ventry \ t a r g e t + 0 x48 0
ventry \ t a r g e t + 0 x50 0
ventry \ t a r g e t + 0 x58 0
ventry \ t a r g e t + 0 x60 0
ventry \ t a r g e t + 0 x68 0
ventry \ t a r g e t + 0 x70 0
ventry \ t a r g e t + 0 x78 0
.endm
.align 11
ENTRY( _ _ b p _ h a r d e n _ h y p _ v e c s _ s t a r t )
.rept 4
vectors _ _ k v m _ h y p _ v e c t o r
.endr
ENTRY( _ _ b p _ h a r d e n _ h y p _ v e c s _ e n d )
2018-01-03 15:46:21 +03:00
ENTRY( _ _ p s c i _ h y p _ b p _ i n v a l _ s t a r t )
sub s p , s p , #( 8 * 1 8 )
stp x16 , x17 , [ s p , #( 16 * 0 ) ]
stp x14 , x15 , [ s p , #( 16 * 1 ) ]
stp x12 , x13 , [ s p , #( 16 * 2 ) ]
stp x10 , x11 , [ s p , #( 16 * 3 ) ]
stp x8 , x9 , [ s p , #( 16 * 4 ) ]
stp x6 , x7 , [ s p , #( 16 * 5 ) ]
stp x4 , x5 , [ s p , #( 16 * 6 ) ]
stp x2 , x3 , [ s p , #( 16 * 7 ) ]
stp x0 , x1 , [ s p , #( 16 * 8 ) ]
mov x0 , #0x84000000
smc #0
ldp x16 , x17 , [ s p , #( 16 * 0 ) ]
ldp x14 , x15 , [ s p , #( 16 * 1 ) ]
ldp x12 , x13 , [ s p , #( 16 * 2 ) ]
ldp x10 , x11 , [ s p , #( 16 * 3 ) ]
ldp x8 , x9 , [ s p , #( 16 * 4 ) ]
ldp x6 , x7 , [ s p , #( 16 * 5 ) ]
ldp x4 , x5 , [ s p , #( 16 * 6 ) ]
ldp x2 , x3 , [ s p , #( 16 * 7 ) ]
ldp x0 , x1 , [ s p , #( 16 * 8 ) ]
add s p , s p , #( 8 * 1 8 )
ENTRY( _ _ p s c i _ h y p _ b p _ i n v a l _ e n d )
2018-01-05 23:28:59 +03:00
ENTRY( _ _ q c o m _ h y p _ s a n i t i z e _ l i n k _ s t a c k _ s t a r t )
stp x29 , x30 , [ s p , #- 16 ] !
.rept 16
bl . + 4
.endr
ldp x29 , x30 , [ s p ] , #16
ENTRY( _ _ q c o m _ h y p _ s a n i t i z e _ l i n k _ s t a c k _ e n d )