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