Make MMAP_LOWEST_VA PAGE_SIZE; set ld.so mmap address
authorRonald G. Minnich <rminnich@gmail.com>
Thu, 27 Aug 2015 18:03:53 +0000 (11:03 -0700)
committerBarret Rhoden <brho@cs.berkeley.edu>
Mon, 2 Nov 2015 23:34:47 +0000 (18:34 -0500)
The ld.so constant is probably in the wrong place but we can
fix that.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/arch/x86/ros/mmu64.h
kern/include/mm.h
kern/src/elf.c

index 9e692be..f861491 100644 (file)
@@ -124,7 +124,11 @@ typedef struct x86_pgdir {
  *                     |                              |
  *                     |       ld.so (Dynamic)        |
  *                     |                              |
- * MMAP_LOWEST_VA      +------------------------------+ 0x0000000000100000
+ * MMAP_LD_FIXED_VA    +------------------------------+ 0x0000000000100000
+ *                     |                              |
+ *                     |                              |
+ *                     |                              |
+ * MMAP_LOWEST_VA      +------------------------------+ 0x0000000000001000
  *                     |                              |
  *                     |       Empty Memory (*)       |
  *                     |                              |
index 04bab7b..40914c0 100644 (file)
@@ -55,7 +55,8 @@ void print_vmrs(struct proc *p);
 /* mmap() related functions.  These manipulate VMRs and change the hardware page
  * tables.  Any requests below the LOWEST_VA will silently be upped.  This may
  * be a dynamic proc-specific variable later. */
-#define MMAP_LOWEST_VA MiB
+#define MMAP_LOWEST_VA PAGE_SIZE
+#define MMAP_LD_FIXED_VA 0x100000
 void *mmap(struct proc *p, uintptr_t addr, size_t len, int prot, int flags,
            int fd, size_t offset);
 void *do_mmap(struct proc *p, uintptr_t addr, size_t len, int prot, int flags,
index 3434a56..ddcac84 100644 (file)
@@ -371,7 +371,8 @@ int load_elf(struct proc* p, struct file* f,
                 * helped us waste a full day debugging a bug in the Go runtime. True!
                 * Note that MMAP_LOWEST_VA also has this value but we want to make this
                 * explicit. */
-               int error = load_one_elf(p, interp, MiB>>12, &interp_ei, TRUE);
+               int error = load_one_elf(p, interp, MMAP_LD_FIXED_VA >> PGSHIFT,
+                                        &interp_ei, TRUE);
                kref_put(&interp->f_kref);
                if (error)
                        return -1;