Skip to content

Commit ddacd0b

Browse files
committed
sparc64: Kill CONFIG_STACK_DEBUG code.
The generic stack tracer does this job just as well. Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 63b7549 commit ddacd0b

File tree

2 files changed

+1
-78
lines changed

2 files changed

+1
-78
lines changed

arch/sparc/Kconfig.debug

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,10 @@ config DEBUG_DCFLUSH
1919
bool "D-cache flush debugging"
2020
depends on SPARC64 && DEBUG_KERNEL
2121

22-
config STACK_DEBUG
23-
bool "Stack Overflow Detection Support"
24-
2522
config MCOUNT
2623
bool
2724
depends on SPARC64
28-
depends on STACK_DEBUG || FUNCTION_TRACER
25+
depends on FUNCTION_TRACER
2926
default y
3027

3128
config FRAME_POINTER

arch/sparc/lib/mcount.S

Lines changed: 0 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,11 @@
77

88
#include <linux/linkage.h>
99

10-
#include <asm/ptrace.h>
11-
#include <asm/thread_info.h>
12-
1310
/*
1411
* This is the main variant and is called by C code. GCC's -pg option
1512
* automatically instruments every C function with a call to this.
1613
*/
1714

18-
#ifdef CONFIG_STACK_DEBUG
19-
20-
#define OVSTACKSIZE 4096 /* lets hope this is enough */
21-
22-
.data
23-
.align 8
24-
panicstring:
25-
.asciz "Stack overflow\n"
26-
.align 8
27-
ovstack:
28-
.skip OVSTACKSIZE
29-
#endif
3015
.text
3116
.align 32
3217
.globl _mcount
@@ -35,65 +20,6 @@ ovstack:
3520
.type mcount,#function
3621
_mcount:
3722
mcount:
38-
#ifdef CONFIG_STACK_DEBUG
39-
/*
40-
* Check whether %sp is dangerously low.
41-
*/
42-
ldub [%g6 + TI_FPDEPTH], %g1
43-
srl %g1, 1, %g3
44-
add %g3, 1, %g3
45-
sllx %g3, 8, %g3 ! each fpregs frame is 256b
46-
add %g3, 192, %g3
47-
add %g6, %g3, %g3 ! where does task_struct+frame end?
48-
sub %g3, STACK_BIAS, %g3
49-
cmp %sp, %g3
50-
bg,pt %xcc, 1f
51-
nop
52-
lduh [%g6 + TI_CPU], %g1
53-
sethi %hi(hardirq_stack), %g3
54-
or %g3, %lo(hardirq_stack), %g3
55-
sllx %g1, 3, %g1
56-
ldx [%g3 + %g1], %g7
57-
sub %g7, STACK_BIAS, %g7
58-
cmp %sp, %g7
59-
bleu,pt %xcc, 2f
60-
sethi %hi(THREAD_SIZE), %g3
61-
add %g7, %g3, %g7
62-
cmp %sp, %g7
63-
blu,pn %xcc, 1f
64-
2: sethi %hi(softirq_stack), %g3
65-
or %g3, %lo(softirq_stack), %g3
66-
ldx [%g3 + %g1], %g7
67-
sub %g7, STACK_BIAS, %g7
68-
cmp %sp, %g7
69-
bleu,pt %xcc, 3f
70-
sethi %hi(THREAD_SIZE), %g3
71-
add %g7, %g3, %g7
72-
cmp %sp, %g7
73-
blu,pn %xcc, 1f
74-
nop
75-
/* If we are already on ovstack, don't hop onto it
76-
* again, we are already trying to output the stack overflow
77-
* message.
78-
*/
79-
3: sethi %hi(ovstack), %g7 ! cant move to panic stack fast enough
80-
or %g7, %lo(ovstack), %g7
81-
add %g7, OVSTACKSIZE, %g3
82-
sub %g3, STACK_BIAS + 192, %g3
83-
sub %g7, STACK_BIAS, %g7
84-
cmp %sp, %g7
85-
blu,pn %xcc, 2f
86-
cmp %sp, %g3
87-
bleu,pn %xcc, 1f
88-
nop
89-
2: mov %g3, %sp
90-
sethi %hi(panicstring), %g3
91-
call prom_printf
92-
or %g3, %lo(panicstring), %o0
93-
call prom_halt
94-
nop
95-
1:
96-
#endif
9723
#ifdef CONFIG_FUNCTION_TRACER
9824
#ifdef CONFIG_DYNAMIC_FTRACE
9925
/* Do nothing, the retl/nop below is all we need. */

0 commit comments

Comments
 (0)