Changeset View
Changeset View
Standalone View
Standalone View
sys/amd64/amd64/trap.c
| Show First 20 Lines • Show All 157 Lines • ▼ Show 20 Lines | return (type < nitems(trap_msg) ? trap_msg[type] : | ||||
| "unknown/reserved trap"); | "unknown/reserved trap"); | ||||
| } | } | ||||
| static int uprintf_signal; | static int uprintf_signal; | ||||
| SYSCTL_INT(_machdep, OID_AUTO, uprintf_signal, CTLFLAG_RWTUN, | SYSCTL_INT(_machdep, OID_AUTO, uprintf_signal, CTLFLAG_RWTUN, | ||||
| &uprintf_signal, 0, | &uprintf_signal, 0, | ||||
| "Print debugging information on trap signal to ctty"); | "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. | * Control L1D flush on return from NMI. | ||||
| * | * | ||||
| * Tunable can be set to the following values: | * Tunable can be set to the following values: | ||||
| * 0 - only enable flush on return from NMI if required by vmm.ko (default) | * 0 - only enable flush on return from NMI if required by vmm.ko (default) | ||||
| * >1 - always flush on return from NMI. | * >1 - always flush on return from NMI. | ||||
| * | * | ||||
| * Post-boot, the sysctl indicates if flushing is currently enabled. | * Post-boot, the sysctl indicates if flushing is currently enabled. | ||||
| ▲ Show 20 Lines • Show All 252 Lines • ▼ Show 20 Lines | #endif | ||||
| /* | /* | ||||
| * Most likely, EFI RT faulted. This check prevents | * Most likely, EFI RT faulted. This check prevents | ||||
| * kdb from handling breakpoints set on the BIOS text, | * kdb from handling breakpoints set on the BIOS text, | ||||
| * if such option is ever needed. | * if such option is ever needed. | ||||
| */ | */ | ||||
| if ((td->td_pflags & TDP_EFIRT) != 0 && | if ((td->td_pflags & TDP_EFIRT) != 0 && | ||||
| curpcb->pcb_onfault != NULL && type != T_PAGEFLT) { | curpcb->pcb_onfault != NULL && type != T_PAGEFLT) { | ||||
| 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); | trap_diag(frame, 0); | ||||
| printf("EFI RT fault %s\n", traptype_to_msg(type)); | printf("EFI RT fault %s\n", | ||||
| traptype_to_msg(type)); | |||||
| } | |||||
| frame->tf_rip = (long)curpcb->pcb_onfault; | frame->tf_rip = (long)curpcb->pcb_onfault; | ||||
| return; | return; | ||||
| } | } | ||||
| switch (type) { | switch (type) { | ||||
| case T_PAGEFLT: /* page fault */ | case T_PAGEFLT: /* page fault */ | ||||
| (void)trap_pfault(frame, false, NULL, NULL); | (void)trap_pfault(frame, false, NULL, NULL); | ||||
| return; | return; | ||||
| ▲ Show 20 Lines • Show All 798 Lines • Show Last 20 Lines | |||||