zephyr/tests/kernel/fatal
Andrew Boie 80e82e7205 x86: stack overflow improvements
As luck would have it, the TSS for the main IA task has
all the information we need, populate an exception stack
frame with it.

The double-fault handler just stashes data and makes the main
hardware thread runnable again, and processing of the
exception continues from there.

We check the first byte before the faulting ESP value to see
if the stack pointer had run up to a non-present page, a sign
that this is a stack overflow and not a double fault for
some other reason.

Stack overflows in kernel mode are now recoverable for non-
essential threads, with the caveat that we hope we weren't in
a critical section updating kernel data structures when it
happened.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-08-03 11:46:26 -04:00
..
src x86: stack overflow improvements 2017-08-03 11:46:26 -04:00
Makefile
README
prj-arc.conf tests: kernel: fatal: check stack overflow 2017-05-13 15:14:41 -04:00
prj-x86-mmu.conf tests: fatal: enable x86 MMU stack protection 2017-07-25 11:32:36 -04:00
prj.conf tests: fatal: enable x86 MMU stack protection 2017-07-25 11:32:36 -04:00
testcase.yaml tests: fatal: enable x86 MMU stack protection 2017-07-25 11:32:36 -04:00

README

This test case verifies that kernel fatal error handling works correctly.

If a thread causes a CPU exception, and it is not in an ISR or "essential"
thread, the thread gets aborted and the rest of the system executes normally.