The number of pages marked initially as reserved in the memory map are counted to be allocated, as they are normally populated by Xen tools for e.g. xenbus and console ring pages.
This is wrong in case the lapic page is marked as reserved in the memory map, as there is never memory allocated for a lapic. So when finding the lapic page to be marked as reserved, don't add it to the number of reserved pages. Fixes: 9b87429d2864 ("mini-os: fix number of pages for PVH") Signed-off-by: Juergen Gross <jgr...@suse.com> Reviewed-by: Jason Andryuk <jason.andr...@amd.com> --- e820.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/e820.c b/e820.c index 16622e23..44cfac05 100644 --- a/e820.c +++ b/e820.c @@ -275,7 +275,10 @@ static void e820_sanitize(void) e820_initial_reserved_pfns += e820_map[i].size / PAGE_SIZE; if ( e820_map[i].addr <= LAPIC_ADDRESS && e820_map[i].addr + e820_map[i].size > LAPIC_ADDRESS ) + { found_lapic = true; + e820_initial_reserved_pfns--; + } } } -- 2.43.0