Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux...
[pandora-kernel.git] / arch / powerpc / kernel / head_fsl_booke.S
index 7255265..edd4a57 100644 (file)
@@ -639,6 +639,13 @@ interrupt_base:
        rlwinm  r12,r12,0,16,1
        mtspr   SPRN_MAS1,r12
 
+       /* Make up the required permissions for kernel code */
+#ifdef CONFIG_PTE_64BIT
+       li      r13,_PAGE_PRESENT | _PAGE_BAP_SX
+       oris    r13,r13,_PAGE_ACCESSED@h
+#else
+       li      r13,_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_EXEC
+#endif
        b       4f
 
        /* Get the PGD for the current thread */
@@ -646,15 +653,15 @@ interrupt_base:
        mfspr   r11,SPRN_SPRG_THREAD
        lwz     r11,PGDIR(r11)
 
-4:
-       /* Make up the required permissions */
+       /* Make up the required permissions for user code */
 #ifdef CONFIG_PTE_64BIT
-       li      r13,_PAGE_PRESENT | _PAGE_EXEC
+       li      r13,_PAGE_PRESENT | _PAGE_BAP_UX
        oris    r13,r13,_PAGE_ACCESSED@h
 #else
        li      r13,_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_EXEC
 #endif
 
+4:
        FIND_PTE
        andc.   r13,r13,r11             /* Check permission */