]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[POWERPC] Use PAGE_OFFSET to tell if an address is user/kernel in SW TLB handlers
authorKumar Gala <galak@kernel.crashing.org>
Thu, 11 Oct 2007 18:36:52 +0000 (13:36 -0500)
committerKumar Gala <galak@kernel.crashing.org>
Thu, 11 Oct 2007 18:36:52 +0000 (13:36 -0500)
Move to using PAGE_OFFSET instead of TASK_SIZE or KERNELBASE value on
6xx/40x/44x/fsl-booke to determine if the faulting address is a kernel or
user space address.  This mimics how the macro is_kernel_addr() works.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
arch/powerpc/kernel/head_32.S
arch/powerpc/kernel/head_40x.S
arch/powerpc/kernel/head_44x.S
arch/powerpc/kernel/head_fsl_booke.S

index d83f04e5a599baefc06e0a2e9046f66684d619e5..a5b13ae7fd20d6a225cee77942c7b26f19ab8f58 100644 (file)
@@ -469,12 +469,12 @@ InstructionTLBMiss:
        mfctr   r0
        /* Get PTE (linux-style) and check access */
        mfspr   r3,SPRN_IMISS
-       lis     r1,KERNELBASE@h         /* check if kernel address */
-       cmplw   0,r3,r1
+       lis     r1,PAGE_OFFSET@h                /* check if kernel address */
+       cmplw   0,r1,r3
        mfspr   r2,SPRN_SPRG3
        li      r1,_PAGE_USER|_PAGE_PRESENT /* low addresses tested as user */
        lwz     r2,PGDIR(r2)
-       blt+    112f
+       bge-    112f
        mfspr   r2,SPRN_SRR1            /* and MSR_PR bit from SRR1 */
        rlwimi  r1,r2,32-12,29,29       /* shift MSR_PR to _PAGE_USER posn */
        lis     r2,swapper_pg_dir@ha    /* if kernel address, use */
@@ -543,12 +543,12 @@ DataLoadTLBMiss:
        mfctr   r0
        /* Get PTE (linux-style) and check access */
        mfspr   r3,SPRN_DMISS
-       lis     r1,KERNELBASE@h         /* check if kernel address */
-       cmplw   0,r3,r1
+       lis     r1,PAGE_OFFSET@h                /* check if kernel address */
+       cmplw   0,r1,r3
        mfspr   r2,SPRN_SPRG3
        li      r1,_PAGE_USER|_PAGE_PRESENT /* low addresses tested as user */
        lwz     r2,PGDIR(r2)
-       blt+    112f
+       bge-    112f
        mfspr   r2,SPRN_SRR1            /* and MSR_PR bit from SRR1 */
        rlwimi  r1,r2,32-12,29,29       /* shift MSR_PR to _PAGE_USER posn */
        lis     r2,swapper_pg_dir@ha    /* if kernel address, use */
@@ -615,12 +615,12 @@ DataStoreTLBMiss:
        mfctr   r0
        /* Get PTE (linux-style) and check access */
        mfspr   r3,SPRN_DMISS
-       lis     r1,KERNELBASE@h         /* check if kernel address */
-       cmplw   0,r3,r1
+       lis     r1,PAGE_OFFSET@h                /* check if kernel address */
+       cmplw   0,r1,r3
        mfspr   r2,SPRN_SPRG3
        li      r1,_PAGE_RW|_PAGE_USER|_PAGE_PRESENT /* access flags */
        lwz     r2,PGDIR(r2)
-       blt+    112f
+       bge-    112f
        mfspr   r2,SPRN_SRR1            /* and MSR_PR bit from SRR1 */
        rlwimi  r1,r2,32-12,29,29       /* shift MSR_PR to _PAGE_USER posn */
        lis     r2,swapper_pg_dir@ha    /* if kernel address, use */
index e312824bdd980c55623a6e502b684311d8a720a5..cfefc2df8f2a082ee94718af19d6ddbc07eee84a 100644 (file)
@@ -289,7 +289,7 @@ label:
        /* If we are faulting a kernel address, we have to use the
         * kernel page tables.
         */
-       lis     r11, TASK_SIZE@h
+       lis     r11, PAGE_OFFSET@h
        cmplw   r10, r11
        blt+    3f
        lis     r11, swapper_pg_dir@h
@@ -481,7 +481,7 @@ label:
        /* If we are faulting a kernel address, we have to use the
         * kernel page tables.
         */
-       lis     r11, TASK_SIZE@h
+       lis     r11, PAGE_OFFSET@h
        cmplw   r10, r11
        blt+    3f
        lis     r11, swapper_pg_dir@h
@@ -581,7 +581,7 @@ label:
        /* If we are faulting a kernel address, we have to use the
         * kernel page tables.
         */
-       lis     r11, TASK_SIZE@h
+       lis     r11, PAGE_OFFSET@h
        cmplw   r10, r11
        blt+    3f
        lis     r11, swapper_pg_dir@h
index 864d63fbb2047f4737d9ea978e2e6912b056c45e..409db6123924fde81088c3a39d40a5e520280041 100644 (file)
@@ -319,7 +319,7 @@ interrupt_base:
        /* If we are faulting a kernel address, we have to use the
         * kernel page tables.
         */
-       lis     r11, TASK_SIZE@h
+       lis     r11, PAGE_OFFSET@h
        cmplw   r10, r11
        blt+    3f
        lis     r11, swapper_pg_dir@h
@@ -458,7 +458,7 @@ interrupt_base:
        /* If we are faulting a kernel address, we have to use the
         * kernel page tables.
         */
-       lis     r11, TASK_SIZE@h
+       lis     r11, PAGE_OFFSET@h
        cmplw   r10, r11
        blt+    3f
        lis     r11, swapper_pg_dir@h
@@ -528,7 +528,7 @@ interrupt_base:
        /* If we are faulting a kernel address, we have to use the
         * kernel page tables.
         */
-       lis     r11, TASK_SIZE@h
+       lis     r11, PAGE_OFFSET@h
        cmplw   r10, r11
        blt+    3f
        lis     r11, swapper_pg_dir@h
index ee33ddd97ef306e36a49483963ddd2b37034c78b..4b9822728aeab30ff6c685f00c36c1e3423139f5 100644 (file)
@@ -461,8 +461,7 @@ interrupt_base:
        /* If we are faulting a kernel address, we have to use the
         * kernel page tables.
         */
-       lis     r11, TASK_SIZE@h
-       ori     r11, r11, TASK_SIZE@l
+       lis     r11, PAGE_OFFSET@h
        cmplw   0, r10, r11
        bge     2f
 
@@ -584,8 +583,7 @@ interrupt_base:
        /* If we are faulting a kernel address, we have to use the
         * kernel page tables.
         */
-       lis     r11, TASK_SIZE@h
-       ori     r11, r11, TASK_SIZE@l
+       lis     r11, PAGE_OFFSET@h
        cmplw   5, r10, r11
        blt     5, 3f
        lis     r11, swapper_pg_dir@h
@@ -645,8 +643,7 @@ interrupt_base:
        /* If we are faulting a kernel address, we have to use the
         * kernel page tables.
         */
-       lis     r11, TASK_SIZE@h
-       ori     r11, r11, TASK_SIZE@l
+       lis     r11, PAGE_OFFSET@h
        cmplw   5, r10, r11
        blt     5, 3f
        lis     r11, swapper_pg_dir@h
@@ -744,7 +741,7 @@ data_access:
  *     r10 - EA of fault
  *     r11 - TLB (info from Linux PTE)
  *     r12, r13 - available to use
- *     CR5 - results of addr < TASK_SIZE
+ *     CR5 - results of addr >= PAGE_OFFSET
  *     MAS0, MAS1 - loaded with proper value when we get here
  *     MAS2, MAS3 - will need additional info from Linux PTE
  *     Upon exit, we reload everything and RFI.