From: Ben Gras Date: Thu, 11 Dec 2008 17:36:33 +0000 (+0000) Subject: don't force vm to print to serial; don't kill processes when they X-Git-Tag: v3.1.4~175 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/cppcheck-error.log?a=commitdiff_plain;h=e4e3995fb00af2642eaccd2f8e5f21e624a3941f;p=minix.git don't force vm to print to serial; don't kill processes when they have 'bad' memory ranges (as it's the requestor's fault) --- diff --git a/servers/vm/main.c b/servers/vm/main.c index 38756594c..cec3b0fa2 100644 --- a/servers/vm/main.c +++ b/servers/vm/main.c @@ -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 diff --git a/servers/vm/mmap.c b/servers/vm/mmap.c index 722245195..f519f9538 100644 --- a/servers/vm/mmap.c +++ b/servers/vm/mmap.c @@ -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; } diff --git a/servers/vm/pagefaults.c b/servers/vm/pagefaults.c index b6a2db28b..ccfcb2036 100644 --- a/servers/vm/pagefaults.c +++ b/servers/vm/pagefaults.c @@ -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); - } } }