]> git.baikalelectronics.ru Git - kernel.git/commit
LoongArch: Jump to the link address before enable PG
authorHuacai Chen <chenhuacai@loongson.cn>
Thu, 11 Aug 2022 12:52:12 +0000 (20:52 +0800)
committerHuacai Chen <chenhuacai@loongson.cn>
Fri, 12 Aug 2022 05:10:11 +0000 (13:10 +0800)
commit8c85bb88665f28ffd090903d210be409cd8f6d98
tree479868eddc4b104801cf4c657daac305c9e5a0be
parent1b677f2e9462ae1e717b4e579ab7bda0069fc47c
LoongArch: Jump to the link address before enable PG

The kernel entry points of both boot CPU (i.e., kernel_entry) and non-
boot CPUs (i.e., smpboot_entry) may be physical address from BootLoader
(in DA mode or identity-mapping PG mode). So we should jump to the link
address before PG enabled (because DA is disabled at the same time) and
just after DMW configured.

Specifically: With some older firmwares, non-boot CPUs started with PG
enabled, but this need firmware cooperation in the form of a temporary
page table, which is deemed unnecessary. OTOH, latest firmware versions
configure the non-boot CPUs to start in DA mode, so kernel-side changes
are needed.

Reviewed-by: WANG Xuerui <git@xen0n.name>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
arch/loongarch/kernel/head.S