zephyr/kernel
Nicolas Pitre 1f362a81f1 riscv: fix crash resulting from touching the initial stack's guard area
The interrupt stack is used as the system stack during kernel
initialization while IRQs are not yet enabled. The sp register is
set to z_interrupt_stacks + CONFIG_ISR_STACK_SIZE.

CONFIG_ISR_STACK_SIZE only represents the desired usable stack size.
This does not take into account the added guard area. Result is a stack
whose pointer is much closer to the trigger zone than expected when
CONFIG_PMP_STACK_GUARD=y, and the SMP configuration in particular pushes
it over the edge during many CI test cases.

Worse: during early init we're not quite ready to handle exceptions
yet and complete havoc ensues with no meaningful debugging output.

Make sure the early assembly code locates the actual top of the stack
by generating a constant with its true size.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2022-09-28 07:53:56 +00:00
..
include riscv: fix crash resulting from touching the initial stack's guard area 2022-09-28 07:53:56 +00:00
paging arch/kernel/soc/samples: use unsigned int for irq_lock() 2022-07-14 14:37:13 -05:00
CMakeLists.txt cache: Fix cache API calling from userspace 2022-08-23 10:14:17 +02:00
Kconfig kernel: pipes: rewrite pipes implementation 2022-08-17 19:31:25 +02:00
Kconfig.vm everywhere: fix typos 2022-03-18 13:24:08 -04:00
atomic_c.c kernel: migrate includes to <zephyr/...> 2022-05-09 09:26:20 +02:00
banner.c kernel: migrate includes to <zephyr/...> 2022-05-09 09:26:20 +02:00
compiler_stack_protect.c kernel: migrate includes to <zephyr/...> 2022-05-09 09:26:20 +02:00
condvar.c kernel: migrate includes to <zephyr/...> 2022-05-09 09:26:20 +02:00
device.c kernel: migrate includes to <zephyr/...> 2022-05-09 09:26:20 +02:00
errno.c kernel: Allow Zephyr to use libc's internal errno 2022-05-12 19:06:48 -04:00
events.c kernel: Add k_event_set_masked primitive 2022-07-25 15:24:32 -04:00
fatal.c debug: coredump: add xtensa intel adsp, support toolchains 2022-06-23 15:44:45 -04:00
futex.c kernel: migrate includes to <zephyr/...> 2022-05-09 09:26:20 +02:00
idle.c kernel/idle: Fix !SCHED_IPI_SUPPORTED 2022-09-19 09:19:02 +02:00
init.c devices: constify device pointers initialized at compile time 2022-08-22 17:08:26 +02:00
kheap.c kernel: switch to `SYS_INIT_NAMED` 2022-07-06 10:44:35 +02:00
mailbox.c kernel: migrate includes to <zephyr/...> 2022-05-09 09:26:20 +02:00
main_weak.c
mem_domain.c kernel: migrate includes to <zephyr/...> 2022-05-09 09:26:20 +02:00
mem_slab.c kernel: Extend slabs memory usage stats 2022-07-12 13:59:26 +00:00
mempool.c kernel: migrate includes to <zephyr/...> 2022-05-09 09:26:20 +02:00
mmu.c kernel: comply to coding guidelines MISRA C:2012 Rule 14.4 2022-07-21 06:16:16 -04:00
msg_q.c kernel: migrate includes to <zephyr/...> 2022-05-09 09:26:20 +02:00
mutex.c kernel: mutex: fix races when lock timeout 2022-08-12 17:40:20 +02:00
pipes.c kernel: allow k_poll to wait on pipes 2022-08-24 17:49:20 +00:00
poll.c kernel: allow k_poll to wait on pipes 2022-08-24 17:49:20 +00:00
queue.c kernel: migrate includes to <zephyr/...> 2022-05-09 09:26:20 +02:00
sched.c kernel/sched: fix condition for CPU mask set 2022-09-09 16:13:35 -04:00
sem.c kernel: migrate includes to <zephyr/...> 2022-05-09 09:26:20 +02:00
smp.c kernel: comply to coding guidelines MISRA C:2012 Rule 14.4 2022-07-21 06:16:16 -04:00
stack.c kernel: migrate includes to <zephyr/...> 2022-05-09 09:26:20 +02:00
system_work_q.c kernel: migrate includes to <zephyr/...> 2022-05-09 09:26:20 +02:00
thread.c kernel: Fix gathering of runtime thread stats 2022-05-13 10:19:53 -05:00
timeout.c kernel: Fixes sys_clock_tick_get() 2022-08-04 05:32:11 -04:00
timer.c tracing: ctf: add timer support 2022-08-31 16:04:01 -04:00
usage.c kernel: Obtain current cpu inside of locks for thread usage 2022-09-26 07:55:33 +00:00
userspace.c kernel: pipes: rewrite pipes implementation 2022-08-17 19:31:25 +02:00
userspace_handler.c kernel: migrate includes to <zephyr/...> 2022-05-09 09:26:20 +02:00
version.c
work.c kernel: workq: Add internal function z_work_submit_to_queue() 2022-05-10 18:39:51 +02:00
xip.c kernel: remove redundant <zephyr/zephyr.h> includes 2022-06-15 09:13:11 +02:00