Skip to content

Commit 86effd0

Browse files
committed
ARC: dw2 unwind: enable cfi pseudo ops in string lib
This uses a new set of annoations viz. ENTRY_CFI/END_CFI to enabel cfi ops generation. Note that we didn't change the normal ENTRY/EXIT as we don't actually want unwind info in the trap/exception/interrutp handlers which use these, as unwinder then gets confused (it keeps recursing vs. stopping). Semantically these are leaf routines and unwinding should stop when it hits those routines. Before ------ 28.52% 1.19% 9929 hackbench libuClibc-1.0.17.so [.] __write_nocancel | ---__write_nocancel |--8.95%--EV_Trap | --8.25%--sys_write | |--3.93%--sock_write_iter ... |--2.62%--memset <==== [LEAF entry as no unwind info] ^^^^^^ After ----- 29.46% 1.24% 13622 hackbench libuClibc-1.0.17.so [.] __write_nocancel | ---__write_nocancel |--9.31%--EV_Trap | --8.62%--sys_write | |--4.17%--sock_write_iter ... |--6.19%--sys_write | --6.19%--sock_write_iter | unix_stream_sendmsg | |--1.62%--sock_alloc_send_pskb | |--0.89%--sock_def_readable | |--0.88%--_raw_spin_unlock_irqrestore | |--0.69%--memset | | ^^^^^^ <==== [now in proper callframe] | | | --0.52%--skb_copy_datagram_from_iter Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
1 parent 5a205a3 commit 86effd0

File tree

11 files changed

+26
-25
lines changed

11 files changed

+26
-25
lines changed

arch/arc/kernel/ctx_sw_asm.S

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
.global __switch_to
2424
.type __switch_to, @function
2525
__switch_to:
26+
CFI_STARTPROC
2627

2728
/* Save regs on kernel mode stack of task */
2829
st.a blink, [sp, -4]
@@ -59,4 +60,4 @@ __switch_to:
5960
ld.ab blink, [sp, 4]
6061
j [blink]
6162

62-
END(__switch_to)
63+
END_CFI(__switch_to)

arch/arc/lib/memcmp.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#define SHIFT r2
1717
#endif
1818

19-
ENTRY(memcmp)
19+
ENTRY_CFI(memcmp)
2020
or r12,r0,r1
2121
asl_s r12,r12,30
2222
sub r3,r2,1
@@ -149,4 +149,4 @@ ENTRY(memcmp)
149149
.Lnil:
150150
j_s.d [blink]
151151
mov r0,0
152-
END(memcmp)
152+
END_CFI(memcmp)

arch/arc/lib/memcpy-700.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#include <linux/linkage.h>
1010

11-
ENTRY(memcpy)
11+
ENTRY_CFI(memcpy)
1212
or r3,r0,r1
1313
asl_s r3,r3,30
1414
mov_s r5,r0
@@ -63,4 +63,4 @@ ENTRY(memcpy)
6363
.Lendbloop:
6464
j_s.d [blink]
6565
stb r12,[r5,0]
66-
END(memcpy)
66+
END_CFI(memcpy)

arch/arc/lib/memcpy-archs.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
# define ZOLAND 0xF
4141
#endif
4242

43-
ENTRY(memcpy)
43+
ENTRY_CFI(memcpy)
4444
prefetch [r1] ; Prefetch the read location
4545
prefetchw [r0] ; Prefetch the write location
4646
mov.f 0, r2
@@ -233,4 +233,4 @@ ENTRY(memcpy)
233233
.Lcopybytewise_3:
234234
j [blink]
235235

236-
END(memcpy)
236+
END_CFI(memcpy)

arch/arc/lib/memset-archs.S

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
#undef PREALLOC_NOT_AVAIL
1212

13-
ENTRY(memset)
13+
ENTRY_CFI(memset)
1414
prefetchw [r0] ; Prefetch the write location
1515
mov.f 0, r2
1616
;;; if size is zero
@@ -112,11 +112,11 @@ ENTRY(memset)
112112

