git: ddabf7f3ea4f - main - amd64: Make EFI runtime faults look less like panics
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 28 Apr 2026 15:13:56 UTC
The branch main has been updated by emaste:
URL: https://cgit.FreeBSD.org/src/commit/?id=ddabf7f3ea4f0497dc5a5ffcbbb1d852ea77a4cd
commit ddabf7f3ea4f0497dc5a5ffcbbb1d852ea77a4cd
Author: Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2025-11-26 19:28:13 +0000
Commit: Ed Maste <emaste@FreeBSD.org>
CommitDate: 2026-04-28 15:11:46 +0000
amd64: Make EFI runtime faults look less like panics
EFI runtime faults may be mistaken for kernel panics, and do not
necessarily represent actual problems. Try to differentiate them some
more by printing "EFI runtime trap" rather than "Fatal trap".
PR: 291193
Reviewed by: kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56309
---
sys/amd64/amd64/trap.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c
index 359b3dfe3609..fb18b7d06f9e 100644
--- a/sys/amd64/amd64/trap.c
+++ b/sys/amd64/amd64/trap.c
@@ -104,7 +104,7 @@ void trap_check(struct trapframe *frame);
void dblfault_handler(struct trapframe *frame);
static int trap_pfault(struct trapframe *, bool, int *, int *);
-static void trap_diag(struct trapframe *, vm_offset_t);
+static void trap_diag(struct trapframe *, vm_offset_t, const char *);
static void trap_fatal(struct trapframe *, vm_offset_t);
#ifdef KDTRACE_HOOKS
static bool trap_user_dtrace(struct trapframe *,
@@ -238,7 +238,7 @@ trap_check_pcb_onfault(struct thread *td, struct trapframe *frame)
print_efirt_faults == 2) {
printf("EFI RT fault %s\n",
traptype_to_msg(frame->tf_trapno));
- trap_diag(frame, 0);
+ trap_diag(frame, 0, "EFI runtime");
}
res = true;
} else if (frame->tf_trapno == T_PAGEFLT) {
@@ -940,7 +940,7 @@ after_vmfault:
}
static void
-trap_diag(struct trapframe *frame, vm_offset_t eva)
+trap_diag(struct trapframe *frame, vm_offset_t eva, const char *type_str)
{
int code;
u_int type;
@@ -952,7 +952,7 @@ trap_diag(struct trapframe *frame, vm_offset_t eva)
gdt = *PCPU_PTR(gdt);
sdtossd(&gdt[IDXSEL(frame->tf_cs)], &softseg);
- printf("\n\nFatal trap %d: %s while in %s mode\n", type,
+ printf("\n%s trap %d: %s while in %s mode\n", type_str, type,
type < nitems(trap_msg) ? trap_msg[type] : UNKNOWN,
TRAPF_USERMODE(frame) ? "user" : "kernel");
/* Print these separately in case pcpu accesses trap. */
@@ -1013,7 +1013,7 @@ trap_fatal(struct trapframe *frame, vm_offset_t eva)
u_int type;
type = frame->tf_trapno;
- trap_diag(frame, eva);
+ trap_diag(frame, eva, "\nFatal");
#ifdef KDB
if (debugger_on_trap) {
bool handled;