arch/x86: (Intel64) move STACK_SENTINEL check

This function call was erroneously inserted between the instruction
that set the Z flag and the instruction that tested the Z flag. The
call is moved up a few instructions where it can't junk CPU state.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
This commit is contained in:
Charles E. Youse 2019-09-20 18:34:41 -04:00 committed by Andrew Boie
commit 1d8c80bc05

View file

@ -505,14 +505,14 @@ irq_dispatch:
movl %eax, (CONFIG_LOAPIC_BASE_ADDRESS + LOAPIC_EOI)
#endif
#ifdef CONFIG_STACK_SENTINEL
call z_check_stack_sentinel
#endif
movq $_kernel, %rsi
cli
addq $CONFIG_ISR_SUBSTACK_SIZE, %gs:__x86_tss64_t_ist1_OFFSET
decl _kernel_offset_to_nested(%rsi)
/* not nested, exit via __resume (might change threads) */
#ifdef CONFIG_STACK_SENTINEL
call z_check_stack_sentinel
#endif
/* if not nested, exit via __resume (might change threads) */
jz __resume
irq_exit_nested: