Commit 7ecec850 authored by Ross Lagerwall's avatar Ross Lagerwall Committed by Juergen Gross

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: default avatarRoss Lagerwall <ross.lagerwall@citrix.com>
Reviewed-by: default avatarJuergen Gross <jgross@suse.com>
Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
parent 709613ad
...@@ -713,10 +713,9 @@ static void __init xen_reserve_xen_mfnlist(void) ...@@ -713,10 +713,9 @@ static void __init xen_reserve_xen_mfnlist(void)
size = PFN_PHYS(xen_start_info->nr_p2m_frames); 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; return;
}
#ifdef CONFIG_X86_32 #ifdef CONFIG_X86_32
/* /*
...@@ -727,6 +726,7 @@ static void __init xen_reserve_xen_mfnlist(void) ...@@ -727,6 +726,7 @@ static void __init xen_reserve_xen_mfnlist(void)
BUG(); BUG();
#else #else
xen_relocate_p2m(); xen_relocate_p2m();
memblock_free(start, size);
#endif #endif
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment