Changeset View
Changeset View
Standalone View
Standalone View
sys/i386/i386/exception.s
Show First 20 Lines • Show All 304 Lines • ▼ Show 20 Lines | 1: popl %eax | ||||
movl %eax, %cr3 | movl %eax, %cr3 | ||||
FAKE_MCOUNT(TF_EIP(%esp)) | FAKE_MCOUNT(TF_EIP(%esp)) | ||||
testl $PSL_VM, TF_EFLAGS(%esp) | testl $PSL_VM, TF_EFLAGS(%esp) | ||||
jnz dbg_user | jnz dbg_user | ||||
testb $SEL_RPL_MASK,TF_CS(%esp) | testb $SEL_RPL_MASK,TF_CS(%esp) | ||||
jz calltrap | jz calltrap | ||||
dbg_user: | dbg_user: | ||||
NMOVE_STACKS | NMOVE_STACKS | ||||
movl $handle_ibrs_entry,%eax | |||||
call *%eax | |||||
pushl %esp | pushl %esp | ||||
movl $trap,%eax | movl $trap,%eax | ||||
call *%eax | call *%eax | ||||
add $4, %esp | add $4, %esp | ||||
movl $T_RESERVED, TF_TRAPNO(%esp) | movl $T_RESERVED, TF_TRAPNO(%esp) | ||||
MEXITCOUNT | MEXITCOUNT | ||||
jmp doreti | jmp doreti | ||||
Show All 11 Lines | nmi_mchk_common: | ||||
cld | cld | ||||
/* | /* | ||||
* Save %cr3 into tf_err. There is no good place to put it. | * Save %cr3 into tf_err. There is no good place to put it. | ||||
* Always reload %cr3, since we might have interrupted the | * Always reload %cr3, since we might have interrupted the | ||||
* kernel entry or exit. | * kernel entry or exit. | ||||
* Do not switch to the thread kernel stack, otherwise we might | * Do not switch to the thread kernel stack, otherwise we might | ||||
* obliterate the previous context partially copied from the | * obliterate the previous context partially copied from the | ||||
* trampoline stack. | * trampoline stack. | ||||
* Do not re-enable IBRS, there is no good place to store | |||||
* previous state if we come from the kernel. | |||||
*/ | */ | ||||
movl %cr3, %eax | movl %cr3, %eax | ||||
movl %eax, TF_ERR(%esp) | movl %eax, TF_ERR(%esp) | ||||
call 1f | call 1f | ||||
1: popl %eax | 1: popl %eax | ||||
movl (tramp_idleptd - 1b)(%eax), %eax | movl (tramp_idleptd - 1b)(%eax), %eax | ||||
movl %eax, %cr3 | movl %eax, %cr3 | ||||
FAKE_MCOUNT(TF_EIP(%esp)) | FAKE_MCOUNT(TF_EIP(%esp)) | ||||
Show All 11 Lines | */ | ||||
SUPERALIGN_TEXT | SUPERALIGN_TEXT | ||||
IDTVEC(int0x80_syscall) | IDTVEC(int0x80_syscall) | ||||
pushl $2 /* sizeof "int 0x80" */ | pushl $2 /* sizeof "int 0x80" */ | ||||
pushl $0 /* tf_trapno */ | pushl $0 /* tf_trapno */ | ||||
PUSH_FRAME2 | PUSH_FRAME2 | ||||
SET_KERNEL_SREGS | SET_KERNEL_SREGS | ||||
cld | cld | ||||
MOVE_STACKS | MOVE_STACKS | ||||
movl $handle_ibrs_entry,%eax | |||||
call *%eax | |||||
sti | sti | ||||
FAKE_MCOUNT(TF_EIP(%esp)) | FAKE_MCOUNT(TF_EIP(%esp)) | ||||
pushl %esp | pushl %esp | ||||
movl $syscall, %eax | movl $syscall, %eax | ||||
call *%eax | call *%eax | ||||
add $4, %esp | add $4, %esp | ||||
MEXITCOUNT | MEXITCOUNT | ||||
jmp doreti | jmp doreti | ||||
▲ Show 20 Lines • Show All 129 Lines • ▼ Show 20 Lines | doreti_exit: | ||||
je doreti_iret_nmi | je doreti_iret_nmi | ||||
movl $TF_SZ, %ecx | movl $TF_SZ, %ecx | ||||
testl $PSL_VM,TF_EFLAGS(%esp) | testl $PSL_VM,TF_EFLAGS(%esp) | ||||
jz 1f /* PCB_VM86CALL is not set */ | jz 1f /* PCB_VM86CALL is not set */ | ||||
addl $VM86_STACK_SPACE, %ecx | addl $VM86_STACK_SPACE, %ecx | ||||
jmp 2f | jmp 2f | ||||
1: testl $SEL_RPL_MASK, TF_CS(%esp) | 1: testl $SEL_RPL_MASK, TF_CS(%esp) | ||||
jz doreti_popl_fs | jz doreti_popl_fs | ||||
2: movl %esp, %esi | 2: movl $handle_ibrs_exit,%eax | ||||
call *%eax | |||||
movl %esp, %esi | |||||
movl PCPU(TRAMPSTK), %edx | movl PCPU(TRAMPSTK), %edx | ||||
subl %ecx, %edx | subl %ecx, %edx | ||||
movl %edx, %edi | movl %edx, %edi | ||||
rep; movsb | rep; movsb | ||||
movl %edx, %esp | movl %edx, %esp | ||||
movl PCPU(CURPCB),%eax | movl PCPU(CURPCB),%eax | ||||
movl PCB_CR3(%eax), %eax | movl PCB_CR3(%eax), %eax | ||||
movl %eax, %cr3 | movl %eax, %cr3 | ||||
▲ Show 20 Lines • Show All 125 Lines • Show Last 20 Lines |