Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik...
[pandora-kernel.git] / arch / um / kernel / skas / mmu.c
index 677871f..2c6d090 100644 (file)
@@ -3,7 +3,6 @@
  * Licensed under the GPL
  */
 
-#include "linux/config.h"
 #include "linux/sched.h"
 #include "linux/list.h"
 #include "linux/spinlock.h"
@@ -55,14 +54,13 @@ static int init_stub_pte(struct mm_struct *mm, unsigned long proc,
         * destroy_context_skas.
         */
 
-        mm->context.skas.last_page_table = pmd_page_kernel(*pmd);
+        mm->context.skas.last_page_table = pmd_page_vaddr(*pmd);
 #ifdef CONFIG_3_LEVEL_PGTABLES
         mm->context.skas.last_pmd = (unsigned long) __va(pud_val(*pud));
 #endif
 
        *pte = mk_pte(virt_to_page(kernel), __pgprot(_PAGE_PRESENT));
-       *pte = pte_mkexec(*pte);
-       *pte = pte_wrprotect(*pte);
+       *pte = pte_mkread(*pte);
        return(0);
 
  out_pmd:
@@ -78,7 +76,7 @@ int init_new_context_skas(struct task_struct *task, struct mm_struct *mm)
        struct mmu_context_skas *from_mm = NULL;
        struct mmu_context_skas *to_mm = &mm->context.skas;
        unsigned long stack = 0;
-       int from_fd, ret = -ENOMEM;
+       int ret = -ENOMEM;
 
        if(skas_needs_stub){
                stack = get_zeroed_page(GFP_KERNEL);
@@ -108,11 +106,7 @@ int init_new_context_skas(struct task_struct *task, struct mm_struct *mm)
                from_mm = &current->mm->context.skas;
 
        if(proc_mm){
-               if(from_mm)
-                       from_fd = from_mm->id.u.mm_fd;
-               else from_fd = -1;
-
-               ret = new_mm(from_fd, stack);
+               ret = new_mm(stack);
                if(ret < 0){
                        printk("init_new_context_skas - new_mm failed, "
                               "errno = %d\n", ret);
@@ -156,7 +150,7 @@ void destroy_context_skas(struct mm_struct *mm)
                free_page(mmu->id.stack);
                pte_lock_deinit(virt_to_page(mmu->last_page_table));
                pte_free_kernel((pte_t *) mmu->last_page_table);
-                dec_page_state(nr_page_table_pages);
+               dec_zone_page_state(virt_to_page(mmu->last_page_table), NR_PAGETABLE);
 #ifdef CONFIG_3_LEVEL_PGTABLES
                pmd_free((pmd_t *) mmu->last_pmd);
 #endif