From: Andrew Morton Signed-off-by: Andrew Morton --- arch/i386/Kconfig.kgdb | 9 --------- arch/i386/kernel/entry.S | 12 +----------- arch/i386/kernel/kgdb_stub.c | 13 ------------- 3 files changed, 1 insertion(+), 33 deletions(-) diff -puN arch/i386/Kconfig.kgdb~kgdb-remove-STACK_OVERFLOW_TEST arch/i386/Kconfig.kgdb --- devel/arch/i386/Kconfig.kgdb~kgdb-remove-STACK_OVERFLOW_TEST 2006-02-27 02:43:44.000000000 -0800 +++ devel-akpm/arch/i386/Kconfig.kgdb 2006-02-27 02:43:44.000000000 -0800 @@ -64,15 +64,6 @@ config KGDB_IRQ correctly and the kernel has interrupts on a control C to the port should cause a break into the kernel debug stub. -config STACK_OVERFLOW_TEST - bool "Turn on kernel stack overflow testing?" - depends on KGDB - default n - help - This option enables code in the front line interrupt handlers - to check for kernel stack overflow on interrupts and system - calls. This is part of the kgdb code on x86 systems. - config TRAP_BAD_SYSCALL_EXITS bool "Debug bad system call exits" depends on KGDB diff -puN arch/i386/kernel/entry.S~kgdb-remove-STACK_OVERFLOW_TEST arch/i386/kernel/entry.S --- devel/arch/i386/kernel/entry.S~kgdb-remove-STACK_OVERFLOW_TEST 2006-02-27 02:43:44.000000000 -0800 +++ devel-akpm/arch/i386/kernel/entry.S 2006-02-27 02:43:44.000000000 -0800 @@ -52,15 +52,6 @@ /* We do not recover from a stack overflow, but at least * we know it happened and should be able to track it down. */ -#ifdef CONFIG_STACK_OVERFLOW_TEST -#define STACK_OVERFLOW_TEST \ - testl $(THREAD_SIZE - 512),%esp; \ - jnz 10f; \ - call stack_overflow; \ -10: -#else -#define STACK_OVERFLOW_TEST -#endif #define nr_syscalls ((syscall_table_size)/4) @@ -107,8 +98,7 @@ VM_MASK = 0x00020000 pushl %ebx; \ movl $(__USER_DS), %edx; \ movl %edx, %ds; \ - movl %edx, %es; \ - STACK_OVERFLOW_TEST + movl %edx, %es; #define RESTORE_INT_REGS \ popl %ebx; \ diff -puN arch/i386/kernel/kgdb_stub.c~kgdb-remove-STACK_OVERFLOW_TEST arch/i386/kernel/kgdb_stub.c --- devel/arch/i386/kernel/kgdb_stub.c~kgdb-remove-STACK_OVERFLOW_TEST 2006-02-27 02:43:44.000000000 -0800 +++ devel-akpm/arch/i386/kernel/kgdb_stub.c 2006-02-27 02:43:44.000000000 -0800 @@ -1832,19 +1832,6 @@ fastcall void sys_call_exit(struct pt_re (int) regs->orig_eax, preempt_count()); } #endif -#ifdef CONFIG_STACK_OVERFLOW_TEST -#include -fastcall void stack_overflow(void) -{ -#ifdef BREAKPOINT - BREAKPOINT; -#else - printk("Kernel stack overflow, looping forever\n"); -#endif - while (1) { - } -} -#endif #ifdef CONFIG_KGDB_CONSOLE #include _