base-hw: remove memory hole in bootstrap page table

Tests on qemu would fail when started with RAM sizes from 1025MiB to
2048MiB, because the the mapping hole in the page table from 1GiB to
2GiB would interfere with qemu's mapping addresses for ACPI.

Identity-map the complete first 4GiB of memory to catch all early
memory accesses during bootstrap.

Fixes #4724.
This commit is contained in:
Benjamin Lamowski 2023-01-16 17:11:35 +01:00 committed by Christian Helmuth
parent 79d8d1d557
commit 641fadb3e9

View File

@ -18,7 +18,7 @@
.data
/********************************************
** Identity mapping from 4KiB to 1GiB **
** Identity mapping from 4KiB to 4GiB **
** plus mappings for LAPIC, I/O APIC MMIO **
** Page 0 containing the Bios Data Area **
** gets mapped to 2MiB - 4KiB readonly. **
@ -35,7 +35,7 @@
.p2align MIN_PAGE_SIZE_LOG2
_kernel_pdp:
.quad _kernel_pd_0 + 0xf
.fill 1, 8, 0x0
.quad _kernel_pd_1 + 0xf
.quad _kernel_pd_2 + 0xf
.quad _kernel_pd_3 + 0xf
.fill 508, 8, 0x0
@ -50,6 +50,15 @@
.set entry, entry + 0x200000
.endr
/* PD [1G-2G) */
.p2align MIN_PAGE_SIZE_LOG2
_kernel_pd_1:
.set entry, 0x4000018f
.rept 512
.quad entry
.set entry, entry + 0x200000
.endr
/* PD [2G-3G) */
.p2align MIN_PAGE_SIZE_LOG2
_kernel_pd_2: