Commit 82f28080 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 0d10ef28
......@@ -96,8 +96,8 @@ LINKC = $(LINK.c) $< $(LOADLIBES) $(LDLIBS) -o $@
# tests without instrumentation
test.t : $(TESTS:%=%.trun)
%.trun : %.t
#gdb -q -ex run -ex backtrace -ex quit $(XRUN<)
$(XRUN<)
gdb -q -ex run -ex backtrace -ex quit $(XRUN<)
#$(XRUN<)
%.t : %.c $(ccan_config)
$(LINKC)
......
......@@ -806,32 +806,12 @@ VMFaultResult vma_on_pagefault(VMA *vma, uintptr_t addr, int write)
/* (6) page data ready. Mmap it atomically into vma address space, or mprotect
* appropriately if it was already mmaped. */
int prot = PROT_READ;
PageState newstate = PAGE_LOADED; // XXX vvv PAGE_LOADED_FOR_WRITE ok?
if (write || page->state == PAGE_DIRTY || page->state == PAGE_LOADED_FOR_WRITE) {
prot |= PROT_WRITE;
newstate = PAGE_DIRTY;
}
// XXX overlay: assert !vma->page_ismappedv[blk] XXX not ok? (retrying after virt unlock/lock)
// XXX mmap page to all vma with .mmap_overlay=1 of this fileh.
vma_mmap_page(vma, page);
#if 0
if (!bitmap_test_bit(vma->page_ismappedv, page->f_pgoffset - vma->f_pgoffset)) {
// XXX err
page_mmap(page, vma_page_addr(vma, page), prot);
bitmap_set_bit(vma->page_ismappedv, page->f_pgoffset - vma->f_pgoffset);
page_incref(page);
}
else {
/* just changing protection bits should not fail, if parameters ok */
xmprotect(vma_page_addr(vma, page), page_size(page), prot);
}
#endif
// XXX also call page->markdirty() ?
// XXX move ^^^ before vma_mmap_page
if (newstate == PAGE_DIRTY && newstate != page->state) {
/* it is not allowed to modify pages while writeout is in progress */
BUG_ON(fileh->writeout_inprogress);
......@@ -840,6 +820,11 @@ VMFaultResult vma_on_pagefault(VMA *vma, uintptr_t addr, int write)
}
page->state = max(page->state, newstate);
// XXX overlay: assert !vma->page_ismappedv[blk] XXX not ok? (retrying after virt unlock/lock)
// XXX mmap page to all vma with .mmap_overlay=1 of this fileh.
vma_mmap_page(vma, page);
/* mark page as used recently */
// XXX = list_move_tail()
list_del(&page->lru);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment