Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F142185422
D49592.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
D49592.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
@@ -163,6 +163,9 @@
&uprintf_signal, 0,
"Print debugging information on trap signal to ctty");
+u_long cnt_efirt_faults;
+int print_efirt_faults = 1;
+
/*
* Control L1D flush on return from NMI.
*
@@ -431,8 +434,14 @@
*/
if ((td->td_pflags & TDP_EFIRT) != 0 &&
curpcb->pcb_onfault != NULL && type != T_PAGEFLT) {
- trap_diag(frame, 0);
- printf("EFI RT fault %s\n", traptype_to_msg(type));
+ u_long cnt = atomic_fetchadd_long(&cnt_efirt_faults, 1);
+
+ if ((print_efirt_faults == 1 && cnt == 1) ||
+ print_efirt_faults == 2) {
+ trap_diag(frame, 0);
+ printf("EFI RT fault %s\n",
+ traptype_to_msg(type));
+ }
frame->tf_rip = (long)curpcb->pcb_onfault;
return;
}
diff --git a/sys/arm64/arm64/trap.c b/sys/arm64/arm64/trap.c
--- a/sys/arm64/arm64/trap.c
+++ b/sys/arm64/arm64/trap.c
@@ -85,6 +85,9 @@
int (*dtrace_invop_jump_addr)(struct trapframe *);
+u_long cnt_efirt_faults;
+int print_efirt_faults;
+
typedef void (abort_handler)(struct thread *, struct trapframe *, uint64_t,
uint64_t, int);
diff --git a/sys/dev/efidev/efirt.c b/sys/dev/efidev/efirt.c
--- a/sys/dev/efidev/efirt.c
+++ b/sys/dev/efidev/efirt.c
@@ -123,11 +123,20 @@
}
static struct mtx efi_lock;
-static SYSCTL_NODE(_hw, OID_AUTO, efi, CTLFLAG_RWTUN | CTLFLAG_MPSAFE, NULL,
+SYSCTL_NODE(_hw, OID_AUTO, efi, CTLFLAG_RWTUN | CTLFLAG_MPSAFE, NULL,
"EFI");
static bool efi_poweroff = true;
SYSCTL_BOOL(_hw_efi, OID_AUTO, poweroff, CTLFLAG_RWTUN, &efi_poweroff, 0,
"If true, use EFI runtime services to power off in preference to ACPI");
+extern int print_efirt_faults;
+SYSCTL_INT(_hw_efi, OID_AUTO, print_faults, CTLFLAG_RWTUN,
+ &print_efirt_faults, 0,
+ "Print fault information upon trap from EFIRT calls: "
+ "0 - never, 1 - once, 2 - always");
+extern u_long cnt_efirt_faults;
+SYSCTL_ULONG(_hw_efi, OID_AUTO, total_faults, CTLFLAG_RD,
+ &cnt_efirt_faults, 0,
+ "Total number of faults that occurred during EFIRT calls");
static bool
efi_is_in_map(struct efi_md *map, int ndesc, int descsz, vm_offset_t addr)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jan 17, 11:23 PM (8 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27700831
Default Alt Text
D49592.diff (2 KB)
Attached To
Mode
D49592: efirt: add a tunable to disable printing faults during EFIRT calls
Attached
Detach File
Event Timeline
Log In to Comment