core: clear temporary stack flag before entering boot_init_primary_late()

boot_init_primary_late() uses the stack of thread 0, so the flag that
indicates usage of the temporary stack must be cleared in the current
core's thread_core_local structure.

Fixes the following crash when CFG_CORE_DEBUG_CHECK_STACKS=y:

 D/TC:0 0 select_vector:1126 SMCCC_ARCH_WORKAROUND_1 (0x80008000) available
 D/TC:0 0 select_vector:1128 SMC Workaround for CVE-2017-5715 used
 D/TC:0 0 check_stack_limits:370 Stack pointer out of range (0xb7f54fd0)
 D/TC:0 0 print_stack_limits:346 tmp [0] 0xb7f57c90..0xb7f584b0
 D/TC:0 0 print_stack_limits:346 tmp [1] 0xb7f58ad0..0xb7f592f0
 D/TC:0 0 print_stack_limits:346 tmp [2] 0xb7f59910..0xb7f5a130
 D/TC:0 0 print_stack_limits:346 tmp [3] 0xb7f5a750..0xb7f5af70
 D/TC:0 0 print_stack_limits:351 abt [0] 0xb7f4e710..0xb7f4f330
 D/TC:0 0 print_stack_limits:351 abt [1] 0xb7f4f950..0xb7f50570
 D/TC:0 0 print_stack_limits:351 abt [2] 0xb7f50b90..0xb7f517b0
 D/TC:0 0 print_stack_limits:351 abt [3] 0xb7f51dd0..0xb7f529f0
 D/TC:0 0 print_stack_limits:356 thr [0] 0xb7f53030..0xb7f55030
 D/TC:0 0 print_stack_limits:356 thr [1] 0xb7f55670..0xb7f57670
 E/TC:0 0 Panic at core/arch/arm/kernel/thread.c:372 <check_stack_limits>

Fixes: 59ac3801b756 ("core: split boot_init_primary()")
Signed-off-by: Jerome Forissier <jerome@forissier.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
2 files changed
tree: 76962d2219310eb07db40c483b849c6eb0b4480b
  1. .github/
  2. core/
  3. keys/
  4. ldelf/
  5. lib/
  6. mk/
  7. scripts/
  8. ta/
  9. .azure-pipelines.yml
  10. .checkpatch.conf
  11. .gitattributes
  12. .gitignore
  13. .travis.yml
  14. CHANGELOG.md
  15. LICENSE
  16. MAINTAINERS
  17. Makefile
  18. README.md
  19. typedefs.checkpatch
README.md

OP-TEE Trusted OS

This git contains source code for the secure side implementation of OP-TEE project.

All official OP-TEE documentation has moved to http://optee.readthedocs.io.

// OP-TEE core maintainers