If we get an unhandled page fault in kernel mode, either panic (if
pcb_onfault is not set) or arrange to restart at the location in pcb_onfault. This ought to help the stability of a system under moderate load. It certainly stops DDB from hanging the kernel when it tries to access a non-present page.
This commit is contained in:
parent
314a1d3362
commit
c0bfb6b8ea
@ -374,12 +374,13 @@ trap(int vector, int imm, struct trapframe *framep)
|
||||
* address against the address accessed by
|
||||
* [fs]uswintr, in case another fault happens
|
||||
* when they are running.
|
||||
*/
|
||||
*/
|
||||
if (!user &&
|
||||
td != NULL &&
|
||||
td->td_pcb->pcb_onfault == (unsigned long)fswintrberr &&
|
||||
td->td_pcb->pcb_accessaddr == va) {
|
||||
framep->tf_cr_iip = td->td_pcb->pcb_onfault;
|
||||
framep->tf_cr_ipsr &= ~IA64_PSR_RI;
|
||||
td->td_pcb->pcb_onfault = 0;
|
||||
goto out;
|
||||
}
|
||||
@ -487,6 +488,18 @@ trap(int vector, int imm, struct trapframe *framep)
|
||||
if (rv == KERN_SUCCESS)
|
||||
goto out;
|
||||
|
||||
if (!user) {
|
||||
/* Check for copyin/copyout fault */
|
||||
if (td != NULL &&
|
||||
td->td_pcb->pcb_onfault != 0) {
|
||||
framep->tf_cr_iip =
|
||||
td->td_pcb->pcb_onfault;
|
||||
framep->tf_cr_ipsr &= ~IA64_PSR_RI;
|
||||
td->td_pcb->pcb_onfault = 0;
|
||||
goto out;
|
||||
}
|
||||
goto dopanic;
|
||||
}
|
||||
ucode = va;
|
||||
i = SIGSEGV;
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user