Skip to content

Commit

Permalink
xen/setup: Don't relocate p2m over existing one
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
rosslagerwall authored and jgross1 committed Dec 22, 2016
1 parent 709613a commit 7ecec85
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions arch/x86/xen/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -713,10 +713,9 @@ static void __init xen_reserve_xen_mfnlist(void)
size = PFN_PHYS(xen_start_info->nr_p2m_frames);
}

if (!xen_is_e820_reserved(start, size)) {
memblock_reserve(start, size);
memblock_reserve(start, size);
if (!xen_is_e820_reserved(start, size))
return;
}

#ifdef CONFIG_X86_32
/*
Expand All @@ -727,6 +726,7 @@ static void __init xen_reserve_xen_mfnlist(void)
BUG();
#else
xen_relocate_p2m();
memblock_free(start, size);
#endif
}

Expand Down

0 comments on commit 7ecec85

Please sign in to comment.