struct vmproc *vmp;
endpoint_t target;
struct vir_region *vr;
+ vir_bytes len;
target = m->VMMP_EP;
if(target == SELF)
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;
}
}
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);
- }
}
}