aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/entry/entry_32.S35
1 files changed, 3 insertions, 32 deletions
diff --git a/arch/x86/entry/entry_32.S b/arch/x86/entry/entry_32.S
index 9d6eceba0461..dbf7d619dcd6 100644
--- a/arch/x86/entry/entry_32.S
+++ b/arch/x86/entry/entry_32.S
@@ -1226,41 +1226,12 @@ END(common_exception)
1226 1226
1227ENTRY(debug) 1227ENTRY(debug)
1228 /* 1228 /*
1229 * #DB can happen at the first instruction of 1229 * Entry from sysenter is now handled in common_exception
1230 * entry_SYSENTER_32 or in Xen's SYSENTER prologue. If this
1231 * happens, then we will be running on a very small stack. We
1232 * need to detect this condition and switch to the thread
1233 * stack before calling any C code at all.
1234 *
1235 * If you edit this code, keep in mind that NMIs can happen in here.
1236 */ 1230 */
1237 ASM_CLAC 1231 ASM_CLAC
1238 pushl $-1 # mark this as an int 1232 pushl $-1 # mark this as an int
1239 1233 pushl $do_debug
1240 SAVE_ALL 1234 jmp common_exception
1241 ENCODE_FRAME_POINTER
1242 xorl %edx, %edx # error code 0
1243 movl %esp, %eax # pt_regs pointer
1244
1245 /* Are we currently on the SYSENTER stack? */
1246 movl PER_CPU_VAR(cpu_entry_area), %ecx
1247 addl $CPU_ENTRY_AREA_entry_stack + SIZEOF_entry_stack, %ecx
1248 subl %eax, %ecx /* ecx = (end of entry_stack) - esp */
1249 cmpl $SIZEOF_entry_stack, %ecx
1250 jb .Ldebug_from_sysenter_stack
1251
1252 TRACE_IRQS_OFF
1253 call do_debug
1254 jmp ret_from_exception
1255
1256.Ldebug_from_sysenter_stack:
1257 /* We're on the SYSENTER stack. Switch off. */
1258 movl %esp, %ebx
1259 movl PER_CPU_VAR(cpu_current_top_of_stack), %esp
1260 TRACE_IRQS_OFF
1261 call do_debug
1262 movl %ebx, %esp
1263 jmp ret_from_exception
1264END(debug) 1235END(debug)
1265 1236
1266/* 1237/*