Linux????????--??????
???????????? ???????[ 2012/8/16 11:09:30 ] ????????
/* Kernel addresses are always protection faults: */
tsk->thread.cr2 = address;
tsk->thread.error_code = error_code | (address >= TASK_SIZE);
tsk->thread.trap_no = 14;
force_sig_info_fault(SIGSEGV?? si_code?? address?? tsk);
return;
}
...
...
}
???????????????????????????????????o????good_area·???????????????????·???????????????????????????????????????????????handle_mm_fault()?????????
int handle_mm_fault(struct mm_struct *mm?? struct vm_area_struct *vma??
unsigned long address?? unsigned int flags)
{
pgd_t *pgd;
pud_t *pud;
pmd_t *pmd;
pte_t *pte;
__set_current_state(TASK_RUNNING);
count_vm_event(PGFAULT);
if (unlikely(is_vm_hugetlb_page(vma)))
return hugetlb_fault(mm?? vma?? address?? flags);
pgd = pgd_offset(mm?? address);
pud = pud_alloc(mm?? pgd?? address);//????pud??
if (!pud)
return VM_FAULT_OOM;
pmd = pmd_alloc(mm?? pud?? address);//????pmd??
if (!pmd)
return VM_FAULT_OOM;
pte = pte_alloc_map(mm?? pmd?? address);//????pte??
if (!pte)
return VM_FAULT_OOM;
/*handle_pte_fault()?????????pte???μ???????????pte?????????????????????*/
return handle_pte_fault(mm?? vma?? address?? pte?? pmd?? flags);
}
????handle_pte_fault()?????????????????????????pte??????????????????????????????????????????????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11