Author: bonefish Date: 2010-01-13 19:21:36 +0100 (Wed, 13 Jan 2010) New Revision: 35056 Changeset: http://dev.haiku-os.org/changeset/35056/haiku Modified: haiku/trunk/src/system/kernel/vm/vm.cpp Log: Added TODOs. Modified: haiku/trunk/src/system/kernel/vm/vm.cpp =================================================================== --- haiku/trunk/src/system/kernel/vm/vm.cpp 2010-01-13 17:20:01 UTC (rev 35055) +++ haiku/trunk/src/system/kernel/vm/vm.cpp 2010-01-13 18:21:36 UTC (rev 35056) @@ -2135,6 +2135,8 @@ map->ops->flush(map); status = map->ops->query(map, virtualAddress, &physicalAddress, &flags); +// TODO: The x86 implementation always returns 0 flags, if the entry is not +// present. I.e. we've already lost the flag. if ((flags & PAGE_MODIFIED) != 0) page->modified = true; } @@ -2213,6 +2215,11 @@ &physicalAddress, &flags); if (status < B_OK || (flags & PAGE_PRESENT) == 0) continue; +// TODO: We just unmapped the pages, so the PAGE_PRESENT flag won't be set for +// sure. We can't just remove the check, though, since then we might also find +// pages that we haven't unmapped in the first place. Finally the x86 query() +// implementation always returns 0 flags, if the entry is not present. I.e. +// we've already lost the flag. vm_page* page = vm_lookup_page(physicalAddress / B_PAGE_SIZE); if (page == NULL) { @@ -4532,6 +4539,14 @@ uint32 protection; status = map->ops->query(map, base, &physicalAddress, &protection); + // TODO: ATM there's no mechanism that guarantees that the page + // we've marked wired in lock_memory_etc() is the one we find here. + // If we only locked for reading, the original page might stem from + // a lower cache and a page fault in the meantime might have mapped + // a page from the top cache. + // Moreover fork() can insert a new top cache and re-map pages + // read-only at any time. This would even cause a violation of the + // lock_memory() guarantee. map->ops->unlock(map);