- 论坛徽章:
- 0
|
回复 5# omycle
我看的是X86下的 do_page_fault()函数……我的意思是内核空间的异常为什么只检查VMALLOC区,而像永久内核映射区这样的区域为什么不用做检查。。ARM架构下的我没有看过。。- if (unlikely(fault_in_kernel_space(address))) {
- if (!(error_code & (PF_RSVD | PF_USER | PF_PROT))) {
- if (vmalloc_fault(address) >= 0)
- return;
- if (kmemcheck_fault(regs, address, error_code))
- return;
- }
- /* Can handle a stale RO->RW TLB: */
- if (spurious_fault(error_code, address))
- return;
- /* kprobes don't want to hook the spurious faults: */
- if (notify_page_fault(regs))
- return;
- /*
- * Don't take the mm semaphore here. If we fixup a prefetch
- * fault we could otherwise deadlock:
- */
- bad_area_nosemaphore(regs, error_code, address);
- return;
- }
复制代码 |
|