mirror of
https://github.com/opnsense/src.git
synced 2026-02-18 18:20:26 -05:00
efirt: add a tunable to disable printing faults during EFIRT calls
PR: 285797 (cherry picked from commit fd748c7d5b7aefbeda604403f203637b12ae89df)
This commit is contained in:
parent
8c6540b94d
commit
e6a470ffcb
3 changed files with 24 additions and 3 deletions
|
|
@ -165,6 +165,9 @@ SYSCTL_INT(_machdep, OID_AUTO, uprintf_signal, CTLFLAG_RWTUN,
|
|||
&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.
|
||||
*
|
||||
|
|
@ -453,8 +456,14 @@ trap(struct trapframe *frame)
|
|||
*/
|
||||
if ((td->td_pflags2 & TDP2_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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,6 +85,9 @@ static void print_registers(struct trapframe *frame);
|
|||
|
||||
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);
|
||||
|
||||
|
|
|
|||
|
|
@ -123,11 +123,20 @@ efi_status_to_errno(efi_status status)
|
|||
}
|
||||
|
||||
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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue