diff options
-rw-r--r-- | arch/powerpc/include/asm/exception-64e.h | 10 | ||||
-rw-r--r-- | arch/powerpc/include/asm/kvm_booke_hv_asm.h | 8 | ||||
-rw-r--r-- | arch/powerpc/kvm/bookehv_interrupts.S | 11 | ||||
-rw-r--r-- | arch/powerpc/mm/tlb_low_64e.S | 44 |
4 files changed, 42 insertions, 31 deletions
diff --git a/arch/powerpc/include/asm/exception-64e.h b/arch/powerpc/include/asm/exception-64e.h index e73452f09019..a563d9afd179 100644 --- a/arch/powerpc/include/asm/exception-64e.h +++ b/arch/powerpc/include/asm/exception-64e.h | |||
@@ -172,16 +172,6 @@ exc_##label##_book3e: | |||
172 | ld r9,EX_TLB_R9(r12); \ | 172 | ld r9,EX_TLB_R9(r12); \ |
173 | ld r8,EX_TLB_R8(r12); \ | 173 | ld r8,EX_TLB_R8(r12); \ |
174 | mtlr r16; | 174 | mtlr r16; |
175 | #define TLB_MISS_PROLOG_STATS_BOLTED \ | ||
176 | mflr r10; \ | ||
177 | std r8,PACA_EXTLB+EX_TLB_R8(r13); \ | ||
178 | std r9,PACA_EXTLB+EX_TLB_R9(r13); \ | ||
179 | std r10,PACA_EXTLB+EX_TLB_LR(r13); | ||
180 | #define TLB_MISS_RESTORE_STATS_BOLTED \ | ||
181 | ld r16,PACA_EXTLB+EX_TLB_LR(r13); \ | ||
182 | ld r9,PACA_EXTLB+EX_TLB_R9(r13); \ | ||
183 | ld r8,PACA_EXTLB+EX_TLB_R8(r13); \ | ||
184 | mtlr r16; | ||
185 | #define TLB_MISS_STATS_D(name) \ | 175 | #define TLB_MISS_STATS_D(name) \ |
186 | addi r9,r13,MMSTAT_DSTATS+name; \ | 176 | addi r9,r13,MMSTAT_DSTATS+name; \ |
187 | bl .tlb_stat_inc; | 177 | bl .tlb_stat_inc; |
diff --git a/arch/powerpc/include/asm/kvm_booke_hv_asm.h b/arch/powerpc/include/asm/kvm_booke_hv_asm.h index c3e3fd53a3a9..e5f048bbcb7c 100644 --- a/arch/powerpc/include/asm/kvm_booke_hv_asm.h +++ b/arch/powerpc/include/asm/kvm_booke_hv_asm.h | |||
@@ -45,10 +45,12 @@ | |||
45 | * | 45 | * |
46 | * Expected inputs (TLB exception type): | 46 | * Expected inputs (TLB exception type): |
47 | * r10 = saved CR | 47 | * r10 = saved CR |
48 | * r12 = extlb pointer | ||
48 | * r13 = PACA_POINTER | 49 | * r13 = PACA_POINTER |
49 | * *(r13 + PACA_EX##type + EX_TLB_R10) = saved r10 | 50 | * *(r12 + EX_TLB_R10) = saved r10 |
50 | * *(r13 + PACA_EX##type + EX_TLB_R11) = saved r11 | 51 | * *(r12 + EX_TLB_R11) = saved r11 |
51 | * SPRN_SPRG_GEN_SCRATCH = saved r13 | 52 | * *(r12 + EX_TLB_R13) = saved r13 |
53 | * SPRN_SPRG_GEN_SCRATCH = saved r12 | ||
52 | * | 54 | * |
53 | * Only the bolted version of TLB miss exception handlers is supported now. | 55 | * Only the bolted version of TLB miss exception handlers is supported now. |
54 | */ | 56 | */ |
diff --git a/arch/powerpc/kvm/bookehv_interrupts.S b/arch/powerpc/kvm/bookehv_interrupts.S index 99635a37c78c..a1712b818a5f 100644 --- a/arch/powerpc/kvm/bookehv_interrupts.S +++ b/arch/powerpc/kvm/bookehv_interrupts.S | |||
@@ -229,13 +229,20 @@ | |||
229 | stw r10, VCPU_CR(r4) | 229 | stw r10, VCPU_CR(r4) |
230 | PPC_STL r11, VCPU_GPR(R4)(r4) | 230 | PPC_STL r11, VCPU_GPR(R4)(r4) |
231 | PPC_STL r5, VCPU_GPR(R5)(r4) | 231 | PPC_STL r5, VCPU_GPR(R5)(r4) |
232 | mfspr r5, \scratch | ||
233 | PPC_STL r6, VCPU_GPR(R6)(r4) | 232 | PPC_STL r6, VCPU_GPR(R6)(r4) |
234 | PPC_STL r8, VCPU_GPR(R8)(r4) | 233 | PPC_STL r8, VCPU_GPR(R8)(r4) |
235 | PPC_STL r9, VCPU_GPR(R9)(r4) | 234 | PPC_STL r9, VCPU_GPR(R9)(r4) |
236 | PPC_STL r5, VCPU_GPR(R13)(r4) | 235 | .if \type == EX_TLB |
236 | PPC_LL r5, EX_TLB_R13(r12) | ||
237 | PPC_LL r6, EX_TLB_R10(r12) | ||
238 | PPC_LL r8, EX_TLB_R11(r12) | ||
239 | mfspr r12, \scratch | ||
240 | .else | ||
241 | mfspr r5, \scratch | ||
237 | PPC_LL r6, (\paca_ex + \ex_r10)(r13) | 242 | PPC_LL r6, (\paca_ex + \ex_r10)(r13) |
238 | PPC_LL r8, (\paca_ex + \ex_r11)(r13) | 243 | PPC_LL r8, (\paca_ex + \ex_r11)(r13) |
244 | .endif | ||
245 | PPC_STL r5, VCPU_GPR(R13)(r4) | ||
239 | PPC_STL r3, VCPU_GPR(R3)(r4) | 246 | PPC_STL r3, VCPU_GPR(R3)(r4) |
240 | PPC_STL r7, VCPU_GPR(R7)(r4) | 247 | PPC_STL r7, VCPU_GPR(R7)(r4) |
241 | PPC_STL r12, VCPU_GPR(R12)(r4) | 248 | PPC_STL r12, VCPU_GPR(R12)(r4) |
diff --git a/arch/powerpc/mm/tlb_low_64e.S b/arch/powerpc/mm/tlb_low_64e.S index 1e50249e900b..356e8b41fb09 100644 --- a/arch/powerpc/mm/tlb_low_64e.S +++ b/arch/powerpc/mm/tlb_low_64e.S | |||
@@ -39,37 +39,49 @@ | |||
39 | * * | 39 | * * |
40 | **********************************************************************/ | 40 | **********************************************************************/ |
41 | 41 | ||
42 | /* | ||
43 | * Note that, unlike non-bolted handlers, TLB_EXFRAME is not | ||
44 | * modified by the TLB miss handlers themselves, since the TLB miss | ||
45 | * handler code will not itself cause a recursive TLB miss. | ||
46 | * | ||
47 | * TLB_EXFRAME will be modified when crit/mc/debug exceptions are | ||
48 | * entered/exited. | ||
49 | */ | ||
42 | .macro tlb_prolog_bolted intnum addr | 50 | .macro tlb_prolog_bolted intnum addr |
43 | mtspr SPRN_SPRG_GEN_SCRATCH,r13 | 51 | mtspr SPRN_SPRG_GEN_SCRATCH,r12 |
52 | mfspr r12,SPRN_SPRG_TLB_EXFRAME | ||
53 | std r13,EX_TLB_R13(r12) | ||
54 | std r10,EX_TLB_R10(r12) | ||
44 | mfspr r13,SPRN_SPRG_PACA | 55 | mfspr r13,SPRN_SPRG_PACA |
45 | std r10,PACA_EXTLB+EX_TLB_R10(r13) | 56 | |
46 | mfcr r10 | 57 | mfcr r10 |
47 | std r11,PACA_EXTLB+EX_TLB_R11(r13) | 58 | std r11,EX_TLB_R11(r12) |
48 | #ifdef CONFIG_KVM_BOOKE_HV | 59 | #ifdef CONFIG_KVM_BOOKE_HV |
49 | BEGIN_FTR_SECTION | 60 | BEGIN_FTR_SECTION |
50 | mfspr r11, SPRN_SRR1 | 61 | mfspr r11, SPRN_SRR1 |
51 | END_FTR_SECTION_IFSET(CPU_FTR_EMB_HV) | 62 | END_FTR_SECTION_IFSET(CPU_FTR_EMB_HV) |
52 | #endif | 63 | #endif |
53 | DO_KVM \intnum, SPRN_SRR1 | 64 | DO_KVM \intnum, SPRN_SRR1 |
54 | std r16,PACA_EXTLB+EX_TLB_R16(r13) | 65 | std r16,EX_TLB_R16(r12) |
55 | mfspr r16,\addr /* get faulting address */ | 66 | mfspr r16,\addr /* get faulting address */ |
56 | std r14,PACA_EXTLB+EX_TLB_R14(r13) | 67 | std r14,EX_TLB_R14(r12) |
57 | ld r14,PACAPGD(r13) | 68 | ld r14,PACAPGD(r13) |
58 | std r15,PACA_EXTLB+EX_TLB_R15(r13) | 69 | std r15,EX_TLB_R15(r12) |
59 | std r10,PACA_EXTLB+EX_TLB_CR(r13) | 70 | std r10,EX_TLB_CR(r12) |
60 | TLB_MISS_PROLOG_STATS_BOLTED | 71 | TLB_MISS_PROLOG_STATS |
61 | .endm | 72 | .endm |
62 | 73 | ||
63 | .macro tlb_epilog_bolted | 74 | .macro tlb_epilog_bolted |
64 | ld r14,PACA_EXTLB+EX_TLB_CR(r13) | 75 | ld r14,EX_TLB_CR(r12) |
65 | ld r10,PACA_EXTLB+EX_TLB_R10(r13) | 76 | ld r10,EX_TLB_R10(r12) |
66 | ld r11,PACA_EXTLB+EX_TLB_R11(r13) | 77 | ld r11,EX_TLB_R11(r12) |
78 | ld r13,EX_TLB_R13(r12) | ||
67 | mtcr r14 | 79 | mtcr r14 |
68 | ld r14,PACA_EXTLB+EX_TLB_R14(r13) | 80 | ld r14,EX_TLB_R14(r12) |
69 | ld r15,PACA_EXTLB+EX_TLB_R15(r13) | 81 | ld r15,EX_TLB_R15(r12) |
70 | TLB_MISS_RESTORE_STATS_BOLTED | 82 | TLB_MISS_RESTORE_STATS |
71 | ld r16,PACA_EXTLB+EX_TLB_R16(r13) | 83 | ld r16,EX_TLB_R16(r12) |
72 | mfspr r13,SPRN_SPRG_GEN_SCRATCH | 84 | mfspr r12,SPRN_SPRG_GEN_SCRATCH |
73 | .endm | 85 | .endm |
74 | 86 | ||
75 | /* Data TLB miss */ | 87 | /* Data TLB miss */ |