2022-09-27 05:15:34

by Huacai Chen

[permalink] [raw]
Subject: [PATCH] LoongArch: Align the address of kernel_entry to 4KB

Align the address of kernel_entry to 4KB, to avoid early tlb miss
exception in case the entry code crosses page boundary.

Signed-off-by: Huacai Chen <[email protected]>
---
arch/loongarch/kernel/head.S | 2 ++
1 file changed, 2 insertions(+)

diff --git a/arch/loongarch/kernel/head.S b/arch/loongarch/kernel/head.S
index 8f89f39fd31b..7e57ae8741b1 100644
--- a/arch/loongarch/kernel/head.S
+++ b/arch/loongarch/kernel/head.S
@@ -34,6 +34,8 @@ SYM_DATA(kernel_offset, .long kernel_offset - _text);

__REF

+ .align 12
+
SYM_CODE_START(kernel_entry) # kernel entry point

/* Config direct window and set PG */
--
2.31.1