zephyr/arch/riscv
Yong Cong Sin 7db18ab721 arch: riscv: stacktrace: fix user thread stack bound check
According to the riscv's `arch.h`:

 +------------+ <- thread.arch.priv_stack_start
 | Guard      | } Z_RISCV_STACK_GUARD_SIZE
 +------------+
 | Priv Stack | } CONFIG_PRIVILEGED_STACK_SIZE
 +------------+ <- thread.arch.priv_stack_start +
                   CONFIG_PRIVILEGED_STACK_SIZE +
                   Z_RISCV_STACK_GUARD_SIZE

The start of the privilege stack should be:

  `thread.arch.priv_stack_start + Z_RISCV_STACK_GUARD_SIZE`

Instead of

  `thread.arch.priv_stack_start - CONFIG_PRIVILEGED_STACK_SIZE`

For the `end`, use the same equation of `top_of_priv_stack` in
the `arch_user_mode_enter()`

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-07-27 20:47:51 +03:00
..
core arch: riscv: stacktrace: fix user thread stack bound check 2024-07-27 20:47:51 +03:00
include arch: riscv: remove PMP stack guard for stack overflow handler 2024-07-27 15:12:25 +03:00
CMakeLists.txt
Kconfig riscv: pmp: actually activate stack overflow protection during boot 2024-07-11 18:22:08 -04:00
Kconfig.isa