Changeset View
Changeset View
Standalone View
Standalone View
head/sys/amd64/amd64/trap.c
Show First 20 Lines • Show All 455 Lines • ▼ Show 20 Lines | case T_SEGNPFLT: /* segment not present fault */ | ||||
* survive for too long. Switch to the normal | * survive for too long. Switch to the normal | ||||
* thread stack for the trap handling. | * thread stack for the trap handling. | ||||
* | * | ||||
* Magic '5' is the number of qwords occupied by | * Magic '5' is the number of qwords occupied by | ||||
* the hardware trap frame. | * the hardware trap frame. | ||||
*/ | */ | ||||
if (frame->tf_rip == (long)doreti_iret) { | if (frame->tf_rip == (long)doreti_iret) { | ||||
frame->tf_rip = (long)doreti_iret_fault; | frame->tf_rip = (long)doreti_iret_fault; | ||||
if (pti && frame->tf_rsp == (uintptr_t)PCPU_PTR( | if ((PCPU_GET(curpmap)->pm_ucr3 != | ||||
pti_stack) + (PC_PTI_STACK_SZ - 5) * | PMAP_NO_CR3) && | ||||
sizeof(register_t)) | (frame->tf_rsp == (uintptr_t)PCPU_GET( | ||||
pti_rsp0) - 5 * sizeof(register_t))) { | |||||
frame->tf_rsp = PCPU_GET(rsp0) - 5 * | frame->tf_rsp = PCPU_GET(rsp0) - 5 * | ||||
sizeof(register_t); | sizeof(register_t); | ||||
} | |||||
return; | return; | ||||
} | } | ||||
if (frame->tf_rip == (long)ld_ds) { | if (frame->tf_rip == (long)ld_ds) { | ||||
frame->tf_rip = (long)ds_load_fault; | frame->tf_rip = (long)ds_load_fault; | ||||
return; | return; | ||||
} | } | ||||
if (frame->tf_rip == (long)ld_es) { | if (frame->tf_rip == (long)ld_es) { | ||||
frame->tf_rip = (long)es_load_fault; | frame->tf_rip = (long)es_load_fault; | ||||
▲ Show 20 Lines • Show All 504 Lines • Show Last 20 Lines |