proc: CoW should work for pages with 2+ refs

This commit is contained in:
Mark
2020-11-01 14:33:09 +02:00
parent a971e0f15e
commit ebb9e012d6
+1 -2
View File
@@ -82,7 +82,7 @@ int do_pfault(struct amd64_exception_frame *frame, uintptr_t cr2, uintptr_t cr3)
panic("Write to non-CoW page triggered a page fault\n");
}
if (page->refcount == 2) {
if (page->refcount >= 2) {
//kdebug("[%d] Cloning page @ %p\n", proc->pid, cr2 & MM_PAGE_MASK);
uintptr_t new_phys = mm_phys_alloc_page(PU_PRIVATE);
_assert(new_phys != MM_NADDR);
@@ -269,7 +269,6 @@ void amd64_exception(struct amd64_exception_frame *frame) {
case X86_EXCEPTION_PF:
kerror("SIGSEGV in %d\n", thread_self->proc->pid);
exc_dump(DEBUG_DEFAULT, frame);
while (1);
thread_signal(thread_self, SIGSEGV);
return;
}