1142 movl %r12d, %eax
1143 movl REGOFF_RBX(%rsp), %ebx
1144 movl REGOFF_RBP(%rsp), %ebp
1145 movl REGOFF_RSI(%rsp), %esi
1146 movl REGOFF_RDI(%rsp), %edi
1147
1148 movl REGOFF_RIP(%rsp), %edx /* sysexit: %edx -> %eip */
1149 pushq REGOFF_RFL(%rsp)
1150 popfq
1151 movl REGOFF_RSP(%rsp), %ecx /* sysexit: %ecx -> %esp */
1152 ALTENTRY(sys_sysenter_swapgs_sysexit)
1153 swapgs
1154 sti
1155 sysexit
1156 SET_SIZE(sys_sysenter_swapgs_sysexit)
1157 SET_SIZE(sys_sysenter)
1158 SET_SIZE(_sys_sysenter_post_swapgs)
1159 SET_SIZE(brand_sys_sysenter)
1160
1161 #endif /* __lint */
1162
1163 /*
1164 * This is the destination of the "int $T_SYSCALLINT" interrupt gate, used by
1165 * the generic i386 libc to do system calls. We do a small amount of setup
1166 * before jumping into the existing sys_syscall32 path.
1167 */
1168 #if defined(__lint)
1169
1170 /*ARGSUSED*/
1171 void
1172 sys_syscall_int()
1173 {}
1174
1175 #else /* __lint */
1176
1177 ENTRY_NP(brand_sys_syscall_int)
1178 SWAPGS /* kernel gsbase */
1179 XPV_TRAP_POP
1180 BRAND_CALLBACK(BRAND_CB_INT91, BRAND_URET_FROM_INTR_STACK())
1181 jmp nopop_syscall_int
|
1142 movl %r12d, %eax
1143 movl REGOFF_RBX(%rsp), %ebx
1144 movl REGOFF_RBP(%rsp), %ebp
1145 movl REGOFF_RSI(%rsp), %esi
1146 movl REGOFF_RDI(%rsp), %edi
1147
1148 movl REGOFF_RIP(%rsp), %edx /* sysexit: %edx -> %eip */
1149 pushq REGOFF_RFL(%rsp)
1150 popfq
1151 movl REGOFF_RSP(%rsp), %ecx /* sysexit: %ecx -> %esp */
1152 ALTENTRY(sys_sysenter_swapgs_sysexit)
1153 swapgs
1154 sti
1155 sysexit
1156 SET_SIZE(sys_sysenter_swapgs_sysexit)
1157 SET_SIZE(sys_sysenter)
1158 SET_SIZE(_sys_sysenter_post_swapgs)
1159 SET_SIZE(brand_sys_sysenter)
1160
1161 #endif /* __lint */
1162
1163 #if defined(__lint)
1164 /*
1165 * System call via an int80. This entry point is only used by the Linux
1166 * application environment. Unlike the other entry points, there is no
1167 * default action to take if no callback is registered for this process.
1168 */
1169 void
1170 sys_int80()
1171 {}
1172
1173 #else /* __lint */
1174
1175 ENTRY_NP(brand_sys_int80)
1176 SWAPGS /* kernel gsbase */
1177 XPV_TRAP_POP
1178 BRAND_CALLBACK(BRAND_CB_INT80, BRAND_URET_FROM_INTR_STACK())
1179 SWAPGS /* user gsbase */
1180 jmp nopop_int80
1181
1182 ENTRY_NP(sys_int80)
1183 /*
1184 * We hit an int80, but this process isn't of a brand with an int80
1185 * handler. Bad process! Make it look as if the INT failed.
1186 * Modify %rip to point before the INT, push the expected error
1187 * code and fake a GP fault. Note on 64-bit hypervisor we need
1188 * to undo the XPV_TRAP_POP and push rcx and r11 back on the stack
1189 * because gptrap will pop them again with its own XPV_TRAP_POP.
1190 */
1191 XPV_TRAP_POP
1192 nopop_int80:
1193 subq $2, (%rsp) /* int insn 2-bytes */
1194 pushq $_CONST(_MUL(T_INT80, GATE_DESC_SIZE) + 2)
1195 #if defined(__xpv)
1196 push %r11
1197 push %rcx
1198 #endif
1199 jmp gptrap / GP fault
1200 SET_SIZE(sys_int80)
1201 SET_SIZE(brand_sys_int80)
1202 #endif /* __lint */
1203
1204
1205 /*
1206 * This is the destination of the "int $T_SYSCALLINT" interrupt gate, used by
1207 * the generic i386 libc to do system calls. We do a small amount of setup
1208 * before jumping into the existing sys_syscall32 path.
1209 */
1210 #if defined(__lint)
1211
1212 /*ARGSUSED*/
1213 void
1214 sys_syscall_int()
1215 {}
1216
1217 #else /* __lint */
1218
1219 ENTRY_NP(brand_sys_syscall_int)
1220 SWAPGS /* kernel gsbase */
1221 XPV_TRAP_POP
1222 BRAND_CALLBACK(BRAND_CB_INT91, BRAND_URET_FROM_INTR_STACK())
1223 jmp nopop_syscall_int
|