Attention is currently required from: Christian Walter, Johnny Lin, Jonathan Zhang, Jérémy Compostella, Shuo Liu, Tim Chu.
Patrick Rudolph has posted comments on this change by Patrick Rudolph. ( https://review.coreboot.org/c/coreboot/+/85806?usp=email )
Change subject: cpu/x86/64bit: Install extended page tables in BSS ......................................................................
Patch Set 3:
(1 comment)
File src/cpu/x86/64bit/mmu.c:
https://review.coreboot.org/c/coreboot/+/85806/comment/ee7fd5ef_e7b1cfc5?usp... : PS3, Line 59: if (cpu_supports_1gb_hugepage()) { : const uintptr_t max_addr = 1ULL * GiB * 512ULL * 512ULL; : const uint64_t incr = 1ULL * GiB; : : /* Build P4MLE */ : for (int i = 0; i < 512; i++) : p4mle[i] = _GEN_DIR(&pdpt[i * 512]); : : /* Build PDPT */ : uint64_t *page_table_ptr = pdpt; : for (uintptr_t addr = 0; addr < max_addr; addr += incr, page_table_ptr++) : *page_table_ptr = _GEN_PAGE(addr); : } else { : const uintptr_t max_addr = 2ULL * MiB * 512ULL * 512ULL; : const uint64_t incr = 2ULL * MiB; : : /* Build P4MLE */ : p4mle[0] = _GEN_DIR(&pdpt[0]); : : /* Build PDPT */ : for (int i = 0; i < 512; i++) : pdpt[i] = _GEN_DIR(&pdt[i * 512]); : : /* Build PDT */ : uint64_t *page_table_ptr = pdt; : for (uintptr_t addr = 0; addr < max_addr; addr += incr, page_table_ptr++) : *page_table_ptr = _GEN_PAGE(addr); : } :
There are a lot in common between these two branches, isn't it a way to share more code ?
I don't see that. Please explain how it can be improved without reducing readability.