mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 03:57:43 +00:00
Kernel: Move kernel region checks from x86 page fault handler to MM
Ideally the x86 fault handler would only do x86 specific things and delegate the rest of the work to MemoryManager. This patch moves some of the address checks to a more generic place.
This commit is contained in:
parent
5092813a45
commit
a12e19c015
2 changed files with 17 additions and 16 deletions
|
@ -327,22 +327,6 @@ void page_fault_handler(TrapFrame* trap)
|
|||
return handle_crash(regs, "Bad stack on page fault", SIGSEGV);
|
||||
}
|
||||
|
||||
if (fault_address >= (FlatPtr)&start_of_ro_after_init && fault_address < (FlatPtr)&end_of_ro_after_init) {
|
||||
dump(regs);
|
||||
PANIC("Attempt to write into READONLY_AFTER_INIT section");
|
||||
}
|
||||
|
||||
if (fault_address >= (FlatPtr)&start_of_unmap_after_init && fault_address < (FlatPtr)&end_of_unmap_after_init) {
|
||||
dump(regs);
|
||||
auto sym = symbolicate_kernel_address(fault_address);
|
||||
PANIC("Attempt to access UNMAP_AFTER_INIT section ({:p}: {})", fault_address, sym ? sym->name : "(Unknown)");
|
||||
}
|
||||
|
||||
if (fault_address >= (FlatPtr)&start_of_kernel_ksyms && fault_address < (FlatPtr)&end_of_kernel_ksyms) {
|
||||
dump(regs);
|
||||
PANIC("Attempt to access KSYMS section");
|
||||
}
|
||||
|
||||
PageFault fault { regs.exception_code, VirtualAddress { fault_address } };
|
||||
auto response = MM.handle_page_fault(fault);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue