summaryrefslogtreecommitdiff
path: root/arch/sparc64/kernel
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2006-02-09 17:21:53 -0800
committerDavid S. Miller <davem@sunset.davemloft.net>2006-03-20 01:12:06 -0800
commit618e9ed98aed924a1fc664eb6522db4a5e927043 (patch)
tree08ace6185b8f9709cb22a23d329def1dae622666 /arch/sparc64/kernel
parentaa9143b9719c07fb6f1f6207790c9c5086ae07e7 (diff)
[SPARC64]: Hypervisor TSB context switching.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/kernel')
-rw-r--r--arch/sparc64/kernel/tsb.S42
1 files changed, 27 insertions, 15 deletions
diff --git a/arch/sparc64/kernel/tsb.S b/arch/sparc64/kernel/tsb.S
index c848c8847cdc..a53ec6fb7697 100644
--- a/arch/sparc64/kernel/tsb.S
+++ b/arch/sparc64/kernel/tsb.S
@@ -4,6 +4,7 @@
*/
#include <asm/tsb.h>
+#include <asm/hypervisor.h>
.text
.align 32
@@ -233,6 +234,7 @@ tsb_flush:
* %o1: TSB register value
* %o2: TSB virtual address
* %o3: TSB mapping locked PTE
+ * %o4: Hypervisor TSB descriptor physical address
*
* We have to run this whole thing with interrupts
* disabled so that the current cpu doesn't change
@@ -251,30 +253,40 @@ __tsb_context_switch:
add %g2, %g1, %g2
stx %o0, [%g2 + TRAP_PER_CPU_PGD_PADDR]
-661: mov TSB_REG, %g1
- stxa %o1, [%g1] ASI_DMMU
- .section .sun4v_2insn_patch, "ax"
- .word 661b
+ sethi %hi(tlb_type), %g1
+ lduw [%g1 + %lo(tlb_type)], %g1
+ cmp %g1, 3
+ bne,pt %icc, 1f
+ nop
+
+ /* Hypervisor TSB switch. */
mov SCRATCHPAD_UTSBREG1, %g1
stxa %o1, [%g1] ASI_SCRATCHPAD
- .previous
+ mov -1, %g2
+ mov SCRATCHPAD_UTSBREG2, %g1
+ stxa %g2, [%g1] ASI_SCRATCHPAD
- membar #Sync
+ mov HV_FAST_MMU_TSB_CTXNON0, %o0
+ mov 1, %o1
+ mov %o4, %o2
+ ta HV_FAST_TRAP
+
+ ba,pt %xcc, 9f
+ nop
-661: stxa %o1, [%g1] ASI_IMMU
+ /* SUN4U TSB switch. */
+1: mov TSB_REG, %g1
+ stxa %o1, [%g1] ASI_DMMU
+ membar #Sync
+ stxa %o1, [%g1] ASI_IMMU
membar #Sync
- .section .sun4v_2insn_patch, "ax"
- .word 661b
- nop
- nop
- .previous
- brz %o2, 9f
+2: brz %o2, 9f
nop
- sethi %hi(sparc64_highest_unlocked_tlb_ent), %o4
+ sethi %hi(sparc64_highest_unlocked_tlb_ent), %g2
mov TLB_TAG_ACCESS, %g1
- lduw [%o4 + %lo(sparc64_highest_unlocked_tlb_ent)], %g2
+ lduw [%g2 + %lo(sparc64_highest_unlocked_tlb_ent)], %g2
stxa %o2, [%g1] ASI_DMMU
membar #Sync
sllx %g2, 3, %g2