|
449 | 449 |
|
450 | 450 | .macro SWITCH_TO_KERNEL_STACK |
451 | 451 |
|
452 | | - ALTERNATIVE "", "jmp .Lend_\@", X86_FEATURE_XENPV |
453 | | - |
454 | 452 | BUG_IF_WRONG_CR3 |
455 | 453 |
|
456 | 454 | SWITCH_TO_KERNEL_CR3 scratch_reg=%eax |
|
599 | 597 | */ |
600 | 598 | .macro SWITCH_TO_ENTRY_STACK |
601 | 599 |
|
602 | | - ALTERNATIVE "", "jmp .Lend_\@", X86_FEATURE_XENPV |
603 | | - |
604 | 600 | /* Bytes to copy */ |
605 | 601 | movl $PTREGS_SIZE, %ecx |
606 | 602 |
|
@@ -872,17 +868,6 @@ SYM_ENTRY(__begin_SYSENTER_singlestep_region, SYM_L_GLOBAL, SYM_A_NONE) |
872 | 868 | * will ignore all of the single-step traps generated in this range. |
873 | 869 | */ |
874 | 870 |
|
875 | | -#ifdef CONFIG_XEN_PV |
876 | | -/* |
877 | | - * Xen doesn't set %esp to be precisely what the normal SYSENTER |
878 | | - * entry point expects, so fix it up before using the normal path. |
879 | | - */ |
880 | | -SYM_CODE_START(xen_sysenter_target) |
881 | | - addl $5*4, %esp /* remove xen-provided frame */ |
882 | | - jmp .Lsysenter_past_esp |
883 | | -SYM_CODE_END(xen_sysenter_target) |
884 | | -#endif |
885 | | - |
886 | 871 | /* |
887 | 872 | * 32-bit SYSENTER entry. |
888 | 873 | * |
@@ -965,9 +950,8 @@ SYM_FUNC_START(entry_SYSENTER_32) |
965 | 950 |
|
966 | 951 | movl %esp, %eax |
967 | 952 | call do_SYSENTER_32 |
968 | | - /* XEN PV guests always use IRET path */ |
969 | | - ALTERNATIVE "testl %eax, %eax; jz .Lsyscall_32_done", \ |
970 | | - "jmp .Lsyscall_32_done", X86_FEATURE_XENPV |
| 953 | + testl %eax, %eax |
| 954 | + jz .Lsyscall_32_done |
971 | 955 |
|
972 | 956 | STACKLEAK_ERASE |
973 | 957 |
|
@@ -1165,95 +1149,6 @@ SYM_FUNC_END(entry_INT80_32) |
1165 | 1149 | #endif |
1166 | 1150 | .endm |
1167 | 1151 |
|
1168 | | -#ifdef CONFIG_PARAVIRT |
1169 | | -SYM_CODE_START(native_iret) |
1170 | | - iret |
1171 | | - _ASM_EXTABLE(native_iret, asm_iret_error) |
1172 | | -SYM_CODE_END(native_iret) |
1173 | | -#endif |
1174 | | - |
1175 | | -#ifdef CONFIG_XEN_PV |
1176 | | -/* |
1177 | | - * See comment in entry_64.S for further explanation |
1178 | | - * |
1179 | | - * Note: This is not an actual IDT entry point. It's a XEN specific entry |
1180 | | - * point and therefore named to match the 64-bit trampoline counterpart. |
1181 | | - */ |
1182 | | -SYM_FUNC_START(xen_asm_exc_xen_hypervisor_callback) |
1183 | | - /* |
1184 | | - * Check to see if we got the event in the critical |
1185 | | - * region in xen_iret_direct, after we've reenabled |
1186 | | - * events and checked for pending events. This simulates |
1187 | | - * iret instruction's behaviour where it delivers a |
1188 | | - * pending interrupt when enabling interrupts: |
1189 | | - */ |
1190 | | - cmpl $xen_iret_start_crit, (%esp) |
1191 | | - jb 1f |
1192 | | - cmpl $xen_iret_end_crit, (%esp) |
1193 | | - jae 1f |
1194 | | - call xen_iret_crit_fixup |
1195 | | -1: |
1196 | | - pushl $-1 /* orig_ax = -1 => not a system call */ |
1197 | | - SAVE_ALL |
1198 | | - ENCODE_FRAME_POINTER |
1199 | | - |
1200 | | - mov %esp, %eax |
1201 | | - call xen_pv_evtchn_do_upcall |
1202 | | - jmp handle_exception_return |
1203 | | -SYM_FUNC_END(xen_asm_exc_xen_hypervisor_callback) |
1204 | | - |
1205 | | -/* |
1206 | | - * Hypervisor uses this for application faults while it executes. |
1207 | | - * We get here for two reasons: |
1208 | | - * 1. Fault while reloading DS, ES, FS or GS |
1209 | | - * 2. Fault while executing IRET |
1210 | | - * Category 1 we fix up by reattempting the load, and zeroing the segment |
1211 | | - * register if the load fails. |
1212 | | - * Category 2 we fix up by jumping to do_iret_error. We cannot use the |
1213 | | - * normal Linux return path in this case because if we use the IRET hypercall |
1214 | | - * to pop the stack frame we end up in an infinite loop of failsafe callbacks. |
1215 | | - * We distinguish between categories by maintaining a status value in EAX. |
1216 | | - */ |
1217 | | -SYM_FUNC_START(xen_failsafe_callback) |
1218 | | - pushl %eax |
1219 | | - movl $1, %eax |
1220 | | -1: mov 4(%esp), %ds |
1221 | | -2: mov 8(%esp), %es |
1222 | | -3: mov 12(%esp), %fs |
1223 | | -4: mov 16(%esp), %gs |
1224 | | - /* EAX == 0 => Category 1 (Bad segment) |
1225 | | - EAX != 0 => Category 2 (Bad IRET) */ |
1226 | | - testl %eax, %eax |
1227 | | - popl %eax |
1228 | | - lea 16(%esp), %esp |
1229 | | - jz 5f |
1230 | | - jmp asm_iret_error |
1231 | | -5: pushl $-1 /* orig_ax = -1 => not a system call */ |
1232 | | - SAVE_ALL |
1233 | | - ENCODE_FRAME_POINTER |
1234 | | - jmp handle_exception_return |
1235 | | - |
1236 | | -.section .fixup, "ax" |
1237 | | -6: xorl %eax, %eax |
1238 | | - movl %eax, 4(%esp) |
1239 | | - jmp 1b |
1240 | | -7: xorl %eax, %eax |
1241 | | - movl %eax, 8(%esp) |
1242 | | - jmp 2b |
1243 | | -8: xorl %eax, %eax |
1244 | | - movl %eax, 12(%esp) |
1245 | | - jmp 3b |
1246 | | -9: xorl %eax, %eax |
1247 | | - movl %eax, 16(%esp) |
1248 | | - jmp 4b |
1249 | | -.previous |
1250 | | - _ASM_EXTABLE(1b, 6b) |
1251 | | - _ASM_EXTABLE(2b, 7b) |
1252 | | - _ASM_EXTABLE(3b, 8b) |
1253 | | - _ASM_EXTABLE(4b, 9b) |
1254 | | -SYM_FUNC_END(xen_failsafe_callback) |
1255 | | -#endif /* CONFIG_XEN_PV */ |
1256 | | - |
1257 | 1152 | SYM_CODE_START_LOCAL_NOALIGN(handle_exception) |
1258 | 1153 | /* the function address is in %gs's slot on the stack */ |
1259 | 1154 | SAVE_ALL switch_stacks=1 skip_gs=1 unwind_espfix=1 |
|
0 commit comments