2005-09-22 05:50:51 +04:00
/ * arch/ s p a r c64 / k e r n e l / k t l b . S : K e r n e l m a p p i n g T L B m i s s h a n d l i n g .
*
2008-01-11 08:10:54 +03:00
* Copyright ( C ) 1 9 9 5 , 1 9 9 7 , 2 0 0 5 , 2 0 0 8 D a v i d S . M i l l e r < d a v e m @davemloft.net>
2005-09-22 05:50:51 +04:00
* Copyright ( C ) 1 9 9 6 E d d i e C . D o s t ( e c d @brainaid.de)
* Copyright ( C ) 1 9 9 6 M i g u e l d e I c a z a ( m i g u e l @nuclecu.unam.mx)
* Copyright ( C ) 1 9 9 6 ,9 8 ,9 9 J a k u b J e l i n e k ( j j @sunsite.mff.cuni.cz)
2006-02-01 05:29:18 +03:00
* /
2005-09-22 05:50:51 +04:00
# include < a s m / h e a d . h >
# include < a s m / a s i . h >
# include < a s m / p a g e . h >
# include < a s m / p g t a b l e . h >
2006-02-01 05:29:18 +03:00
# include < a s m / t s b . h >
2005-09-22 05:50:51 +04:00
.text
.align 32
2006-02-01 05:29:18 +03:00
kvmap_itlb :
/* g6: TAG TARGET */
mov T L B _ T A G _ A C C E S S , % g 4
ldxa [ % g 4 ] A S I _ I M M U , % g 4
2006-02-07 10:44:37 +03:00
/ * sun4 v _ i t l b _ m i s s b r a n c h e s h e r e w i t h t h e m i s s i n g v i r t u a l
* address a l r e a d y l o a d e d i n t o % g 4
* /
kvmap_itlb_4v :
2006-02-01 05:29:18 +03:00
/* Catch kernel NULL pointer calls. */
sethi % h i ( P A G E _ S I Z E ) , % g 5
cmp % g 4 , % g 5
2013-08-02 19:23:18 +04:00
blu,p n % x c c , k v m a p _ i t l b _ l o n g p a t h
2006-02-01 05:29:18 +03:00
nop
KERN_ T S B _ L O O K U P _ T L 1 ( % g 4 , % g 6 , % g 5 , % g 1 , % g 2 , % g 3 , k v m a p _ i t l b _ l o a d )
kvmap_itlb_tsb_miss :
2005-09-22 05:50:51 +04:00
sethi % h i ( L O W _ O B P _ A D D R E S S ) , % g 5
cmp % g 4 , % g 5
2006-02-01 05:29:18 +03:00
blu,p n % x c c , k v m a p _ i t l b _ v m a l l o c _ a d d r
2005-09-22 05:50:51 +04:00
mov 0 x1 , % g 5
sllx % g 5 , 3 2 , % g 5
cmp % g 4 , % g 5
2006-02-01 05:29:18 +03:00
blu,p n % x c c , k v m a p _ i t l b _ o b p
2005-09-22 05:50:51 +04:00
nop
2006-02-01 05:29:18 +03:00
kvmap_itlb_vmalloc_addr :
KERN_ P G T A B L E _ W A L K ( % g 4 , % g 5 , % g 2 , k v m a p _ i t l b _ l o n g p a t h )
2011-08-05 11:53:57 +04:00
TSB_ L O C K _ T A G ( % g 1 , % g 2 , % g 7 )
2006-02-01 05:29:18 +03:00
/* Load and check PTE. */
ldxa [ % g 5 ] A S I _ P H Y S _ U S E _ E C , % g 5
2006-02-18 05:01:02 +03:00
mov 1 , % g 7
sllx % g 7 , T S B _ T A G _ I N V A L I D _ B I T , % g 7
2006-02-01 05:29:18 +03:00
brgez,a ,p n % g 5 , k v m a p _ i t l b _ l o n g p a t h
2011-08-05 11:53:57 +04:00
TSB_ S T O R E ( % g 1 , % g 7 )
2005-09-22 05:50:51 +04:00
2011-08-05 11:53:57 +04:00
TSB_ W R I T E ( % g 1 , % g 5 , % g 6 )
2006-02-01 05:29:18 +03:00
/* fallthrough to TLB load */
kvmap_itlb_load :
2006-02-11 23:21:20 +03:00
661 : stxa % g 5 , [ % g 0 ] A S I _ I T L B _ D A T A _ I N
2005-09-22 05:50:51 +04:00
retry
2006-02-11 23:21:20 +03:00
.section .sun4v_2insn_patch , " ax"
.word 661b
nop
nop
.previous
/ * For s u n 4 v t h e A S I _ I T L B _ D A T A _ I N s t o r e a n d t h e r e t r y
* instruction g e t n o p ' d o u t a n d w e g e t h e r e t o b r a n c h
* to t h e s u n 4 v t l b l o a d c o d e . T h e r e g i s t e r s a r e s e t u p
* as f o l l o w s :
*
* % g4 : vaddr
* % g5 : PTE
* % g6 : TAG
*
* The s u n 4 v T L B l o a d w a n t s t h e P T E i n % g 3 s o w e f i x t h a t
* up h e r e .
* /
ba,p t % x c c , s u n 4 v _ i t l b _ l o a d
mov % g 5 , % g 3
2005-09-22 05:50:51 +04:00
2006-02-01 05:29:18 +03:00
kvmap_itlb_longpath :
2006-02-06 09:27:28 +03:00
661 : rdpr % p s t a t e , % g 5
2006-02-01 05:29:18 +03:00
wrpr % g 5 , P S T A T E _ A G | P S T A T E _ M G , % p s t a t e
2006-02-07 11:00:16 +03:00
.section .sun4v_2insn_patch , " ax"
2006-02-06 09:27:28 +03:00
.word 661b
2006-02-19 03:36:39 +03:00
SET_ G L ( 1 )
2006-02-06 09:27:28 +03:00
nop
.previous
2006-02-01 05:29:18 +03:00
rdpr % t p c , % g 5
ba,p t % x c c , s p a r c64 _ r e a l f a u l t _ c o m m o n
mov F A U L T _ C O D E _ I T L B , % g 4
kvmap_itlb_obp :
OBP_ T R A N S _ L O O K U P ( % g 4 , % g 5 , % g 2 , % g 3 , k v m a p _ i t l b _ l o n g p a t h )
2011-08-05 11:53:57 +04:00
TSB_ L O C K _ T A G ( % g 1 , % g 2 , % g 7 )
2006-02-01 05:29:18 +03:00
2011-08-05 11:53:57 +04:00
TSB_ W R I T E ( % g 1 , % g 5 , % g 6 )
2006-02-01 05:29:18 +03:00
ba,p t % x c c , k v m a p _ i t l b _ l o a d
nop
kvmap_dtlb_obp :
OBP_ T R A N S _ L O O K U P ( % g 4 , % g 5 , % g 2 , % g 3 , k v m a p _ d t l b _ l o n g p a t h )
2011-08-05 11:53:57 +04:00
TSB_ L O C K _ T A G ( % g 1 , % g 2 , % g 7 )
2006-02-01 05:29:18 +03:00
2011-08-05 11:53:57 +04:00
TSB_ W R I T E ( % g 1 , % g 5 , % g 6 )
2006-02-01 05:29:18 +03:00
ba,p t % x c c , k v m a p _ d t l b _ l o a d
nop
2005-10-12 23:22:46 +04:00
2005-09-22 05:50:51 +04:00
.align 32
2006-02-22 09:31:11 +03:00
kvmap_dtlb_tsb4m_load :
2011-08-05 11:53:57 +04:00
TSB_ L O C K _ T A G ( % g 1 , % g 2 , % g 7 )
TSB_ W R I T E ( % g 1 , % g 5 , % g 6 )
2006-02-22 09:31:11 +03:00
ba,p t % x c c , k v m a p _ d t l b _ l o a d
nop
2006-02-01 05:29:18 +03:00
kvmap_dtlb :
/* %g6: TAG TARGET */
mov T L B _ T A G _ A C C E S S , % g 4
ldxa [ % g 4 ] A S I _ D M M U , % g 4
2006-02-07 10:44:37 +03:00
/ * sun4 v _ d t l b _ m i s s b r a n c h e s h e r e w i t h t h e m i s s i n g v i r t u a l
* address a l r e a d y l o a d e d i n t o % g 4
* /
kvmap_dtlb_4v :
2006-02-01 05:29:18 +03:00
brgez,p n % g 4 , k v m a p _ d t l b _ n o n l i n e a r
2005-09-26 03:46:57 +04:00
nop
2007-03-17 03:20:28 +03:00
# ifdef C O N F I G _ D E B U G _ P A G E A L L O C
/ * Index t h r o u g h t h e b a s e p a g e s i z e T S B e v e n f o r l i n e a r
* mappings w h e n u s i n g p a g e a l l o c a t i o n d e b u g g i n g .
* /
KERN_ T S B _ L O O K U P _ T L 1 ( % g 4 , % g 6 , % g 5 , % g 1 , % g 2 , % g 3 , k v m a p _ d t l b _ l o a d )
# else
2006-02-22 09:31:11 +03:00
/* Correct TAG_TARGET is already in %g6, check 4mb TSB. */
KERN_ T S B 4 M _ L O O K U P _ T L 1 ( % g 6 , % g 5 , % g 1 , % g 2 , % g 3 , k v m a p _ d t l b _ l o a d )
2007-03-17 03:20:28 +03:00
# endif
2006-02-22 09:31:11 +03:00
/ * TSB e n t r y a d d r e s s l e f t i n % g 1 , l o o k u p l i n e a r P T E .
* Must p r e s e r v e % g 1 a n d % g 6 ( T A G ) .
* /
kvmap_dtlb_tsb4m_miss :
sparc64: Validate linear D-TLB misses.
When page alloc debugging is not enabled, we essentially accept any
virtual address for linear kernel TLB misses. But with kgdb, kernel
address probing, and other facilities we can try to access arbitrary
crap.
So, make sure the address we miss on will translate to physical memory
that actually exists.
In order to make this work we have to embed the valid address bitmap
into the kernel image. And in order to make that less expensive we
make an adjustment, in that the max physical memory address is
decreased to "1 << 41", even on the chips that support a 42-bit
physical address space. We can do this because bit 41 indicates
"I/O space" and thus covers non-memory ranges.
The result of this is that:
1) kpte_linear_bitmap shrinks from 2K to 1K in size
2) we need 64K more for the valid address bitmap
We can't let the valid address bitmap be dynamically allocated
once we start using it to validate TLB misses, otherwise we have
crazy issues to deal with wrt. recursive TLB misses and such.
If we're in a TLB miss it could be the deepest trap level that's legal
inside of the cpu. So if we TLB miss referencing the bitmap, the cpu
will be out of trap levels and enter RED state.
To guard against out-of-range accesses to the bitmap, we have to check
to make sure no bits in the physical address above bit 40 are set. We
could export and use last_valid_pfn for this check, but that's just an
unnecessary extra memory reference.
On the plus side of all this, since we load all of these translations
into the special 4MB mapping TSB, and we check the TSB first for TLB
misses, there should be absolutely no real cost for these new checks
in the TLB miss path.
Reported-by: heyongli@gmail.com
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-26 03:47:46 +04:00
/ * Clear t h e P A G E _ O F F S E T t o p v i r t u a l b i t s , s h i f t
* down t o g e t P F N , a n d m a k e s u r e P F N i s i n r a n g e .
* /
2013-09-21 08:50:41 +04:00
661 : sllx % g 4 , 0 , % g 5
.section .page_offset_shift_patch , " ax"
.word 661b
.previous
2006-02-22 07:51:13 +03:00
sparc64: Validate linear D-TLB misses.
When page alloc debugging is not enabled, we essentially accept any
virtual address for linear kernel TLB misses. But with kgdb, kernel
address probing, and other facilities we can try to access arbitrary
crap.
So, make sure the address we miss on will translate to physical memory
that actually exists.
In order to make this work we have to embed the valid address bitmap
into the kernel image. And in order to make that less expensive we
make an adjustment, in that the max physical memory address is
decreased to "1 << 41", even on the chips that support a 42-bit
physical address space. We can do this because bit 41 indicates
"I/O space" and thus covers non-memory ranges.
The result of this is that:
1) kpte_linear_bitmap shrinks from 2K to 1K in size
2) we need 64K more for the valid address bitmap
We can't let the valid address bitmap be dynamically allocated
once we start using it to validate TLB misses, otherwise we have
crazy issues to deal with wrt. recursive TLB misses and such.
If we're in a TLB miss it could be the deepest trap level that's legal
inside of the cpu. So if we TLB miss referencing the bitmap, the cpu
will be out of trap levels and enter RED state.
To guard against out-of-range accesses to the bitmap, we have to check
to make sure no bits in the physical address above bit 40 are set. We
could export and use last_valid_pfn for this check, but that's just an
unnecessary extra memory reference.
On the plus side of all this, since we load all of these translations
into the special 4MB mapping TSB, and we check the TSB first for TLB
misses, there should be absolutely no real cost for these new checks
in the TLB miss path.
Reported-by: heyongli@gmail.com
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-26 03:47:46 +04:00
/ * Check t o s e e i f w e k n o w a b o u t v a l i d m e m o r y a t t h e 4 M B
* chunk t h i s p h y s i c a l a d d r e s s w i l l r e s i d e w i t h i n .
2006-02-22 07:51:13 +03:00
* /
2013-09-21 08:50:41 +04:00
661 : srlx % g 5 , M A X _ P H Y S _ A D D R E S S _ B I T S , % g 2
.section .page_offset_shift_patch , " ax"
.word 661b
.previous
sparc64: Validate linear D-TLB misses.
When page alloc debugging is not enabled, we essentially accept any
virtual address for linear kernel TLB misses. But with kgdb, kernel
address probing, and other facilities we can try to access arbitrary
crap.
So, make sure the address we miss on will translate to physical memory
that actually exists.
In order to make this work we have to embed the valid address bitmap
into the kernel image. And in order to make that less expensive we
make an adjustment, in that the max physical memory address is
decreased to "1 << 41", even on the chips that support a 42-bit
physical address space. We can do this because bit 41 indicates
"I/O space" and thus covers non-memory ranges.
The result of this is that:
1) kpte_linear_bitmap shrinks from 2K to 1K in size
2) we need 64K more for the valid address bitmap
We can't let the valid address bitmap be dynamically allocated
once we start using it to validate TLB misses, otherwise we have
crazy issues to deal with wrt. recursive TLB misses and such.
If we're in a TLB miss it could be the deepest trap level that's legal
inside of the cpu. So if we TLB miss referencing the bitmap, the cpu
will be out of trap levels and enter RED state.
To guard against out-of-range accesses to the bitmap, we have to check
to make sure no bits in the physical address above bit 40 are set. We
could export and use last_valid_pfn for this check, but that's just an
unnecessary extra memory reference.
On the plus side of all this, since we load all of these translations
into the special 4MB mapping TSB, and we check the TSB first for TLB
misses, there should be absolutely no real cost for these new checks
in the TLB miss path.
Reported-by: heyongli@gmail.com
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-26 03:47:46 +04:00
brnz,p n % g 2 , k v m a p _ d t l b _ l o n g p a t h
nop
/ * This u n c o n d i t i o n a l b r a n c h a n d d e l a y - s l o t n o p g e t s p a t c h e d
* by t h e s e t h i s e q u e n c e o n c e t h e b i t m a p i s p r o p e r l y s e t u p .
* /
.globl valid_addr_bitmap_insn
valid_addr_bitmap_insn :
ba,p t % x c c , 2 f
nop
.subsection 2
.globl valid_addr_bitmap_patch
valid_addr_bitmap_patch :
sethi % h i ( s p a r c64 _ v a l i d _ a d d r _ b i t m a p ) , % g 7
or % g 7 , % l o ( s p a r c64 _ v a l i d _ a d d r _ b i t m a p ) , % g 7
.previous
2013-09-21 08:50:41 +04:00
661 : srlx % g 5 , I L O G 2 _ 4 M B , % g 2
.section .page_offset_shift_patch , " ax"
.word 661b
.previous
sparc64: Validate linear D-TLB misses.
When page alloc debugging is not enabled, we essentially accept any
virtual address for linear kernel TLB misses. But with kgdb, kernel
address probing, and other facilities we can try to access arbitrary
crap.
So, make sure the address we miss on will translate to physical memory
that actually exists.
In order to make this work we have to embed the valid address bitmap
into the kernel image. And in order to make that less expensive we
make an adjustment, in that the max physical memory address is
decreased to "1 << 41", even on the chips that support a 42-bit
physical address space. We can do this because bit 41 indicates
"I/O space" and thus covers non-memory ranges.
The result of this is that:
1) kpte_linear_bitmap shrinks from 2K to 1K in size
2) we need 64K more for the valid address bitmap
We can't let the valid address bitmap be dynamically allocated
once we start using it to validate TLB misses, otherwise we have
crazy issues to deal with wrt. recursive TLB misses and such.
If we're in a TLB miss it could be the deepest trap level that's legal
inside of the cpu. So if we TLB miss referencing the bitmap, the cpu
will be out of trap levels and enter RED state.
To guard against out-of-range accesses to the bitmap, we have to check
to make sure no bits in the physical address above bit 40 are set. We
could export and use last_valid_pfn for this check, but that's just an
unnecessary extra memory reference.
On the plus side of all this, since we load all of these translations
into the special 4MB mapping TSB, and we check the TSB first for TLB
misses, there should be absolutely no real cost for these new checks
in the TLB miss path.
Reported-by: heyongli@gmail.com
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-26 03:47:46 +04:00
srlx % g 2 , 6 , % g 5
and % g 2 , 6 3 , % g 2
sllx % g 5 , 3 , % g 5
ldx [ % g 7 + % g 5 ] , % g 5
mov 1 , % g 7
sllx % g 7 , % g 2 , % g 7
andcc % g 5 , % g 7 , % g 0
be,p n % x c c , k v m a p _ d t l b _ l o n g p a t h
2 : sethi % h i ( k p t e _ l i n e a r _ b i t m a p ) , % g 2
/* Get the 256MB physical address index. */
2013-09-21 08:50:41 +04:00
661 : sllx % g 4 , 0 , % g 5
.section .page_offset_shift_patch , " ax"
.word 661b
.previous
2012-09-07 05:13:58 +04:00
or % g 2 , % l o ( k p t e _ l i n e a r _ b i t m a p ) , % g 2
2013-09-21 08:50:41 +04:00
661 : srlx % g 5 , I L O G 2 _ 2 5 6 M B , % g 5
.section .page_offset_shift_patch , " ax"
.word 661b
.previous
2012-09-07 05:13:58 +04:00
and % g 5 , ( 3 2 - 1 ) , % g 7
2006-02-22 07:51:13 +03:00
2012-09-07 05:13:58 +04:00
/* Divide by 32 to get the offset into the bitmask. */
srlx % g 5 , 5 , % g 5
add % g 7 , % g 7 , % g 7
2006-02-27 10:09:37 +03:00
sllx % g 5 , 3 , % g 5
2006-02-22 07:51:13 +03:00
2012-09-07 05:13:58 +04:00
/* kern_linear_pte_xor[(mask >> shift) & 3)] */
2006-02-22 07:51:13 +03:00
ldx [ % g 2 + % g 5 ] , % g 2
2012-09-07 05:13:58 +04:00
srlx % g 2 , % g 7 , % g 7
2006-02-22 07:51:13 +03:00
sethi % h i ( k e r n _ l i n e a r _ p t e _ x o r ) , % g 5
2012-09-07 05:13:58 +04:00
and % g 7 , 3 , % g 7
2006-02-22 07:51:13 +03:00
or % g 5 , % l o ( k e r n _ l i n e a r _ p t e _ x o r ) , % g 5
2012-09-07 05:13:58 +04:00
sllx % g 7 , 3 , % g 7
ldx [ % g 5 + % g 7 ] , % g 2
2006-02-01 05:29:18 +03:00
2005-09-26 03:46:57 +04:00
.globl kvmap_linear_patch
kvmap_linear_patch :
2006-02-22 09:31:11 +03:00
ba,p t % x c c , k v m a p _ d t l b _ t s b4 m _ l o a d
2005-09-22 05:50:51 +04:00
xor % g 2 , % g 4 , % g 5
2006-02-01 05:29:18 +03:00
kvmap_dtlb_vmalloc_addr :
KERN_ P G T A B L E _ W A L K ( % g 4 , % g 5 , % g 2 , k v m a p _ d t l b _ l o n g p a t h )
2011-08-05 11:53:57 +04:00
TSB_ L O C K _ T A G ( % g 1 , % g 2 , % g 7 )
2006-02-01 05:29:18 +03:00
/* Load and check PTE. */
ldxa [ % g 5 ] A S I _ P H Y S _ U S E _ E C , % g 5
2006-02-18 05:01:02 +03:00
mov 1 , % g 7
sllx % g 7 , T S B _ T A G _ I N V A L I D _ B I T , % g 7
2006-02-01 05:29:18 +03:00
brgez,a ,p n % g 5 , k v m a p _ d t l b _ l o n g p a t h
2011-08-05 11:53:57 +04:00
TSB_ S T O R E ( % g 1 , % g 7 )
2006-02-01 05:29:18 +03:00
2011-08-05 11:53:57 +04:00
TSB_ W R I T E ( % g 1 , % g 5 , % g 6 )
2006-02-01 05:29:18 +03:00
/* fallthrough to TLB load */
kvmap_dtlb_load :
2006-02-11 23:21:20 +03:00
661 : stxa % g 5 , [ % g 0 ] A S I _ D T L B _ D A T A _ I N ! R e l o a d T L B
2006-02-01 05:29:18 +03:00
retry
2006-02-11 23:21:20 +03:00
.section .sun4v_2insn_patch , " ax"
.word 661b
nop
nop
.previous
/ * For s u n 4 v t h e A S I _ D T L B _ D A T A _ I N s t o r e a n d t h e r e t r y
* instruction g e t n o p ' d o u t a n d w e g e t h e r e t o b r a n c h
* to t h e s u n 4 v t l b l o a d c o d e . T h e r e g i s t e r s a r e s e t u p
* as f o l l o w s :
*
* % g4 : vaddr
* % g5 : PTE
* % g6 : TAG
*
* The s u n 4 v T L B l o a d w a n t s t h e P T E i n % g 3 s o w e f i x t h a t
* up h e r e .
* /
ba,p t % x c c , s u n 4 v _ d t l b _ l o a d
mov % g 5 , % g 3
2006-02-01 05:29:18 +03:00
2008-01-11 08:10:54 +03:00
# ifdef C O N F I G _ S P A R S E M E M _ V M E M M A P
2007-10-16 12:24:16 +04:00
kvmap_vmemmap :
sub % g 4 , % g 5 , % g 5
srlx % g 5 , 2 2 , % g 5
sethi % h i ( v m e m m a p _ t a b l e ) , % g 1
sllx % g 5 , 3 , % g 5
or % g 1 , % l o ( v m e m m a p _ t a b l e ) , % g 1
ba,p t % x c c , k v m a p _ d t l b _ l o a d
ldx [ % g 1 + % g 5 ] , % g 5
2008-01-11 08:10:54 +03:00
# endif
2007-10-16 12:24:16 +04:00
2006-02-01 05:29:18 +03:00
kvmap_dtlb_nonlinear :
/* Catch kernel NULL pointer derefs. */
sethi % h i ( P A G E _ S I Z E ) , % g 5
cmp % g 4 , % g 5
bleu,p n % x c c , k v m a p _ d t l b _ l o n g p a t h
2005-09-26 03:46:57 +04:00
nop
2008-01-11 08:10:54 +03:00
# ifdef C O N F I G _ S P A R S E M E M _ V M E M M A P
2007-10-16 12:24:16 +04:00
/* Do not use the TSB for vmemmap. */
2009-09-29 01:39:58 +04:00
mov ( V M E M M A P _ B A S E > > 4 0 ) , % g 5
sllx % g 5 , 4 0 , % g 5
2007-10-16 12:24:16 +04:00
cmp % g 4 ,% g 5
bgeu,p n % x c c , k v m a p _ v m e m m a p
nop
2008-01-11 08:10:54 +03:00
# endif
2007-10-16 12:24:16 +04:00
2006-02-01 05:29:18 +03:00
KERN_ T S B _ L O O K U P _ T L 1 ( % g 4 , % g 6 , % g 5 , % g 1 , % g 2 , % g 3 , k v m a p _ d t l b _ l o a d )
kvmap_dtlb_tsbmiss :
2005-09-22 05:50:51 +04:00
sethi % h i ( M O D U L E S _ V A D D R ) , % g 5
cmp % g 4 , % g 5
2006-02-01 05:29:18 +03:00
blu,p n % x c c , k v m a p _ d t l b _ l o n g p a t h
2009-09-29 01:39:58 +04:00
mov ( V M A L L O C _ E N D > > 4 0 ) , % g 5
sllx % g 5 , 4 0 , % g 5
2005-09-22 05:50:51 +04:00
cmp % g 4 , % g 5
2006-02-01 05:29:18 +03:00
bgeu,p n % x c c , k v m a p _ d t l b _ l o n g p a t h
2005-09-22 05:50:51 +04:00
nop
kvmap_check_obp :
sethi % h i ( L O W _ O B P _ A D D R E S S ) , % g 5
cmp % g 4 , % g 5
2006-02-01 05:29:18 +03:00
blu,p n % x c c , k v m a p _ d t l b _ v m a l l o c _ a d d r
2005-09-22 05:50:51 +04:00
mov 0 x1 , % g 5
sllx % g 5 , 3 2 , % g 5
cmp % g 4 , % g 5
2006-02-01 05:29:18 +03:00
blu,p n % x c c , k v m a p _ d t l b _ o b p
2005-09-22 05:50:51 +04:00
nop
2006-02-01 05:29:18 +03:00
ba,p t % x c c , k v m a p _ d t l b _ v m a l l o c _ a d d r
2005-09-22 05:50:51 +04:00
nop
2006-02-01 05:29:18 +03:00
kvmap_dtlb_longpath :
2006-02-06 09:27:28 +03:00
661 : rdpr % p s t a t e , % g 5
2006-02-01 05:29:18 +03:00
wrpr % g 5 , P S T A T E _ A G | P S T A T E _ M G , % p s t a t e
2006-02-07 11:00:16 +03:00
.section .sun4v_2insn_patch , " ax"
2006-02-06 09:27:28 +03:00
.word 661b
2006-02-18 05:01:02 +03:00
SET_ G L ( 1 )
ldxa [ % g 0 ] A S I _ S C R A T C H P A D , % g 5
2006-02-06 09:27:28 +03:00
.previous
2006-02-11 23:21:20 +03:00
rdpr % t l , % g 3
cmp % g 3 , 1
661 : mov T L B _ T A G _ A C C E S S , % g 4
2006-02-01 05:29:18 +03:00
ldxa [ % g 4 ] A S I _ D M M U , % g 5
2006-02-11 23:21:20 +03:00
.section .sun4v_2insn_patch , " ax"
.word 661b
2006-02-18 05:01:02 +03:00
ldx [ % g 5 + H V _ F A U L T _ D _ A D D R _ O F F S E T ] , % g 5
2006-02-11 23:21:20 +03:00
nop
.previous
2006-02-01 05:29:18 +03:00
be,p t % x c c , s p a r c64 _ r e a l f a u l t _ c o m m o n
mov F A U L T _ C O D E _ D T L B , % g 4
ba,p t % x c c , w i n f i x _ t r a m p o l i n e
nop