coconut-svsm / svsm

COCONUT-SVSM
MIT License
113 stars 39 forks source link

kernel/mm: Reduce stack footprint of page-table freeing #442

Closed joergroedel closed 1 month ago

joergroedel commented 1 month ago

Turns out that the way the iterators are implemented in RawPageTablePart::free_lvl*() the compiler makes copies of entire pages on the stack, which overflows the 32 KiB stack pretty quickly.

Iterate over references only and significantly reduce stack usage of the page-table freeing code.