diff options
author | Jonas Bonn <jonas@southpole.se> | 2013-02-14 10:16:49 -0500 |
---|---|---|
committer | Jonas Bonn <jonas@southpole.se> | 2013-02-14 10:39:26 -0500 |
commit | a81252d75e14cc2cf0ee45078ef143562a0bc279 (patch) | |
tree | 7b8bb82ebd471c129788dade8667f4e4fae285dc /arch/openrisc | |
parent | 7f81ea7e28c3e4e5b762111dc676b24152f85a3a (diff) |
openrisc: fix up vmalloc page table loading
vmalloc'ed pages are faulted into a process' page tables on demand. In
order to facilitate this, do_page_fault needs to know whether it was
called via a page fault exception or a TLB-miss exception.
This patch adds a wrapper around the _x_page_fault_handler entry points
that the TLB-miss exceptions can call into in order to have the relevant
parameter set to satisfy do_page_fault.
This fixes a bug and is "good enough" for now. That said, this whole
handling of vmalloc needs to be audited for correctness at some point.
Signed-off-by: Jonas Bonn <jonas@southpole.se>
Diffstat (limited to 'arch/openrisc')
-rw-r--r-- | arch/openrisc/kernel/entry.S | 14 | ||||
-rw-r--r-- | arch/openrisc/kernel/head.S | 6 |
2 files changed, 14 insertions, 6 deletions
diff --git a/arch/openrisc/kernel/entry.S b/arch/openrisc/kernel/entry.S index 5e5b30601bbf..3de971224cfc 100644 --- a/arch/openrisc/kernel/entry.S +++ b/arch/openrisc/kernel/entry.S | |||
@@ -201,12 +201,17 @@ EXCEPTION_ENTRY(_bus_fault_handler) | |||
201 | l.nop | 201 | l.nop |
202 | 202 | ||
203 | /* ---[ 0x300: Data Page Fault exception ]------------------------------- */ | 203 | /* ---[ 0x300: Data Page Fault exception ]------------------------------- */ |
204 | EXCEPTION_ENTRY(_dtlb_miss_page_fault_handler) | ||
205 | l.and r5,r5,r0 | ||
206 | l.j 1f | ||
207 | l.nop | ||
204 | 208 | ||
205 | EXCEPTION_ENTRY(_data_page_fault_handler) | 209 | EXCEPTION_ENTRY(_data_page_fault_handler) |
206 | /* set up parameters for do_page_fault */ | 210 | /* set up parameters for do_page_fault */ |
211 | l.ori r5,r0,0x300 // exception vector | ||
212 | 1: | ||
207 | l.addi r3,r1,0 // pt_regs | 213 | l.addi r3,r1,0 // pt_regs |
208 | /* r4 set be EXCEPTION_HANDLE */ // effective address of fault | 214 | /* r4 set be EXCEPTION_HANDLE */ // effective address of fault |
209 | l.ori r5,r0,0x300 // exception vector | ||
210 | 215 | ||
211 | /* | 216 | /* |
212 | * __PHX__: TODO | 217 | * __PHX__: TODO |
@@ -276,12 +281,17 @@ EXCEPTION_ENTRY(_data_page_fault_handler) | |||
276 | l.nop | 281 | l.nop |
277 | 282 | ||
278 | /* ---[ 0x400: Insn Page Fault exception ]------------------------------- */ | 283 | /* ---[ 0x400: Insn Page Fault exception ]------------------------------- */ |
284 | EXCEPTION_ENTRY(_itlb_miss_page_fault_handler) | ||
285 | l.and r5,r5,r0 | ||
286 | l.j 1f | ||
287 | l.nop | ||
279 | 288 | ||
280 | EXCEPTION_ENTRY(_insn_page_fault_handler) | 289 | EXCEPTION_ENTRY(_insn_page_fault_handler) |
281 | /* set up parameters for do_page_fault */ | 290 | /* set up parameters for do_page_fault */ |
291 | l.ori r5,r0,0x400 // exception vector | ||
292 | 1: | ||
282 | l.addi r3,r1,0 // pt_regs | 293 | l.addi r3,r1,0 // pt_regs |
283 | /* r4 set be EXCEPTION_HANDLE */ // effective address of fault | 294 | /* r4 set be EXCEPTION_HANDLE */ // effective address of fault |
284 | l.ori r5,r0,0x400 // exception vector | ||
285 | l.ori r6,r0,0x0 // !write access | 295 | l.ori r6,r0,0x0 // !write access |
286 | 296 | ||
287 | /* call fault.c handler in or32/mm/fault.c */ | 297 | /* call fault.c handler in or32/mm/fault.c */ |
diff --git a/arch/openrisc/kernel/head.S b/arch/openrisc/kernel/head.S index 46aa940ebd20..b357e7f79aca 100644 --- a/arch/openrisc/kernel/head.S +++ b/arch/openrisc/kernel/head.S | |||
@@ -1069,8 +1069,7 @@ d_pte_not_present: | |||
1069 | EXCEPTION_LOAD_GPR4 | 1069 | EXCEPTION_LOAD_GPR4 |
1070 | EXCEPTION_LOAD_GPR5 | 1070 | EXCEPTION_LOAD_GPR5 |
1071 | EXCEPTION_LOAD_GPR6 | 1071 | EXCEPTION_LOAD_GPR6 |
1072 | l.j _dispatch_do_dpage_fault | 1072 | EXCEPTION_HANDLE(_dtlb_miss_page_fault_handler) |
1073 | l.nop | ||
1074 | 1073 | ||
1075 | /* ==============================================[ ITLB miss handler ]=== */ | 1074 | /* ==============================================[ ITLB miss handler ]=== */ |
1076 | ENTRY(itlb_miss_handler) | 1075 | ENTRY(itlb_miss_handler) |
@@ -1192,8 +1191,7 @@ i_pte_not_present: | |||
1192 | EXCEPTION_LOAD_GPR4 | 1191 | EXCEPTION_LOAD_GPR4 |
1193 | EXCEPTION_LOAD_GPR5 | 1192 | EXCEPTION_LOAD_GPR5 |
1194 | EXCEPTION_LOAD_GPR6 | 1193 | EXCEPTION_LOAD_GPR6 |
1195 | l.j _dispatch_do_ipage_fault | 1194 | EXCEPTION_HANDLE(_itlb_miss_page_fault_handler) |
1196 | l.nop | ||
1197 | 1195 | ||
1198 | /* ==============================================[ boot tlb handlers ]=== */ | 1196 | /* ==============================================[ boot tlb handlers ]=== */ |
1199 | 1197 | ||