coreboot icon indicating copy to clipboard operation
coreboot copied to clipboard

Pae map

Open krystian-hebel opened this issue 1 year ago • 2 comments

krystian-hebel avatar May 07 '24 15:05 krystian-hebel

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.

krystian-hebel avatar May 09 '24 15:05 krystian-hebel

Updated to the latest version sent to gerrit (https://review.coreboot.org/c/coreboot/+/82249/3)

krystian-hebel avatar May 13 '24 10:05 krystian-hebel

Rebased and updated once again. The commits are now identical as those merged on upstream.

krystian-hebel avatar Jun 13 '24 14:06 krystian-hebel