Linux????????--??????
???????????? ???????[ 2012/8/16 11:09:30 ] ????????
/*
* Ok?? we have a good vm_area for this memory access?? so
* we can handle it..
*/
good_area:
write = error_code & PF_WRITE;
/*???????????????bad_area_access_error()??????ú??????__bad_area()???????????
?????????????????SEGV_ACCERR*/
if (unlikely(access_error(error_code?? write?? vma))) {
bad_area_access_error(regs?? error_code?? address);
return;
}
/*
* If for any reason at all we couldn't handle the fault??
* make sure we exit gracefully rather than endlessly redo
* the fault:
*/
/*?????μ????????*/
fault = handle_mm_fault(mm?? vma?? address?? write ? FAULT_FLAG_WRITE : 0);
if (unlikely(fault & VM_FAULT_ERROR)) {
mm_fault_error(regs?? error_code?? address?? fault);
return;
}
if (fault & VM_FAULT_MAJOR) {
tsk->maj_flt++;
perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ?? 1?? 0??
regs?? address);
} else {
tsk->min_flt++;
perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN?? 1?? 0??
regs?? address);
}
check_v8086_mode(regs?? address?? tsk);
up_read(&mm->mmap_sem);
}
????bad_area()?????????庯???__bad_area()-->__bad_area_nosemaphore()????????????????????з????????????????????????????????????????????????
__bad_area_nosemaphore(struct pt_regs *regs?? unsigned long error_code??
unsigned long address?? int si_code)
{
struct task_struct *tsk = current;
/* User mode accesses just cause a SIGSEGV */
/*???????????????????????????????SIGSEG???V*/
if (error_code & PF_USER) {
/*
* It's possible to have interrupts off here:
*/
local_irq_enable();
/*
* Valid to do another page fault here because this one came
* from user space:
*/
if (is_prefetch(regs?? error_code?? address))
return;
if (is_errata100(regs?? address))
return;
if (unlikely(show_unhandled_signals))
show_signal_msg(regs?? error_code?? address?? tsk);
??????
???·???
??????????????????
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