2 #include "config_tcbsize.h"
3 #include "config_gdt.h"
4 #include "globalconfig.h"
12 .globl entry_vec01_debug
14 /* XXX we have to check single step bug */
38 .globl entry_vec08_dbf
59 mov %rsp,%rdi // 1st arg: trap state
60 call thread_handle_double_fault
65 .globl entry_vec0a_invalid_tss
66 entry_vec0a_invalid_tss:
67 andq $0xffffffffffffbfff, 24(%rsp)
68 add $8, %rsp /* skip error code */
71 /* PPro spurious interrupt bug:
72 * See "Pentium Pro Processor Specification Update / January 1999"
73 * Erratum "Virtual Wire mode through local APIC may cause int 15"
74 * This exception can be silently ignored */
76 .globl entry_vec0f_apic_spurious_interrupt_bug
77 entry_vec0f_apic_spurious_interrupt_bug:
78 incl apic_spurious_interrupt_bug_cnt
82 /* XXX has to be fixed */
83 /* APIC error interrupt */
85 .globl entry_apic_error_interrupt
86 entry_apic_error_interrupt:
89 lea SCRATCH_REGISTER_SIZE(%rsp), %rdi
90 call apic_error_interrupt
94 /* Intel Architecture Software Developer's Manual Volume 3,
95 * Advanced Programmable Interrupt Controller (APIC):
96 * Spurious Interrupt: "If at the time the INTA cycle is issued, the
97 * interupt that was to be dispensed has become masked (programmed by
98 * software), the local APIC will deliver a spurious-interrupt vector." */
100 .globl entry_apic_spurious_interrupt
101 entry_apic_spurious_interrupt:
102 incl apic_spurious_interrupt_cnt
106 .global entry_int_apic_ignore
107 entry_int_apic_ignore:
110 mov apic_io_base, %rcx
117 #if defined(CONFIG_JDB)
120 .global entry_syscall_log
121 .global entry_sys_fast_ipc_log
123 entry_sys_fast_ipc_log:
124 mov %rsp,%r15 /* save user rsp */
125 mov syscall_rsp0, %rsp /* get address of kernel stack */
126 pop %rsp /* set kernel stack */
128 push $(GDT_DATA_USER | SEL_PL_U) /* fake user ss */
129 push %r15 /* save user rsp */
130 push %r11 /* save user rflags */
131 push $(GDT_CODE_USER | SEL_PL_U) /* fake user cs */
132 push %rcx /* save user rip */
137 RESET_THREAD_CANCEL_AT %rbx
141 RESTORE_STATE_SYSEXIT
143 pop %rcx /* load user rsp */
144 add $8,%rsp /* through away cs */
145 pop %r11 /* load user rflags */
146 pop %r15 /* load user rsp */
147 add $8,%rsp /* through away ss */
149 mov %r15,%rsp /* restore user rsp */
157 #if (defined (CONFIG_JDB_LOGGING) || !defined(CONFIG_ASSEMBLER_IPC_SHORTCUT))
159 .global entry_syscall_c
160 .global entry_sys_fast_ipc_c
162 entry_sys_fast_ipc_c:
163 mov %rsp,%r15 /* save user rsp */
164 mov syscall_rsp0,%rsp /* get address of kernel stack */
165 pop %rsp /* set kernel stack */
167 push $(GDT_DATA_USER | SEL_PL_U) /* fake user ss */
168 push %r15 /* save user rsp */
169 push %r11 /* save user rflags */
170 push $(GDT_CODE_USER | SEL_PL_U) /* fake user cs */
171 push %rcx /* save user rip */
176 RESET_THREAD_CANCEL_AT %rbx
178 call ipc_short_cut_wrapper
180 RESTORE_STATE_SYSEXIT
182 pop %rcx /* load user rsp */
183 add $8,%rsp /* through away cs */
184 pop %r11 /* load user rflags */
185 pop %r15 /* load user rsp */
186 add $8,%rsp /* through away ss */
188 mov %r15,%rsp /* restore user rsp */
198 .space 8 /* address of esp0 in tss */
202 .globl leave_from_sysenter_by_iret
203 leave_from_sysenter_by_iret:
205 RESET_THREAD_IPC_MASK_AT %rbx
208 orq $EFLAGS_IF, 8(%rsp)
216 // save callee saved regs
224 mov %rdi, %rax // first arg goes to rax for vm*
225 push %rsi // store pointer to register struct
232 // restore guest GP regs
250 // rax used as implicit operand for vm* instructions
256 mov 8(%rsp), %rsi // get previously saved register struct pointer
258 mov %rdx, 8(%rsi) // save guest GP registers
272 mov (%rsp), %rdx // guest rsi to rdx
273 mov %rdx, (%rsi) // store in regs structure
281 // restore callee saved registers
295 .global dbf_stack_top