On 31.08.2021 16:07, Andrew Cooper wrote: > On 30/08/2021 14:03, Jan Beulich wrote: >> Assuming that the accounting for IOMMU page tables will also take care >> of the P2M needs was wrong: dom0_paging_pages() can determine a far >> higher value, high enough for the system to run out of memory while >> setting up Dom0. Hence in the case of shared page tables the larger of >> the two values needs to be used (without shared page tables the sum of >> both continues to be applicable). > > I'm afraid that I can't follow this at all. > > What causes the system to run out of RAM while constructing dom0?
Without any "dom0_mem=" we set aside 128Mb. In my .config that was in use I default to "dom0_mem=-255". Yet this was still far from enough to cover the gap between the original IOMMU page table accounting and the value returned from dom0_paging_pages(). Since this is what also gets used to actually populate Dom0's P2M pool, with the P2M pool populated there wasn't enough RAM anymore to reach the Dom0 size which dom0_compute_nr_pages() did establish. Putting it in a simplified formula, what we did so far when sharing page tables was RAM = total - IOMMU but what we need is RAM = total - max(IOMMU, P2M) In the non-shared case we already correctly did RAM = total - (IOMMU + P2M) Jan