x86: fix early boot pagefault reason code

If we get a page fault in early boot context, before
main thread is started, page faults were being
incorrectly reported as stack overflows.
z_x86_check_stack_bounds() needs to consider the
interrupt stack as the correct stack for this context.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
Andrew Boie 2020-06-12 17:06:51 -07:00 committed by Carles Cufí
commit a8585ac35c

View file

@ -54,8 +54,9 @@ bool z_x86_check_stack_bounds(uintptr_t addr, size_t size, uint16_t cs)
{ {
uintptr_t start, end; uintptr_t start, end;
if (arch_is_in_isr()) { if (_current == NULL || arch_is_in_isr()) {
/* We were servicing an interrupt */ /* We were servicing an interrupt or in early boot environment
* and are supposed to be on the interrupt stack */
int cpu_id; int cpu_id;
#ifdef CONFIG_SMP #ifdef CONFIG_SMP