]> Zhao Yanbai Git Server - minix.git/commitdiff
don't force vm to print to serial; don't kill processes when they
authorBen Gras <ben@minix3.org>
Thu, 11 Dec 2008 17:36:33 +0000 (17:36 +0000)
committerBen Gras <ben@minix3.org>
Thu, 11 Dec 2008 17:36:33 +0000 (17:36 +0000)
have 'bad' memory ranges (as it's the requestor's fault)

servers/vm/main.c
servers/vm/mmap.c
servers/vm/pagefaults.c

index 38756594cd75ba99cae2ec6bc19c7abf1ef0bc1f..cec3b0fa2bf1a8031e008752637c81e8204d697f 100644 (file)
@@ -340,9 +340,11 @@ PRIVATE void vm_init(void)
        CALLMAP(VM_VFS_REPLY_CLOSE, do_vfs_reply, VFS_PROC_NR);
 }
 
+#if 0
 void kputc(int c)
 {
        if(c == '\n')
                ser_putc('\r');
        ser_putc(c);
 }
+#endif
index 72224519518b2bf035e3ac0444b44beb3807f5e9..f519f9538d5a0ced32248e020a4f5f44d03c7bf1 100644 (file)
@@ -94,6 +94,7 @@ PUBLIC int do_map_phys(message *m)
        struct vmproc *vmp;
        endpoint_t target;
        struct vir_region *vr;
+       vir_bytes len;
 
        target = m->VMMP_EP;
        if(target == SELF)
@@ -107,8 +108,12 @@ PUBLIC int do_map_phys(message *m)
        if(!(vmp->vm_flags & VMF_HASPT))
                return ENXIO;
 
+       len = m->VMMP_LEN;
+       if(len % VM_PAGE_SIZE)
+               len += VM_PAGE_SIZE - (len % VM_PAGE_SIZE);
+
        if(!(vr = map_page_region(vmp, arch_vir2map(vmp, vmp->vm_stacktop),
-               VM_DATATOP, (vir_bytes) m->VMMP_LEN, (vir_bytes)m->VMMP_PHADDR,
+               VM_DATATOP, len, (vir_bytes)m->VMMP_PHADDR,
                VR_DIRECT | VR_NOPF | VR_WRITABLE, 0))) {
                return ENOMEM;
        }
index b6a2db28bb7e9dc32ea8e25ff47bda1ba0b2510a..ccfcb2036533bc994a7254779af2e30dc9660314 100644 (file)
@@ -159,20 +159,13 @@ PUBLIC void handle_memory(void)
                }
 
                if(r != OK) {
-                       printf("VM: SIGSEGV %d, memory range not available\n",
+                       printf("VM: memory range 0x%lx-0x%lx not available in %d\n",
+                               arch_map2vir(vmp, mem), arch_map2vir(vmp, mem+len),
                                vmp->vm_endpoint);
-                       if((s=sys_kill(vmp->vm_endpoint, SIGSEGV)) != OK)
-                               vm_panic("sys_kill failed", s);
                }
 
                if(sys_vmctl(who, VMCTL_MEMREQ_REPLY, r) != OK)
                        vm_panic("handle_memory: sys_vmctl failed", r);
-
-               if(r != OK) {
-                       printf("VM: killing %d\n", vmp->vm_endpoint);
-                       if((s=sys_kill(vmp->vm_endpoint, SIGSEGV)) != OK)
-                               vm_panic("sys_kill failed", s);
-               }
        }
 }