From 00ea1bdfe3d0758dc42942c5994664c51badf2f8 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Mon, 9 Mar 2015 17:27:27 +0100 Subject: Remove kernel region pf handlers ; fix forget-to-zero-out bug. --- src/kernel/user/process.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/kernel/user/process.c') diff --git a/src/kernel/user/process.c b/src/kernel/user/process.c index d8f1eed..4d79327 100644 --- a/src/kernel/user/process.c +++ b/src/kernel/user/process.c @@ -682,8 +682,14 @@ void proc_usermem_pf(void* p, registers_t *regs, void* addr) { current_process_exit(PS_FAILURE, (addr < (void*)PAGE_SIZE ? FAIL_ZEROPTR : FAIL_SEGFAULT)); } - bool pr = ((regs->err_code & PF_PRESENT_BIT) != 0); - ASSERT(!pr); + bool pr = (regs->err_code & PF_PRESENT_BIT) != 0; + if (pr) { + uint32_t frame = pd_get_entry(addr); + dbg_printf("UPF 0x%p %s present %d 0x%p\n", + addr, (wr ? "write" : "read"), + frame >> PTE_FRAME_SHIFT, frame); + PANIC("Unexpected fault on present page."); + } addr = (void*)((uint32_t)addr & PAGE_MASK); -- cgit v1.2.3