Attention is currently required from: Arthur Heymans, Benjamin Doron, Christian Walter, Felix Held, Patrick Rudolph, Subrata Banik.
Julius Werner has posted comments on this change by Benjamin Doron. ( https://review.coreboot.org/c/coreboot/+/79161?usp=email )
Change subject: arch/x86/mmu: Port armv8 MMU to x86_64 ......................................................................
Patch Set 11:
(1 comment)
Commit Message:
https://review.coreboot.org/c/coreboot/+/79161/comment/78b9db9e_4568d537?usp... : PS11, Line 16: DRAM and MMIO even beyond 4GiB.
On SPR I need to access a BAR in high MMIO at `0x200ffff90000`. That would increase pt1G. […]
They have a BAR at 8 terrabytes in the linear address space!? And you can't modify that to be anywhere more reasonable? Wow...
`0x2000'0000'0000` would actually be a different PML4 than the start of memory (each PML4 goes up to `0x7f'ffff'ffff`, and pt1G currently only adds the first one). So we don't need to add page directories for the entire space between `0` and `0x2000'0000'0000`, we just need to add them for those two PML4s. So we just need to come up with a clever Kconfig scheme to have the assembly output exactly the PML4s that you need. Maybe something like this could work: ``` .global PML4 .align 4096 PML4: .quad _GEN_DIR(PDPT0) .ifne CONFIG_PML4_1 .zero (CONFIG_PML4_1 - 1) * 8 .quad _GEN_DIR(PDPT1) .ifne CONFIG_PML4_2 .zero (CONFIG_PML4_2 - CONFIG_PML4_1 - 1) * 8 .quad _GEN_DIR(PDPT2) .ifne CONFIG_PML4_3 .zero (CONFIG_PML4_3 - CONFIG_PML4_2 - 1) * 8 .quad _GEN_DIR(PDPT3) .endif .endif .endif .zero PML4 + 4096 - .
PDPT0: .rept 512 .quad _GEN_PAGE(0x40000000 * ((. - PDPT0) >> 3)) .ifne CONFIG_PML4_1 PDPT1: .rept 512 .quad _GEN_PAGE(CONFIG_PML4_1 << 39 + 0x40000000 * ((. - PDPT1) >> 3)) .ifne CONFIG_PML4_2 PDPT2: .rept 512 .quad _GEN_PAGE(CONFIG_PML4_2 << 39 + 0x40000000 * ((. - PDPT2) >> 3)) .ifne CONFIG_PML4_3 PDPT3: .rept 512 .quad _GEN_PAGE(CONFIG_PML4_3 << 39 + 0x40000000 * ((. - PDPT3) >> 3)) .endif .endif .endif ``` That should give you the ability to designate 3 (can be expanded as needed) PML4s that should be mapped for all your crazy high BAR needs, while only adding 4K (uncompressed) per PML4 you actually use to your ramstage .rodata.