diff options
author | Paul Mundt <lethal@linux-sh.org> | 2009-08-14 13:49:40 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-08-14 13:49:40 -0400 |
commit | 112e58471de3431fbd03dee514777ad4a66a77b2 (patch) | |
tree | d1cb3238e18467479d876ebcc99e06c1885e2538 /arch/sh/kernel/cpu/sh3 | |
parent | e7b8b7f16edc9b363573eadf2ab2683473626071 (diff) |
sh: TLB protection violation exception optimizations.
This adds a bit of rework to have the TLB protection violations skip the
TLB miss fastpath and go directly in to do_page_fault(), as these require
slow path handling.
Based on an earlier patch by SUGIOKA Toshinobu.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/cpu/sh3')
-rw-r--r-- | arch/sh/kernel/cpu/sh3/entry.S | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/arch/sh/kernel/cpu/sh3/entry.S b/arch/sh/kernel/cpu/sh3/entry.S index 3cb531f233f..bbaf2bd118e 100644 --- a/arch/sh/kernel/cpu/sh3/entry.S +++ b/arch/sh/kernel/cpu/sh3/entry.S | |||
@@ -113,34 +113,33 @@ OFF_TRA = (16*4+6*4) | |||
113 | #if defined(CONFIG_MMU) | 113 | #if defined(CONFIG_MMU) |
114 | .align 2 | 114 | .align 2 |
115 | ENTRY(tlb_miss_load) | 115 | ENTRY(tlb_miss_load) |
116 | bra call_dpf | 116 | bra call_handle_tlbmiss |
117 | mov #0, r5 | 117 | mov #0, r5 |
118 | 118 | ||
119 | .align 2 | 119 | .align 2 |
120 | ENTRY(tlb_miss_store) | 120 | ENTRY(tlb_miss_store) |
121 | bra call_dpf | 121 | bra call_handle_tlbmiss |
122 | mov #1, r5 | 122 | mov #1, r5 |
123 | 123 | ||
124 | .align 2 | 124 | .align 2 |
125 | ENTRY(initial_page_write) | 125 | ENTRY(initial_page_write) |
126 | bra call_dpf | 126 | bra call_handle_tlbmiss |
127 | mov #1, r5 | 127 | mov #1, r5 |
128 | 128 | ||
129 | .align 2 | 129 | .align 2 |
130 | ENTRY(tlb_protection_violation_load) | 130 | ENTRY(tlb_protection_violation_load) |
131 | bra call_dpf | 131 | bra call_do_page_fault |
132 | mov #0, r5 | 132 | mov #0, r5 |
133 | 133 | ||
134 | .align 2 | 134 | .align 2 |
135 | ENTRY(tlb_protection_violation_store) | 135 | ENTRY(tlb_protection_violation_store) |
136 | bra call_dpf | 136 | bra call_do_page_fault |
137 | mov #1, r5 | 137 | mov #1, r5 |
138 | 138 | ||
139 | call_dpf: | 139 | call_handle_tlbmiss: |
140 | mov.l 1f, r0 | 140 | mov.l 1f, r0 |
141 | mov r5, r8 | 141 | mov r5, r8 |
142 | mov.l @r0, r6 | 142 | mov.l @r0, r6 |
143 | mov r6, r9 | ||
144 | mov.l 2f, r0 | 143 | mov.l 2f, r0 |
145 | sts pr, r10 | 144 | sts pr, r10 |
146 | jsr @r0 | 145 | jsr @r0 |
@@ -151,16 +150,25 @@ call_dpf: | |||
151 | lds r10, pr | 150 | lds r10, pr |
152 | rts | 151 | rts |
153 | nop | 152 | nop |
154 | 0: mov.l 3f, r0 | 153 | 0: |
155 | mov r9, r6 | ||
156 | mov r8, r5 | 154 | mov r8, r5 |
155 | call_do_page_fault: | ||
156 | mov.l 1f, r0 | ||
157 | mov.l @r0, r6 | ||
158 | |||
159 | sti | ||
160 | |||
161 | mov.l 3f, r0 | ||
162 | mov.l 4f, r1 | ||
163 | mov r15, r4 | ||
157 | jmp @r0 | 164 | jmp @r0 |
158 | mov r15, r4 | 165 | lds r1, pr |
159 | 166 | ||
160 | .align 2 | 167 | .align 2 |
161 | 1: .long MMU_TEA | 168 | 1: .long MMU_TEA |
162 | 2: .long __do_page_fault | 169 | 2: .long handle_tlbmiss |
163 | 3: .long do_page_fault | 170 | 3: .long do_page_fault |
171 | 4: .long ret_from_exception | ||
164 | 172 | ||
165 | .align 2 | 173 | .align 2 |
166 | ENTRY(address_error_load) | 174 | ENTRY(address_error_load) |