On Tue, Oct 27, 2020 at 03:40:07PM +0300, Kirill A. Shutemov wrote: > BTW, what happens if we underestimate BOOT_PGT_SIZE? Do we overwrite > something?
The boot code will print an error and stop the machine when allocating a page-table page fails. I also think that bumping BOOT_PGT_SIZE up to have more pages available is a good short-term solution. Recycling pages will also need to take page encryption attributes into account, as for SEV-ES the GHCB page needs to be mapped unencrypted. Another option to safe some memory is to make use of GB pages in the decompression code. Machines where the current BOOT_PGT_SIZE is too small will likely support GB pages too. Regards, Joerg