Changeset View
Changeset View
Standalone View
Standalone View
sys/amd64/amd64/exception.S
Show First 20 Lines • Show All 197 Lines • ▼ Show 20 Lines | alltraps_pushregs_no_rax: | ||||
movq %rbp,TF_RBP(%rsp) | movq %rbp,TF_RBP(%rsp) | ||||
movq %r10,TF_R10(%rsp) | movq %r10,TF_R10(%rsp) | ||||
movq %r11,TF_R11(%rsp) | movq %r11,TF_R11(%rsp) | ||||
movq %r12,TF_R12(%rsp) | movq %r12,TF_R12(%rsp) | ||||
movq %r13,TF_R13(%rsp) | movq %r13,TF_R13(%rsp) | ||||
movq %r14,TF_R14(%rsp) | movq %r14,TF_R14(%rsp) | ||||
movq %r15,TF_R15(%rsp) | movq %r15,TF_R15(%rsp) | ||||
movl $TF_HASSEGS,TF_FLAGS(%rsp) | movl $TF_HASSEGS,TF_FLAGS(%rsp) | ||||
cld | pushfq | ||||
andl $~(PSL_D | PSL_AC),(%rsp) | |||||
popfq | |||||
FAKE_MCOUNT(TF_RIP(%rsp)) | FAKE_MCOUNT(TF_RIP(%rsp)) | ||||
#ifdef KDTRACE_HOOKS | #ifdef KDTRACE_HOOKS | ||||
/* | /* | ||||
* DTrace Function Boundary Trace (fbt) probes are triggered | * DTrace Function Boundary Trace (fbt) probes are triggered | ||||
* by int3 (0xcc) which causes the #BP (T_BPTFLT) breakpoint | * by int3 (0xcc) which causes the #BP (T_BPTFLT) breakpoint | ||||
* interrupt. For all other trap types, just handle them in | * interrupt. For all other trap types, just handle them in | ||||
* the usual way. | * the usual way. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 64 Lines • ▼ Show 20 Lines | IDTVEC(dblfault) | ||||
movq %r13,TF_R13(%rsp) | movq %r13,TF_R13(%rsp) | ||||
movq %r14,TF_R14(%rsp) | movq %r14,TF_R14(%rsp) | ||||
movq %r15,TF_R15(%rsp) | movq %r15,TF_R15(%rsp) | ||||
movw %fs,TF_FS(%rsp) | movw %fs,TF_FS(%rsp) | ||||
movw %gs,TF_GS(%rsp) | movw %gs,TF_GS(%rsp) | ||||
movw %es,TF_ES(%rsp) | movw %es,TF_ES(%rsp) | ||||
movw %ds,TF_DS(%rsp) | movw %ds,TF_DS(%rsp) | ||||
movl $TF_HASSEGS,TF_FLAGS(%rsp) | movl $TF_HASSEGS,TF_FLAGS(%rsp) | ||||
cld | pushfq | ||||
andl $~(PSL_D | PSL_AC),(%rsp) | |||||
popfq | |||||
testb $SEL_RPL_MASK,TF_CS(%rsp) /* Did we come from kernel? */ | testb $SEL_RPL_MASK,TF_CS(%rsp) /* Did we come from kernel? */ | ||||
jz 1f /* already running with kernel GS.base */ | jz 1f /* already running with kernel GS.base */ | ||||
swapgs | swapgs | ||||
1: | 1: | ||||
movq %rsp,%rdi | movq %rsp,%rdi | ||||
call dblfault_handler | call dblfault_handler | ||||
2: | 2: | ||||
hlt | hlt | ||||
▲ Show 20 Lines • Show All 203 Lines • ▼ Show 20 Lines | IDTVEC(nmi) | ||||
movq %r13,TF_R13(%rsp) | movq %r13,TF_R13(%rsp) | ||||
movq %r14,TF_R14(%rsp) | movq %r14,TF_R14(%rsp) | ||||
movq %r15,TF_R15(%rsp) | movq %r15,TF_R15(%rsp) | ||||
movw %fs,TF_FS(%rsp) | movw %fs,TF_FS(%rsp) | ||||
movw %gs,TF_GS(%rsp) | movw %gs,TF_GS(%rsp) | ||||
movw %es,TF_ES(%rsp) | movw %es,TF_ES(%rsp) | ||||
movw %ds,TF_DS(%rsp) | movw %ds,TF_DS(%rsp) | ||||
movl $TF_HASSEGS,TF_FLAGS(%rsp) | movl $TF_HASSEGS,TF_FLAGS(%rsp) | ||||
cld | pushfq | ||||
andl $~(PSL_D | PSL_AC),(%rsp) | |||||
popfq | |||||
xorl %ebx,%ebx | xorl %ebx,%ebx | ||||
testb $SEL_RPL_MASK,TF_CS(%rsp) | testb $SEL_RPL_MASK,TF_CS(%rsp) | ||||
jnz nmi_fromuserspace | jnz nmi_fromuserspace | ||||
/* | /* | ||||
* We've interrupted the kernel. Preserve GS.base in %r12. | * We've interrupted the kernel. Preserve GS.base in %r12. | ||||
*/ | */ | ||||
movl $MSR_GSBASE,%ecx | movl $MSR_GSBASE,%ecx | ||||
rdmsr | rdmsr | ||||
▲ Show 20 Lines • Show All 454 Lines • Show Last 20 Lines |