mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-31 16:57:10 +00:00
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
e6d808aee3
commit
45740e15b4
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=85438
@ -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…
Reference in New Issue
Block a user