]> git.baikalelectronics.ru Git - kernel.git/commit
xtensa: fix secondary core boot in SMP
authorMax Filippov <jcmvbkbc@gmail.com>
Fri, 16 Oct 2015 14:01:04 +0000 (17:01 +0300)
committerMax Filippov <jcmvbkbc@gmail.com>
Tue, 3 Nov 2015 14:19:38 +0000 (17:19 +0300)
commit13be1b9d7e48e18d78df609c915984fafad9933b
treec2aacf7f7c4a8961a239cb4ee215610b3eeb0d51
parent61b6845792fddde2257cdd7a8515836efe922e29
xtensa: fix secondary core boot in SMP

There are multiple factors adding to the issue in different
configurations:

- commit 7d43c5c08cd00ccb ("xtensa: add fixup for double exception raised
  in window overflow") added function window_overflow_restore_a0_fixup to
  double exception vector overlapping reset vector location of secondary
  processor cores.
- on MMUv2 cores RESET_VECTOR1_VADDR may point to uncached kernel memory
  making code overlapping depend on cache type and size, so that without
  cache or with WT cache reset vector code overwrites double exception
  code, making issue even harder to detect.
- on MMUv3 cores RESET_VECTOR1_VADDR may point to unmapped area, as
  MMUv3 cores change virtual address map to match MMUv2 layout, but
  reset vector virtual address is given for the original MMUv3 mapping.
- physical memory region of the secondary reset vector is not reserved
  in the physical memory map, and thus may be allocated and overwritten
  at arbitrary moment.

Fix it as follows:

- move window_overflow_restore_a0_fixup code to .text section.
- define RESET_VECTOR1_VADDR so that it points to reset vector in the
  cacheable MMUv2 map for cores with MMU.
- reserve reset vector region in the physical memory map. Drop separate
  literal section and build mxhead.S with text section literals.

Cc: <stable@vger.kernel.org>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
arch/xtensa/include/asm/vectors.h
arch/xtensa/kernel/Makefile
arch/xtensa/kernel/setup.c
arch/xtensa/kernel/vectors.S
arch/xtensa/kernel/vmlinux.lds.S