Skip to content

Commit 7ecec85

Browse files
rosslagerwalljgross1
authored andcommitted
xen/setup: Don't relocate p2m over existing one
When relocating the p2m, take special care not to relocate it so that is overlaps with the current location of the p2m/initrd. This is needed since the full extent of the current location is not marked as a reserved region in the e820. This was seen to happen to a dom0 with a large initial p2m and a small reserved region in the middle of the initial p2m. Signed-off-by: Ross Lagerwall <[email protected]> Reviewed-by: Juergen Gross <[email protected]> Signed-off-by: Juergen Gross <[email protected]>
1 parent 709613a commit 7ecec85

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

arch/x86/xen/setup.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -713,10 +713,9 @@ static void __init xen_reserve_xen_mfnlist(void)
713713
size = PFN_PHYS(xen_start_info->nr_p2m_frames);
714714
}
715715

716-
if (!xen_is_e820_reserved(start, size)) {
717-
memblock_reserve(start, size);
716+
memblock_reserve(start, size);
717+
if (!xen_is_e820_reserved(start, size))
718718
return;
719-
}
720719

721720
#ifdef CONFIG_X86_32
722721
/*
@@ -727,6 +726,7 @@ static void __init xen_reserve_xen_mfnlist(void)
727726
BUG();
728727
#else
729728
xen_relocate_p2m();
729+
memblock_free(start, size);
730730
#endif
731731
}
732732

0 commit comments

Comments
 (0)