Attention is currently required from: Patrick Rudolph. Arthur Heymans has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/56096 )
Change subject: TESTONLY: Link pagetables into programs instead of using a cbfs file ......................................................................
Patch Set 1:
(1 comment)
File src/cpu/x86/64bit/pt.S:
https://review.coreboot.org/c/coreboot/+/56096/comment/1138c642_9ec526a8 PS1, Line 14: .align 32
This is the alignment relative to _program. Shouldn't all CBFS files using this assembly code then be aligned to 4096 as well?
Does it work for bootblock where _eprogram is aligned to 4GiB instead of _program?
So bootblock is a special program. It is linked at the address it gets executed, which means this just works. Other programs should be aligned to 4096, which would be cbfstool's job. Relocatable stages already have 4K runtime alignment afaict: https://review.coreboot.org/plugins/gitiles/coreboot/+/refs/heads/master/src.... So the only thing left to do is 4K alignment for early programs, especially those that are XIP.
Anyway RO/part of program PT are not always needed. We might need to differentiate: - Some platforms have enough CAR that you could generate it in place - On Intel GLK, PT are copied from cbfs into CAR -> this could be probably be improved too - RAM stages could have the PT in DRAM: care needs to be taken in postcar, e.g. if PT are in CAR. I think with stages in DRAM you want the PT in .bss or .data an just put an identity table in there, either generated or static. - SMM is weird. You can't link a PT inside the stub, but the stub needs to know where it is: preferably inside the permanent handler or inside ramstage during relocation. That means a stub relocatable param pointing to it. - Sipi Vector in ramstage: you probably also want a pointer to the ramstage PT inside the relocatable params.