Commit cfc67b5
committed
application: document RVV vector interrupt stack behavior and increase SMODE_STACK_SIZE
When compiled with RVV (e.g. -march=rv64imafdcv), __INTERRUPT or
__SUPERVISOR_INTERRUPT decorated vector interrupt handlers save context
on the current stack, NOT on the separated interrupt stack. For non-leaf
handlers (calling other functions), all 32 vector registers (v0-v31, each
vlenb bytes) are saved, consuming significant stack space (e.g. 512B for
VLEN=128, 16KB for VLEN=4096). For leaf handlers, only actually-used V
registers are saved, or none if no V instructions are used.
The compiler also saves all caller-saved GPR + FP registers + FCSR, plus
any callee-saved registers actually used by the handler (e.g. s0 as frame
base for non-leaf handlers using SAVE_IRQ_CSR_CONTEXT_S()).
Changes:
- Add comments in demo_eclic_stress, demo_sstc, and demo_smode_eclic
explaining vector interrupt stack behavior, leaf vs non-leaf handler
differences, and the risk of stack overflow with large vlen
- Increase SMODE_STACK_SIZE from 10240 to 20480 in demo_eclic_stress
- Increase SMODE_STACK_SIZE from 2048 to 20480 in demo_sstc
- Increase SMODE_STACK_SIZE from 2048 to 20480 in demo_smode_eclic
- Add corresponding notes in doc/source/design/app.rst for all three demos
- Update changelog.rst with the above changes
Signed-off-by: Huaqi Fang <578567190@qq.com>1 parent 9cc217e commit cfc67b5
5 files changed
Lines changed: 89 additions & 4 deletions
File tree
- application/baremetal
- demo_eclic_stress
- demo_smode_eclic
- demo_sstc
- doc/source
- design
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
207 | 240 | | |
208 | 241 | | |
209 | 242 | | |
| |||
Lines changed: 23 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
31 | 52 | | |
32 | 53 | | |
33 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
34 | 59 | | |
35 | 60 | | |
36 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
99 | 102 | | |
100 | 103 | | |
101 | 104 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
581 | 581 | | |
582 | 582 | | |
583 | 583 | | |
| 584 | + | |
584 | 585 | | |
585 | 586 | | |
586 | 587 | | |
| |||
1701 | 1702 | | |
1702 | 1703 | | |
1703 | 1704 | | |
| 1705 | + | |
1704 | 1706 | | |
1705 | 1707 | | |
1706 | 1708 | | |
| |||
1913 | 1915 | | |
1914 | 1916 | | |
1915 | 1917 | | |
| 1918 | + | |
1916 | 1919 | | |
1917 | 1920 | | |
1918 | 1921 | | |
| |||
0 commit comments