From a950021011e41b7d4fd285dde278cf9b06f89574 Mon Sep 17 00:00:00 2001 From: Anton Kling Date: Wed, 20 Mar 2024 18:08:57 +0100 Subject: MMU: Fixed massive problem in assumption of RAM layout This caused certain addreses which where not RAM memory to be assigned to virtual addresses incorrectly. This caused a significant slowdown when running it with KVM due to constantly having to exit the VM if the OS writes to memory that is not RAM. This fix increased the performance of KVM significantly and improved TCG performance. --- kernel/init/kernel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'kernel/init') diff --git a/kernel/init/kernel.c b/kernel/init/kernel.c index ef7cdae..180aaa8 100644 --- a/kernel/init/kernel.c +++ b/kernel/init/kernel.c @@ -43,7 +43,6 @@ uintptr_t data_end; void kernel_main(u32 kernel_end, unsigned long magic, unsigned long addr, u32 inital_stack) { - (void)kernel_end; data_end = 0xc0400000; inital_esp = inital_stack; @@ -55,7 +54,8 @@ void kernel_main(u32 kernel_end, unsigned long magic, unsigned long addr, u32 mem_kb = mb->mem_lower; u32 mem_mb = (mb->mem_upper - 1000) / 1000; u64 memsize_kb = mem_mb * 1000 + mem_kb; - paging_init(memsize_kb); + + paging_init(memsize_kb, mb); klog("Paging Initalized", LOG_SUCCESS); mb = mmu_map_frames((multiboot_info_t *)addr, sizeof(multiboot_info_t)); -- cgit v1.2.3