113113
j [blink]
114114

115-
END(memset)
115+
END_CFI(memset)
116116

117-
ENTRY(memzero)
117+
ENTRY_CFI(memzero)
118118
; adjust bzero args to memset args
119119
mov r2, r1
120120
b.d memset ;tail call so need to tinker with blink
121121
mov r1, 0
122-
END(memzero)
122+
END_CFI(memzero)

arch/arc/lib/memset.S

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
#define SMALL 7 /* Must be at least 6 to deal with alignment/loop issues. */
1212

13-
ENTRY(memset)
13+
ENTRY_CFI(memset)
1414
mov_s r4,r0
1515
or r12,r0,r2
1616
bmsk.f r12,r12,1
@@ -46,14 +46,14 @@ ENTRY(memset)
4646
stb.ab r1,[r4,1]
4747
.Ltiny_end:
4848
j_s [blink]
49-
END(memset)
49+
END_CFI(memset)
5050

5151
; memzero: @r0 = mem, @r1 = size_t
5252
; memset: @r0 = mem, @r1 = char, @r2 = size_t
5353

54-
ENTRY(memzero)
54+
ENTRY_CFI(memzero)
5555
; adjust bzero args to memset args
5656
mov r2, r1
5757
mov r1, 0
5858
b memset ;tail call so need to tinker with blink
59-
END(memzero)
59+
END_CFI(memzero)

arch/arc/lib/strchr-700.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
#include <linux/linkage.h>
1515

16-
ENTRY(strchr)
16+
ENTRY_CFI(strchr)
1717
extb_s r1,r1
1818
asl r5,r1,8
1919
bmsk r2,r0,1
@@ -130,4 +130,4 @@ ENTRY(strchr)
130130
j_s.d [blink]
131131
mov.mi r0,0
132132
#endif /* ENDIAN */
133-
END(strchr)
133+
END_CFI(strchr)

arch/arc/lib/strcmp-archs.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#include <linux/linkage.h>
1010

11-
ENTRY(strcmp)
11+
ENTRY_CFI(strcmp)
1212
or r2, r0, r1
1313
bmsk_s r2, r2, 1
1414
brne r2, 0, @.Lcharloop
@@ -75,4 +75,4 @@ ENTRY(strcmp)
7575
.Lcmpend:
7676
j_s.d [blink]
7777
sub r0, r2, r3
78-
END(strcmp)
78+
END_CFI(strcmp)

arch/arc/lib/strcmp.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
#include <linux/linkage.h>
1717

18-
ENTRY(strcmp)
18+
ENTRY_CFI(strcmp)
1919
or r2,r0,r1
2020
bmsk_s r2,r2,1
2121
brne r2,0,.Lcharloop
@@ -93,4 +93,4 @@ ENTRY(strcmp)
9393
.Lcmpend:
9494
j_s.d [blink]
9595
sub r0,r2,r3
96-
END(strcmp)
96+
END_CFI(strcmp)

arch/arc/lib/strcpy-700.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
#include <linux/linkage.h>
2020

21-
ENTRY(strcpy)
21+
ENTRY_CFI(strcpy)
2222
or r2,r0,r1
2323
bmsk_s r2,r2,1
2424
brne.d r2,0,charloop
@@ -67,4 +67,4 @@ charloop:
6767
brne.d r3,0,charloop
6868
stb.ab r3,[r10,1]
6969
j [blink]
70-
END(strcpy)
70+
END_CFI(strcpy)

arch/arc/lib/strlen.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#include <linux/linkage.h>
1010

11-
ENTRY(strlen)
11+
ENTRY_CFI(strlen)
1212
or r3,r0,7
1313
ld r2,[r3,-7]
1414
ld.a r6,[r3,-3]
@@ -80,4 +80,4 @@ ENTRY(strlen)
8080
.Learly_end:
8181
b.d .Lend
8282
sub_s.ne r1,r1,r1
83-
END(strlen)
83+
END_CFI(strlen)

0 commit comments

Comments
 (0)