coreboot
coreboot copied to clipboard
Pae map
To test it, I added the following code in one of the functions run in ramstage:
static char pgtbl[20*1024] __aligned(4096);
init_pae_pagetables(&pgtbl);
for (int i = 0; i < 0x1000000; i += 0x200000) {
pae_map_2M_page(&pgtbl, 0x100000000ull + i, (void *)CONFIG_ECAM_MMCONF_BASE_ADDRESS);
printk(BIOS_DEBUG, "ptr*=0x%08x\n", *(volatile uint32_t *)CONFIG_ECAM_MMCONF_BASE_ADDRESS);
}
paging_disable_pae();
QEMU started with:
qemu-system-x86_64 -drive if=pflash,format=raw,unit=0,file=build/coreboot.rom -serial stdio -M q35,smm=on -m 4096 -device loader,file=test.bin,addr=0x100000000
test.bin was prepared with random data and compared with what coreboot printed.
I think that for our case using MMCONF should work, we don't do any device initialization during parsing of capsules, and paging_disable_pae() restores identity mapping by disabling paging.
Updated to the latest version sent to gerrit (https://review.coreboot.org/c/coreboot/+/82249/3)
Rebased and updated once again. The commits are now identical as those merged on upstream.