summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2006-01-27 22:22:10 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2006-01-27 22:22:10 +0000
commit6966c3348250222dd3b3930f240e3d257f099f13 (patch)
treeb958d406e447d5697f7c06646b409b17192173b4
parentffaf2c55a856876601049d913fc58414ab024f98 (diff)
Notes
-rw-r--r--sys/amd64/amd64/trap.c10
-rw-r--r--sys/i386/i386/trap.c14
2 files changed, 20 insertions, 4 deletions
diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c
index acd6140d5f47..6a8195b292b7 100644
--- a/sys/amd64/amd64/trap.c
+++ b/sys/amd64/amd64/trap.c
@@ -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);
}
diff --git a/sys/i386/i386/trap.c b/sys/i386/i386/trap.c
index d392374d77a0..928c716b6b6c 100644
--- a/sys/i386/i386/trap.c
+++ b/sys/i386/i386/trap.c
@@ -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) ||