Call WITNESS_CHECK() in the page fault handler and immediately assume it
is a fatal fault if we are holding any non-sleepable locks. This should cut down on the number of bogus LORs we currently get when the kernel panics due to a NULL (or bogus) pointer dereference that goes wandering off into the VM system which tries to acquire locks and then kicks off the spurious LORs. This should probably be ported to all the archs at some point. Tested on: i386
This commit is contained in:
parent
ffaf2c55a8
commit
6966c33482
@ -237,8 +237,16 @@ trap(frame)
|
||||
* do the VM lookup, so just consider it a fatal trap so the
|
||||
* kernel can print out a useful trap message and even get
|
||||
* to the debugger.
|
||||
*
|
||||
* If we get a page fault while holding a non-sleepable
|
||||
* lock, then it is most likely a fatal kernel page fault.
|
||||
* If WITNESS is enabled, then it's going to whine about
|
||||
* bogus LORs with various VM locks, so just skip to the
|
||||
* fatal trap handling directly.
|
||||
*/
|
||||
if (td->td_critnest != 0)
|
||||
if (td->td_critnest != 0 ||
|
||||
WITNESS_CHECK(WARN_SLEEPOK | WARN_GIANTOK, NULL,
|
||||
"Kernel page fault") != 0)
|
||||
trap_fatal(&frame, frame.tf_addr);
|
||||
}
|
||||
|
||||
|
@ -265,12 +265,20 @@ trap(frame)
|
||||
* do the VM lookup, so just consider it a fatal trap so the
|
||||
* kernel can print out a useful trap message and even get
|
||||
* to the debugger.
|
||||
*
|
||||
* If we get a page fault while holding a non-sleepable
|
||||
* lock, then it is most likely a fatal kernel page fault.
|
||||
* If WITNESS is enabled, then it's going to whine about
|
||||
* bogus LORs with various VM locks, so just skip to the
|
||||
* fatal trap handling directly.
|
||||
*/
|
||||
eva = rcr2();
|
||||
if (td->td_critnest == 0)
|
||||
enable_intr();
|
||||
else
|
||||
if (td->td_critnest != 0 ||
|
||||
WITNESS_CHECK(WARN_SLEEPOK | WARN_GIANTOK, NULL,
|
||||
"Kernel page fault") != 0)
|
||||
trap_fatal(&frame, eva);
|
||||
else
|
||||
enable_intr();
|
||||
}
|
||||
|
||||
if ((ISPL(frame.tf_cs) == SEL_UPL) ||
|
||||
|
Loading…
Reference in New Issue
Block a user