From ffb7bc36bb4319baf58d0d83b9b002ff5d3947e5 Mon Sep 17 00:00:00 2001 From: "K. Lange" Date: Tue, 18 Apr 2023 22:45:19 +0900 Subject: [PATCH] aarch64: ensure module base address starts aligned --- kernel/arch/aarch64/mmu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/arch/aarch64/mmu.c b/kernel/arch/aarch64/mmu.c index b1d7aa6d..85ede416 100644 --- a/kernel/arch/aarch64/mmu.c +++ b/kernel/arch/aarch64/mmu.c @@ -948,4 +948,7 @@ void mmu_init(uintptr_t memaddr, size_t memsize, uintptr_t firstFreePage, uintpt lowest_available = (firstFreePage + bytesOfFrames) - memaddr; module_base_address = endOfRamDisk + MODULE_BASE_START; + if (module_base_address & PAGE_LOW_MASK) { + module_base_address = (module_base_address & PAGE_SIZE_MASK) + PAGE_SIZE; + } }