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)
commitab2579d79529b8ed34f26a374a352f12ce24d5df
tree479868eddc4b104801cf4c657daac305c9e5a0be
parent5e8be07ca8f7f49d49c6d5d44f69caaa2fa4b660
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