LoongArch: Fix entry point in kernel image header
authorJiaxun Yang <jiaxun.yang@flygoat.com>
Mon, 3 Jun 2024 07:45:53 +0000 (15:45 +0800)
committerHuacai Chen <chenhuacai@loongson.cn>
Mon, 3 Jun 2024 07:45:53 +0000 (15:45 +0800)
commitbeb2800074c15362cf9f6c7301120910046d6556
tree2b854fc369a70148e140632779a1effe42ec372a
parent3de9c42d02a79a5e09bbee7a4421ddc00cfd5c6d
LoongArch: Fix entry point in kernel image header

Currently kernel entry in head.S is in DMW address range, firmware is
instructed to jump to this address after loading the kernel image.

However kernel should not make any assumption on firmware's DMW
setting, thus the entry point should be a physical address falls into
direct translation region.

Fix by converting entry address to physical and amend entry calculation
logic in libstub accordingly.

BTW, use ABSOLUTE() to calculate variables to make Clang/LLVM happy.

Cc: stable@vger.kernel.org
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
arch/loongarch/kernel/head.S
arch/loongarch/kernel/vmlinux.lds.S
drivers/firmware/efi/libstub/loongarch.c