. if there is no memory there, it's not writable; this
check bug by the shared memory's writable() method causes
pagefaults not to be handled at all in certain situations,
triggering an assert() in pt_writemap()
. added some assert()s to catch this and similar situations
in the future
Change-Id: Ife89bfab4f9a3aa7bf4e33dfb0b13b89dcd5bb94
static int anon_writable(struct phys_region *pr)
{
assert(pr->ph->refcount > 0);
+ if(pr->ph->phys == MAP_NONE)
+ return 0;
if(pr->parent->remaps > 0)
return 1;
- return pr->ph->phys != MAP_NONE && pr->ph->refcount == 1;
+ return pr->ph->refcount == 1;
}
static int anon_resize(struct vmproc *vmp, struct vir_region *vr, vir_bytes l)
assert(ph);
assert(ph->ph);
+ assert(ph->ph->phys != MAP_NONE);
}
assert(ph->ph);
+ assert(ph->ph->phys != MAP_NONE);
if((r = map_ph_writept(vmp, region, ph)) != OK) {
printf("map_pf: writept failed\n");