added NOVPT option to disable VPT/UVPT mappings
authorAndrew Waterman <waterman@s141.Millennium.Berkeley.EDU>
Wed, 1 Jun 2011 11:21:47 +0000 (04:21 -0700)
committerKevin Klues <klueska@cs.berkeley.edu>
Thu, 3 Nov 2011 00:36:03 +0000 (17:36 -0700)
kern/arch/riscv/ros/mmu.h
kern/src/env.c

index 1cd34c5..89fdf6f 100644 (file)
@@ -30,6 +30,8 @@
 
 #define PGSIZE (1 << PGSHIFT)
 
+#define NOVPT
+
 #ifndef __ASSEMBLER__
 typedef unsigned long pte_t;
 typedef unsigned long pde_t;
index b343eb7..17abc26 100644 (file)
@@ -71,8 +71,10 @@ WRITES(e->env_pgdir, e->env_cr3, e->procinfo, e->procdata)
 
        // VPT and UVPT map the env's own page table, with
        // different permissions.
+       #ifndef NOVPT
        e->env_pgdir[PDX(VPT)]  = PTE(LA2PPN(e->env_cr3), PTE_P | PTE_KERN_RW);
        e->env_pgdir[PDX(UVPT)] = PTE(LA2PPN(e->env_cr3), PTE_P | PTE_USER_RO);
+       #endif
 
        /* These need to be contiguous, so the kernel can alias them.  Note the
         * pages return with a refcnt, but it's okay to insert them since we free