2007-05-18 14:25:31 +04:00
/ *
* linux/ a r c h / a r m / m m / t l b - v7 . S
*
* Copyright ( C ) 1 9 9 7 - 2 0 0 2 R u s s e l l K i n g
* Modified f o r A R M v7 b y C a t a l i n M a r i n a s
*
* 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 .
*
* ARM a r c h i t e c t u r e v e r s i o n 6 T L B h a n d l i n g f u n c t i o n s .
* These a s s u m e a s p l i t I / D T L B .
* /
2009-04-27 22:02:22 +04:00
# include < l i n u x / i n i t . h >
2007-05-18 14:25:31 +04:00
# include < l i n u x / l i n k a g e . h >
2010-09-04 13:47:48 +04:00
# include < a s m / a s s e m b l e r . h >
2007-05-18 14:25:31 +04:00
# include < a s m / a s m - o f f s e t s . h >
# include < a s m / p a g e . h >
# include < a s m / t l b f l u s h . h >
# include " p r o c - m a c r o s . S "
/ *
* v7 w b i _ f l u s h _ u s e r _ t l b _ r a n g e ( s t a r t , e n d , v m a )
*
* Invalidate a r a n g e o f T L B e n t r i e s i n t h e s p e c i f i e d a d d r e s s s p a c e .
*
* - start - s t a r t a d d r e s s ( m a y n o t b e a l i g n e d )
* - end - e n d a d d r e s s ( e x c l u s i v e , m a y n o t b e a l i g n e d )
* - vma - v m a _ s t r u c t d e s c r i b i n g a d d r e s s r a n g e
*
* It i s a s s u m e d t h a t :
* - the " I n v a l i d a t e s i n g l e e n t r y " i n s t r u c t i o n w i l l i n v a l i d a t e
* both t h e I a n d t h e D T L B s o n H a r v a r d - s t y l e T L B s
* /
ENTRY( v7 w b i _ f l u s h _ u s e r _ t l b _ r a n g e )
vma_ v m _ m m r3 , r2 @ get vma->vm_mm
mmid r3 , r3 @ get vm_mm->context.id
2013-05-13 15:01:12 +04:00
dsb i s h
2007-05-18 14:25:31 +04:00
mov r0 , r0 , l s r #P A G E _ S H I F T @ a l i g n a d d r e s s
mov r1 , r1 , l s r #P A G E _ S H I F T
asid r3 , r3 @ mask ASID
2012-08-10 22:13:36 +04:00
# ifdef C O N F I G _ A R M _ E R R A T A _ 7 2 0 7 8 9
ALT_ S M P ( W ( m o v ) r3 , #0 )
ALT_ U P ( W ( n o p ) )
2012-07-20 21:24:55 +04:00
# endif
2007-05-18 14:25:31 +04:00
orr r0 , r3 , r0 , l s l #P A G E _ S H I F T @ C r e a t e i n i t i a l M V A
mov r1 , r1 , l s l #P A G E _ S H I F T
1 :
2012-07-20 21:24:55 +04:00
# ifdef C O N F I G _ A R M _ E R R A T A _ 7 2 0 7 8 9
ALT_ S M P ( m c r p15 , 0 , r0 , c8 , c3 , 3 ) @ TLB invalidate U MVA all ASID (shareable)
# else
2010-09-04 13:47:48 +04:00
ALT_ S M P ( m c r p15 , 0 , r0 , c8 , c3 , 1 ) @ TLB invalidate U MVA (shareable)
2012-07-20 21:24:55 +04:00
# endif
2010-09-04 13:47:48 +04:00
ALT_ U P ( m c r p15 , 0 , r0 , c8 , c7 , 1 ) @ TLB invalidate U MVA
2007-05-18 14:25:31 +04:00
add r0 , r0 , #P A G E _ S Z
cmp r0 , r1
blo 1 b
2013-05-13 15:01:12 +04:00
dsb i s h
2014-06-30 19:29:12 +04:00
ret l r
2008-08-28 14:22:32 +04:00
ENDPROC( v7 w b i _ f l u s h _ u s e r _ t l b _ r a n g e )
2007-05-18 14:25:31 +04:00
/ *
* v7 w b i _ f l u s h _ k e r n _ t l b _ r a n g e ( s t a r t ,e n d )
*
* Invalidate a r a n g e o f k e r n e l T L B e n t r i e s
*
* - start - s t a r t a d d r e s s ( m a y n o t b e a l i g n e d )
* - end - e n d a d d r e s s ( e x c l u s i v e , m a y n o t b e a l i g n e d )
* /
ENTRY( v7 w b i _ f l u s h _ k e r n _ t l b _ r a n g e )
2013-05-13 15:01:12 +04:00
dsb i s h
2007-05-18 14:25:31 +04:00
mov r0 , r0 , l s r #P A G E _ S H I F T @ a l i g n a d d r e s s
mov r1 , r1 , l s r #P A G E _ S H I F T
mov r0 , r0 , l s l #P A G E _ S H I F T
mov r1 , r1 , l s l #P A G E _ S H I F T
1 :
2012-07-20 21:24:55 +04:00
# ifdef C O N F I G _ A R M _ E R R A T A _ 7 2 0 7 8 9
ALT_ S M P ( m c r p15 , 0 , r0 , c8 , c3 , 3 ) @ TLB invalidate U MVA all ASID (shareable)
# else
2010-09-04 13:47:48 +04:00
ALT_ S M P ( m c r p15 , 0 , r0 , c8 , c3 , 1 ) @ TLB invalidate U MVA (shareable)
2012-07-20 21:24:55 +04:00
# endif
2010-09-04 13:47:48 +04:00
ALT_ U P ( m c r p15 , 0 , r0 , c8 , c7 , 1 ) @ TLB invalidate U MVA
2007-05-18 14:25:31 +04:00
add r0 , r0 , #P A G E _ S Z
cmp r0 , r1
blo 1 b
2013-05-13 15:01:12 +04:00
dsb i s h
2007-05-18 14:25:31 +04:00
isb
2014-06-30 19:29:12 +04:00
ret l r
2008-08-28 14:22:32 +04:00
ENDPROC( v7 w b i _ f l u s h _ k e r n _ t l b _ r a n g e )
2007-05-18 14:25:31 +04:00
2009-04-27 22:02:22 +04:00
_ _ INIT
2007-05-18 14:25:31 +04:00
2011-06-23 20:31:16 +04:00
/* define struct cpu_tlb_fns (see <asm/tlbflush.h> and proc-macros.S) */
define_ t l b _ f u n c t i o n s v7 w b i , v7 w b i _ t l b _ f l a g s _ u p , f l a g s _ s m p =v7wbi_tlb_flags_smp