提交 c5bd50a9 编写于 作者: D David S. Miller

[SPARC64]: Simplify Spitfire D-cache page flush.

It tries to batch up the tag loads and comparisons, and
then the stores.  And this is just complicated instead
of efficient.

Also, make the symbol of the Cheetah version more grepable.
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 80dc0d6b
...@@ -144,42 +144,29 @@ __flush_icache_page: /* %o0 = phys_page */ ...@@ -144,42 +144,29 @@ __flush_icache_page: /* %o0 = phys_page */
#define DTAG_MASK 0x3 #define DTAG_MASK 0x3
/* This routine is Spitfire specific so the hardcoded
* D-cache size and line-size are OK.
*/
.align 64 .align 64
.globl __flush_dcache_page .globl __flush_dcache_page
__flush_dcache_page: /* %o0=kaddr, %o1=flush_icache */ __flush_dcache_page: /* %o0=kaddr, %o1=flush_icache */
sethi %uhi(PAGE_OFFSET), %g1 sethi %uhi(PAGE_OFFSET), %g1
sllx %g1, 32, %g1 sllx %g1, 32, %g1
sub %o0, %g1, %o0 sub %o0, %g1, %o0 ! physical address
clr %o4 srlx %o0, 11, %o0 ! make D-cache TAG
srlx %o0, 11, %o0 sethi %hi(1 << 14), %o2 ! D-cache size
sethi %hi(1 << 14), %o2 sub %o2, (1 << 5), %o2 ! D-cache line size
1: ldxa [%o4] ASI_DCACHE_TAG, %o3 ! LSU Group 1: ldxa [%o2] ASI_DCACHE_TAG, %o3 ! load D-cache TAG
add %o4, (1 << 5), %o4 ! IEU0 andcc %o3, DTAG_MASK, %g0 ! Valid?
ldxa [%o4] ASI_DCACHE_TAG, %g1 ! LSU Group be,pn %xcc, 2f ! Nope, branch
add %o4, (1 << 5), %o4 ! IEU0 andn %o3, DTAG_MASK, %o3 ! Clear valid bits
ldxa [%o4] ASI_DCACHE_TAG, %g2 ! LSU Group o3 available cmp %o3, %o0 ! TAG match?
add %o4, (1 << 5), %o4 ! IEU0 bne,pt %xcc, 2f ! Nope, branch
andn %o3, DTAG_MASK, %o3 ! IEU1 nop
ldxa [%o4] ASI_DCACHE_TAG, %g3 ! LSU Group stxa %g0, [%o2] ASI_DCACHE_TAG ! Invalidate TAG
add %o4, (1 << 5), %o4 ! IEU0 membar #Sync
andn %g1, DTAG_MASK, %g1 ! IEU1 2: brnz,pt %o2, 1b
cmp %o0, %o3 ! IEU1 Group sub %o2, (1 << 5), %o2 ! D-cache line size
be,a,pn %xcc, dflush1 ! CTI
sub %o4, (4 << 5), %o4 ! IEU0 (Group)
cmp %o0, %g1 ! IEU1 Group
andn %g2, DTAG_MASK, %g2 ! IEU0
be,a,pn %xcc, dflush2 ! CTI
sub %o4, (3 << 5), %o4 ! IEU0 (Group)
cmp %o0, %g2 ! IEU1 Group
andn %g3, DTAG_MASK, %g3 ! IEU0
be,a,pn %xcc, dflush3 ! CTI
sub %o4, (2 << 5), %o4 ! IEU0 (Group)
cmp %o0, %g3 ! IEU1 Group
be,a,pn %xcc, dflush4 ! CTI
sub %o4, (1 << 5), %o4 ! IEU0
2: cmp %o4, %o2 ! IEU1 Group
bne,pt %xcc, 1b ! CTI
nop ! IEU0
/* The I-cache does not snoop local stores so we /* The I-cache does not snoop local stores so we
* better flush that too when necessary. * better flush that too when necessary.
...@@ -189,20 +176,10 @@ __flush_dcache_page: /* %o0=kaddr, %o1=flush_icache */ ...@@ -189,20 +176,10 @@ __flush_dcache_page: /* %o0=kaddr, %o1=flush_icache */
retl retl
nop nop
dflush1:stxa %g0, [%o4] ASI_DCACHE_TAG
add %o4, (1 << 5), %o4
dflush2:stxa %g0, [%o4] ASI_DCACHE_TAG
add %o4, (1 << 5), %o4
dflush3:stxa %g0, [%o4] ASI_DCACHE_TAG
add %o4, (1 << 5), %o4
dflush4:stxa %g0, [%o4] ASI_DCACHE_TAG
add %o4, (1 << 5), %o4
membar #Sync
ba,pt %xcc, 2b
nop
#endif /* DCACHE_ALIASING_POSSIBLE */ #endif /* DCACHE_ALIASING_POSSIBLE */
.previous .text .previous
.align 32 .align 32
__prefill_dtlb: __prefill_dtlb:
rdpr %pstate, %g7 rdpr %pstate, %g7
...@@ -283,7 +260,7 @@ __cheetah_flush_tlb_pending: /* 26 insns */ ...@@ -283,7 +260,7 @@ __cheetah_flush_tlb_pending: /* 26 insns */
wrpr %g7, 0x0, %pstate wrpr %g7, 0x0, %pstate
#ifdef DCACHE_ALIASING_POSSIBLE #ifdef DCACHE_ALIASING_POSSIBLE
flush_dcpage_cheetah: /* 11 insns */ __cheetah_flush_dcache_page: /* 11 insns */
sethi %uhi(PAGE_OFFSET), %g1 sethi %uhi(PAGE_OFFSET), %g1
sllx %g1, 32, %g1 sllx %g1, 32, %g1
sub %o0, %g1, %o0 sub %o0, %g1, %o0
...@@ -329,8 +306,8 @@ cheetah_patch_cachetlbops: ...@@ -329,8 +306,8 @@ cheetah_patch_cachetlbops:
#ifdef DCACHE_ALIASING_POSSIBLE #ifdef DCACHE_ALIASING_POSSIBLE
sethi %hi(__flush_dcache_page), %o0 sethi %hi(__flush_dcache_page), %o0
or %o0, %lo(__flush_dcache_page), %o0 or %o0, %lo(__flush_dcache_page), %o0
sethi %hi(flush_dcpage_cheetah), %o1 sethi %hi(__cheetah_flush_dcache_page), %o1
or %o1, %lo(flush_dcpage_cheetah), %o1 or %o1, %lo(__cheetah_flush_dcache_page), %o1
call cheetah_patch_one call cheetah_patch_one
mov 11, %o2 mov 11, %o2
#endif /* DCACHE_ALIASING_POSSIBLE */ #endif /* DCACHE_ALIASING_POSSIBLE */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册