On 27.09.2024 00:14, Shawn Anastasio wrote: > On 4/24/24 9:46 AM, Jan Beulich wrote: >> On 12.04.2024 05:55, Shawn Anastasio wrote: >>> + /* >>> + * Identity map all pages we've allocated for paging structures. This >>> act >>> + * itself will allocate more pages, so continue until we've mapped from >>> + * `max_alloc_mfn` down to `min_alloc_mfn`. This assumes that the heap >>> grows >>> + * downwards, which matches the behavior of alloc_boot_pages. >> >> ... as long as you only ever allocate individual pages (which looks >> to be the case for such incremental allocations, but that imo doesn't >> go without saying). >> > > I'm not sure I'm following you. `initial_page_alloc` as well as its > underlying `alloc_boot_pages` can only ever allocate individual pages > (or contiguous ranges of pages).
It's this "or contiguous ranges of pages" which constitutes a problem. Once that happens, a portion of un-allocated pages may remain above that block. A subsequent single-page allocation may then use one of those pages, resulting in strict ordering to no longer hold. Or the space may remain un-allocated, and hence being mapped for no reason. Jan