Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F163321582
D55808.id173556.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D55808.id173556.diff
View Options
diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c
--- a/sys/amd64/amd64/trap.c
+++ b/sys/amd64/amd64/trap.c
@@ -218,6 +218,30 @@
fubyte((void *)(frame->tf_rip + 7)));
}
+static bool
+trap_check_efirt(struct thread *td, struct trapframe *frame)
+{
+ /*
+ * Most likely, EFI RT faulted. This check prevents
+ * kdb from handling breakpoints set on the BIOS text,
+ * if such option is ever needed.
+ */
+ if ((td->td_pflags & TDP_EFIRT) != 0 &&
+ curpcb->pcb_onfault != NULL) {
+ u_long cnt = atomic_fetchadd_long(&cnt_efirt_faults, 1);
+
+ if ((print_efirt_faults == 1 && cnt == 0) ||
+ print_efirt_faults == 2) {
+ printf("EFI RT fault %s\n",
+ traptype_to_msg(frame->tf_trapno));
+ trap_diag(frame, 0);
+ }
+ frame->tf_rip = (long)curpcb->pcb_onfault;
+ return (true);
+ }
+ return (false);
+}
+
/*
* Table of handlers for various segment load faults.
*/
@@ -465,24 +489,8 @@
KASSERT(cold || td->td_ucred != NULL,
("kernel trap doesn't have ucred"));
- /*
- * Most likely, EFI RT faulted. This check prevents
- * kdb from handling breakpoints set on the BIOS text,
- * if such option is ever needed.
- */
- if ((td->td_pflags & TDP_EFIRT) != 0 &&
- curpcb->pcb_onfault != NULL && type != T_PAGEFLT) {
- u_long cnt = atomic_fetchadd_long(&cnt_efirt_faults, 1);
-
- if ((print_efirt_faults == 1 && cnt == 0) ||
- print_efirt_faults == 2) {
- printf("EFI RT fault %s\n",
- traptype_to_msg(type));
- trap_diag(frame, 0);
- }
- frame->tf_rip = (long)curpcb->pcb_onfault;
+ if (type != T_PAGEFLT && trap_check_efirt(td, frame))
return;
- }
switch (type) {
case T_PAGEFLT: /* page fault */
@@ -891,19 +899,8 @@
return (1);
after_vmfault:
if (td->td_intr_nesting_level == 0 &&
- curpcb->pcb_onfault != NULL) {
- if ((td->td_pflags & TDP_EFIRT) != 0) {
- u_long cnt = atomic_fetchadd_long(&cnt_efirt_faults, 1);
-
- if ((print_efirt_faults == 1 && cnt == 0) ||
- print_efirt_faults == 2) {
- printf("EFI RT page fault\n");
- trap_diag(frame, eva);
- }
- }
- frame->tf_rip = (long)curpcb->pcb_onfault;
+ trap_check_efirt(td, frame))
return (0);
- }
trap_fatal(frame, eva);
return (-1);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jul 23, 2:33 AM (19 h, 15 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35364333
Default Alt Text
D55808.id173556.diff (2 KB)
Attached To
Mode
D55808: amd64: move efirt trap checks into the helper
Attached
Detach File
Event Timeline
Log In to Comment