]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
openrisc: fix up vmalloc page table loading
authorJonas Bonn <jonas@southpole.se>
Thu, 14 Feb 2013 15:16:49 +0000 (16:16 +0100)
committerJonas Bonn <jonas@southpole.se>
Thu, 14 Feb 2013 15:39:26 +0000 (16:39 +0100)
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>
arch/openrisc/kernel/entry.S
arch/openrisc/kernel/head.S

index 5e5b30601bbf58e42cc54fbca7ffc285025db929..3de971224cfcda300906b45ddc4bd4c67f5da30b 100644 (file)
@@ -201,12 +201,17 @@ EXCEPTION_ENTRY(_bus_fault_handler)
         l.nop
 
 /* ---[ 0x300: Data Page Fault exception ]------------------------------- */
+EXCEPTION_ENTRY(_dtlb_miss_page_fault_handler)
+       l.and   r5,r5,r0
+       l.j     1f
+        l.nop
 
 EXCEPTION_ENTRY(_data_page_fault_handler)
        /* set up parameters for do_page_fault */
+       l.ori   r5,r0,0x300                // exception vector
+1:
        l.addi  r3,r1,0                    // pt_regs
        /* r4 set be EXCEPTION_HANDLE */   // effective address of fault
-       l.ori   r5,r0,0x300                // exception vector
 
        /*
         * __PHX__: TODO
@@ -276,12 +281,17 @@ EXCEPTION_ENTRY(_data_page_fault_handler)
        l.nop
 
 /* ---[ 0x400: Insn Page Fault exception ]------------------------------- */
+EXCEPTION_ENTRY(_itlb_miss_page_fault_handler)
+       l.and   r5,r5,r0
+       l.j     1f
+        l.nop
 
 EXCEPTION_ENTRY(_insn_page_fault_handler)
        /* set up parameters for do_page_fault */
+       l.ori   r5,r0,0x400                // exception vector
+1:
        l.addi  r3,r1,0                    // pt_regs
        /* r4 set be EXCEPTION_HANDLE */   // effective address of fault
-       l.ori   r5,r0,0x400                // exception vector
        l.ori   r6,r0,0x0                  // !write access
 
        /* call fault.c handler in or32/mm/fault.c */
index 46aa940ebd208532e1cbeee05300dde9518dc3cd..b357e7f79aca7ac43f28f314fefaa7b7df740e87 100644 (file)
@@ -1069,8 +1069,7 @@ d_pte_not_present:
        EXCEPTION_LOAD_GPR4
        EXCEPTION_LOAD_GPR5
        EXCEPTION_LOAD_GPR6
-       l.j     _dispatch_do_dpage_fault
-       l.nop
+       EXCEPTION_HANDLE(_dtlb_miss_page_fault_handler)
 
 /* ==============================================[ ITLB miss handler ]=== */
 ENTRY(itlb_miss_handler)
@@ -1192,8 +1191,7 @@ i_pte_not_present:
        EXCEPTION_LOAD_GPR4
        EXCEPTION_LOAD_GPR5
        EXCEPTION_LOAD_GPR6
-       l.j     _dispatch_do_ipage_fault
-       l.nop
+       EXCEPTION_HANDLE(_itlb_miss_page_fault_handler)
 
 /* ==============================================[ boot tlb handlers ]=== */