Commit 5bb8d34
LoongArch: Use correct sp value to get graph addr in stack unwinders
The stack frame when function_graph enable like follows,
--------- <- function sp_on_entry
|
|
|
FAKE_RA <- sp_on_entry - sizeof(pt_regs) + PT_R1
|
--------- <- sp_on_entry - sizeof(pt_regs)
So if we want to get the &FAKE_RA we should get sp_on_entry first. In
the unwinder_prologue case, we can get the sp_on_entry as state->sp,
because we try to calculate each CFA and the ra saved address. But in
the unwinder_guess case, we cannot get it because we do not try to
calculate the CFA. Although LoongArch have not fixed frame, the $ra is
saved at CFA - 8 in most cases, we can try guess, too. As we store the
pc in state, we not need to dereference state->sp, too.
Signed-off-by: Jinyang He <[email protected]>
Signed-off-by: Huacai Chen <[email protected]>1 parent 429a967 commit 5bb8d34
File tree
4 files changed
+20
-24
lines changed- arch/loongarch
- include/asm
- kernel
4 files changed
+20
-24
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | 13 | | |
16 | 14 | | |
17 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| |||
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
43 | 53 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
16 | 14 | | |
17 | | - | |
| 15 | + | |
18 | 16 | | |
19 | 17 | | |
20 | 18 | | |
| |||
36 | 34 | | |
37 | 35 | | |
38 | 36 | | |
39 | | - | |
| 37 | + | |
40 | 38 | | |
41 | 39 | | |
42 | 40 | | |
| |||
60 | 58 | | |
61 | 59 | | |
62 | 60 | | |
63 | | - | |
64 | | - | |
65 | | - | |
| 61 | + | |
| 62 | + | |
66 | 63 | | |
67 | 64 | | |
68 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | 24 | | |
26 | 25 | | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | 26 | | |
| 27 | + | |
34 | 28 | | |
35 | 29 | | |
36 | 30 | | |
| |||
43 | 37 | | |
44 | 38 | | |
45 | 39 | | |
46 | | - | |
47 | | - | |
48 | | - | |
| 40 | + | |
| 41 | + | |
49 | 42 | | |
50 | 43 | | |
51 | 44 | | |
| |||
166 | 159 | | |
167 | 160 | | |
168 | 161 | | |
169 | | - | |
| 162 | + | |
170 | 163 | | |
171 | 164 | | |
172 | 165 | | |
| |||
193 | 186 | | |
194 | 187 | | |
195 | 188 | | |
196 | | - | |
197 | | - | |
| 189 | + | |
198 | 190 | | |
199 | 191 | | |
200 | 192 | | |
| |||
209 | 201 | | |
210 | 202 | | |
211 | 203 | | |
212 | | - | |
213 | | - | |
| 204 | + | |
214 | 205 | | |
215 | 206 | | |
216 | 207 | | |
| |||
0 commit comments